summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArno Töll <arno@debian.org>2012-11-21 23:04:05 +0100
committerArno Töll <arno@debian.org>2012-11-21 23:04:05 +0100
commite787ca6640e45e5c28913d149b0ecd9810930b8a (patch)
tree0864b0dfde2872cf629fc0402f9dd2b8ef6c5f9c
parent6c8b72678daa33f7e9df2a97d6404380e1b2e8ca (diff)
downloadlighttpd-e787ca6640e45e5c28913d149b0ecd9810930b8a.tar.gz
Imported Upstream version 1.4.8upstream/1.4.8
-rw-r--r--AUTHORS7
-rw-r--r--COPYING20
-rw-r--r--ChangeLog4031
-rw-r--r--INSTALL2
-rw-r--r--Makefile.am8
-rw-r--r--Makefile.in446
-rw-r--r--NEWS656
-rw-r--r--README27
-rw-r--r--SConstruct277
-rw-r--r--aclocal.m46921
-rwxr-xr-xautogen.sh92
-rwxr-xr-xcompile152
-rwxr-xr-xconfig.guess191
-rw-r--r--config.h.in101
-rwxr-xr-xconfig.sub210
-rwxr-xr-xconfigure35188
-rw-r--r--configure.in (renamed from configure.ac)289
-rw-r--r--cygwin/Makefile.am1
-rw-r--r--cygwin/Makefile.in (renamed from doc/systemd/Makefile.in)214
-rw-r--r--cygwin/lighttpd.README114
-rw-r--r--cygwin/lighttpd.README.in114
-rw-r--r--cygwin/setup.hint4
-rwxr-xr-xdepcomp272
-rw-r--r--distribute.sh.in8
-rw-r--r--doc/Makefile.am98
-rw-r--r--doc/Makefile.in670
-rw-r--r--doc/access.txt (renamed from doc/outdated/access.txt)6
-rw-r--r--doc/accesslog.txt (renamed from doc/outdated/accesslog.txt)46
-rw-r--r--doc/alias.txt (renamed from doc/outdated/alias.txt)8
-rw-r--r--doc/authentication.txt (renamed from doc/outdated/authentication.txt)124
-rw-r--r--doc/cgi.txt (renamed from doc/outdated/cgi.txt)8
-rw-r--r--doc/cml.txt (renamed from doc/outdated/cml.txt)93
-rw-r--r--doc/compress.txt66
-rw-r--r--doc/config/Makefile.am2
-rw-r--r--doc/config/Makefile.in604
-rw-r--r--doc/config/conf.d/Makefile.am25
-rw-r--r--doc/config/conf.d/Makefile.in426
-rw-r--r--doc/config/conf.d/access_log.conf27
-rw-r--r--doc/config/conf.d/auth.conf27
-rw-r--r--doc/config/conf.d/cgi.conf33
-rw-r--r--doc/config/conf.d/cml.conf27
-rw-r--r--doc/config/conf.d/compress.conf31
-rw-r--r--doc/config/conf.d/debug.conf47
-rw-r--r--doc/config/conf.d/dirlisting.conf55
-rw-r--r--doc/config/conf.d/evhost.conf22
-rw-r--r--doc/config/conf.d/expire.conf22
-rw-r--r--doc/config/conf.d/fastcgi.conf135
-rw-r--r--doc/config/conf.d/geoip.conf26
-rw-r--r--doc/config/conf.d/magnet.conf22
-rw-r--r--doc/config/conf.d/mime.conf77
-rw-r--r--doc/config/conf.d/mod.template16
-rw-r--r--doc/config/conf.d/mysql_vhost.conf47
-rw-r--r--doc/config/conf.d/proxy.conf35
-rw-r--r--doc/config/conf.d/rrdtool.conf21
-rw-r--r--doc/config/conf.d/scgi.conf51
-rw-r--r--doc/config/conf.d/secdownload.conf35
-rw-r--r--doc/config/conf.d/simple_vhost.conf28
-rw-r--r--doc/config/conf.d/ssi.conf16
-rw-r--r--doc/config/conf.d/status.conf24
-rw-r--r--doc/config/conf.d/trigger_b4_dl.conf70
-rw-r--r--doc/config/conf.d/userdir.conf37
-rw-r--r--doc/config/conf.d/webdav.conf33
-rw-r--r--doc/config/lighttpd.conf445
-rw-r--r--doc/config/modules.conf172
-rw-r--r--doc/config/vhosts.d/Makefile.am1
-rw-r--r--doc/config/vhosts.d/Makefile.in401
-rw-r--r--doc/config/vhosts.d/vhosts.template33
-rw-r--r--doc/configuration.txt (renamed from doc/outdated/configuration.txt)324
-rw-r--r--doc/expire.txt (renamed from doc/outdated/expire.txt)12
-rw-r--r--doc/fastcgi-state.dot (renamed from doc/outdated/fastcgi-state.dot)0
-rw-r--r--doc/fastcgi-state.txt (renamed from doc/outdated/fastcgi-state.txt)10
-rw-r--r--doc/fastcgi.txt637
-rw-r--r--doc/features.txt (renamed from doc/outdated/features.txt)62
-rw-r--r--doc/initscripts/Makefile.am1
-rw-r--r--doc/initscripts/Makefile.in401
-rw-r--r--doc/lighttpd.118
-rw-r--r--doc/lighttpd.870
-rw-r--r--doc/lighttpd.conf321
-rw-r--r--doc/lighttpd.user1
-rw-r--r--doc/mysqlvhost.txt (renamed from doc/outdated/mysqlvhost.txt)19
-rw-r--r--doc/outdated/Makefile.am96
-rw-r--r--doc/outdated/Makefile.in496
-rw-r--r--doc/outdated/compress.txt192
-rw-r--r--doc/outdated/dirlisting.txt126
-rw-r--r--doc/outdated/evhost.txt46
-rw-r--r--doc/outdated/extforward.txt105
-rw-r--r--doc/outdated/fastcgi.txt601
-rw-r--r--doc/outdated/magnet.txt429
-rw-r--r--doc/outdated/performance.txt239
-rw-r--r--doc/outdated/status.txt111
-rw-r--r--doc/performance.txt226
-rw-r--r--doc/plugins.txt (renamed from doc/outdated/plugins.txt)108
-rw-r--r--doc/proxy.txt (renamed from doc/outdated/proxy.txt)40
-rwxr-xr-xdoc/rc.lighttpd (renamed from doc/initscripts/rc.lighttpd)15
-rwxr-xr-xdoc/rc.lighttpd.redhat (renamed from doc/initscripts/rc.lighttpd.redhat)0
-rw-r--r--doc/redirect.txt (renamed from doc/outdated/redirect.txt)14
-rw-r--r--doc/rewrite.txt (renamed from doc/outdated/rewrite.txt)55
-rwxr-xr-xdoc/rrdtool-graph.sh (renamed from doc/scripts/rrdtool-graph.sh)0
-rw-r--r--doc/rrdtool.txt (renamed from doc/outdated/rrdtool.txt)18
-rw-r--r--doc/scgi.txt (renamed from doc/outdated/scgi.txt)8
-rw-r--r--doc/scripts/Makefile.am3
-rw-r--r--doc/secdownload.txt (renamed from doc/outdated/secdownload.txt)98
-rw-r--r--doc/security.txt (renamed from doc/outdated/security.txt)8
-rw-r--r--doc/setenv.txt (renamed from doc/outdated/setenv.txt)8
-rw-r--r--doc/simple-vhost.txt (renamed from doc/outdated/simple-vhost.txt)56
-rw-r--r--doc/skeleton.txt (renamed from doc/outdated/skeleton.txt)4
-rw-r--r--doc/spawn-fcgi.113
-rwxr-xr-xdoc/spawn-php.sh (renamed from doc/scripts/spawn-php.sh)16
-rw-r--r--doc/ssi.txt (renamed from doc/outdated/ssi.txt)12
-rw-r--r--doc/ssl.txt (renamed from doc/outdated/ssl.txt)27
-rw-r--r--doc/state.dot (renamed from doc/outdated/state.dot)0
-rw-r--r--doc/state.txt (renamed from doc/outdated/state.txt)42
-rw-r--r--doc/status.txt35
-rw-r--r--doc/sysconfig.lighttpd (renamed from doc/initscripts/sysconfig.lighttpd)0
-rw-r--r--doc/systemd/Makefile.am1
-rw-r--r--doc/systemd/lighttpd.service10
-rw-r--r--doc/traffic-shaping.txt (renamed from doc/outdated/traffic-shaping.txt)32
-rw-r--r--doc/trigger_b4_dl.txt (renamed from doc/outdated/trigger_b4_dl.txt)18
-rw-r--r--doc/userdir.txt (renamed from doc/outdated/userdir.txt)28
-rw-r--r--doc/webdav.txt (renamed from doc/outdated/webdav.txt)22
-rwxr-xr-xinstall-sh660
-rw-r--r--lighttpd.spec86
-rw-r--r--lighttpd.spec.in86
-rw-r--r--ltmain.sh9945
-rw-r--r--m4/libtool.m48001
-rw-r--r--m4/ltoptions.m4384
-rw-r--r--m4/ltsugar.m4123
-rw-r--r--m4/ltversion.m423
-rw-r--r--m4/lt~obsolete.m498
-rwxr-xr-xmissing226
-rwxr-xr-xmkinstalldirs111
-rw-r--r--openwrt/Makefile.am1
-rw-r--r--openwrt/Makefile.in (renamed from doc/scripts/Makefile.in)219
-rwxr-xr-xopenwrt/S51lighttpd4
-rw-r--r--openwrt/conffiles1
-rw-r--r--openwrt/control9
-rw-r--r--openwrt/control.in9
-rw-r--r--openwrt/lighttpd.conf231
-rw-r--r--openwrt/lighttpd.mk72
-rw-r--r--openwrt/lighttpd.mk.in72
-rw-r--r--src/Makefile.am140
-rw-r--r--src/Makefile.in1378
-rw-r--r--src/SConscript192
-rw-r--r--src/array.c191
-rw-r--r--src/array.h71
-rw-r--r--src/base.h333
-rw-r--r--src/bitset.c6
-rw-r--r--src/buffer.c351
-rw-r--r--src/buffer.h25
-rw-r--r--src/chunk.c143
-rw-r--r--src/chunk.h16
-rw-r--r--src/configfile-glue.c320
-rw-r--r--src/configfile.c825
-rw-r--r--src/configfile.h6
-rw-r--r--src/configparser.c965
-rw-r--r--src/configparser.h23
-rw-r--r--src/configparser.y200
-rw-r--r--src/connections-glue.c9
-rw-r--r--src/connections.c1480
-rw-r--r--src/crc32.h6
-rw-r--r--src/data_array.c20
-rw-r--r--src/data_config.c56
-rw-r--r--src/data_count.c30
-rw-r--r--src/data_fastcgi.c28
-rw-r--r--src/data_integer.c24
-rw-r--r--src/data_string.c59
-rw-r--r--src/etag.c49
-rw-r--r--src/etag.h8
-rw-r--r--src/fastcgi.h4
-rw-r--r--src/fdevent.c139
-rw-r--r--src/fdevent.h144
-rw-r--r--src/fdevent_freebsd_kqueue.c123
-rw-r--r--src/fdevent_libev.c171
-rw-r--r--src/fdevent_linux_rtsig.c260
-rw-r--r--src/fdevent_linux_sysepoll.c94
-rw-r--r--src/fdevent_poll.c107
-rw-r--r--src/fdevent_select.c56
-rw-r--r--src/fdevent_solaris_devpoll.c106
-rw-r--r--src/fdevent_solaris_port.c172
-rw-r--r--src/http-header-glue.c216
-rw-r--r--src/http_auth.c961
-rw-r--r--src/http_auth.h35
-rw-r--r--src/http_auth_digest.c101
-rw-r--r--src/http_auth_digest.h48
-rw-r--r--src/http_chunk.c75
-rw-r--r--src/inet_ntop_cache.c29
-rw-r--r--src/joblist.c28
-rw-r--r--src/keyvalue.c127
-rw-r--r--src/keyvalue.h45
-rw-r--r--src/lemon.c112
-rw-r--r--src/lempar.c48
-rw-r--r--src/lighttpd-angel.c159
-rw-r--r--src/log.c302
-rw-r--r--src/log.h9
-rw-r--r--src/md5.c35
-rw-r--r--src/md5.h9
-rw-r--r--src/mod_access.c121
-rw-r--r--src/mod_accesslog.c670
-rw-r--r--src/mod_alias.c106
-rw-r--r--src/mod_auth.c535
-rw-r--r--src/mod_cgi.c992
-rw-r--r--src/mod_cml.c349
-rw-r--r--src/mod_cml.h17
-rw-r--r--src/mod_cml_funcs.c166
-rw-r--r--src/mod_cml_funcs.h2
-rw-r--r--src/mod_cml_lua.c276
-rw-r--r--src/mod_compress.c616
-rw-r--r--src/mod_dirlisting.c500
-rw-r--r--src/mod_evasive.c211
-rw-r--r--src/mod_evhost.c167
-rw-r--r--src/mod_expire.c219
-rw-r--r--src/mod_extforward.c517
-rw-r--r--src/mod_fastcgi.c3421
-rw-r--r--src/mod_flv_streaming.c277
-rw-r--r--src/mod_indexfile.c114
-rw-r--r--src/mod_magnet.c1110
-rw-r--r--src/mod_magnet_cache.c137
-rw-r--r--src/mod_magnet_cache.h33
-rw-r--r--src/mod_mysql_vhost.c172
-rw-r--r--src/mod_proxy.c839
-rw-r--r--src/mod_redirect.c183
-rw-r--r--src/mod_rewrite.c418
-rw-r--r--src/mod_rrdtool.c379
-rw-r--r--src/mod_scgi.c1852
-rw-r--r--src/mod_secure_download.c178
-rw-r--r--src/mod_setenv.c140
-rw-r--r--src/mod_simple_vhost.c127
-rw-r--r--src/mod_skeleton.c106
-rw-r--r--src/mod_ssi.c683
-rw-r--r--src/mod_ssi.h19
-rw-r--r--src/mod_ssi_expr.c196
-rw-r--r--src/mod_ssi_expr.h6
-rw-r--r--src/mod_ssi_exprparser.c161
-rw-r--r--src/mod_ssi_exprparser.y37
-rw-r--r--src/mod_staticfile.c380
-rw-r--r--src/mod_status.c678
-rw-r--r--src/mod_trigger_b4_dl.c269
-rw-r--r--src/mod_userdir.c153
-rw-r--r--src/mod_usertrack.c181
-rw-r--r--src/mod_webdav.c1371
-rw-r--r--src/network.c776
-rw-r--r--src/network.h2
-rw-r--r--src/network_backends.h24
-rw-r--r--src/network_freebsd_sendfile.c158
-rw-r--r--src/network_linux_sendfile.c172
-rw-r--r--src/network_openssl.c136
-rw-r--r--src/network_solaris_sendfilev.c118
-rw-r--r--src/network_write.c161
-rw-r--r--src/network_writev.c175
-rw-r--r--src/plugin.c195
-rw-r--r--src/plugin.h22
-rw-r--r--src/proc_open.c72
-rw-r--r--src/proc_open.h2
-rw-r--r--src/request.c729
-rw-r--r--src/response.c535
-rw-r--r--src/response.h5
-rw-r--r--src/server.c920
-rw-r--r--src/settings.h27
-rw-r--r--src/spawn-fcgi.c431
-rw-r--r--src/splaytree.c21
-rw-r--r--src/splaytree.h2
-rw-r--r--src/stat_cache.c343
-rw-r--r--src/stat_cache.h2
-rw-r--r--src/status_counter.c61
-rw-r--r--src/status_counter.h14
-rw-r--r--src/stream.c42
-rw-r--r--src/sys-socket.h1
-rw-r--r--src/version.h12
-rw-r--r--tests/404-handler.conf49
-rwxr-xr-xtests/LightyTest.pm251
-rw-r--r--tests/Makefile.am20
-rw-r--r--tests/Makefile.in484
-rw-r--r--tests/SConscript46
-rw-r--r--tests/bug-06.conf60
-rw-r--r--tests/bug-12.conf60
-rwxr-xr-xtests/cachable.t121
-rw-r--r--tests/condition.conf30
-rwxr-xr-xtests/core-404-handler.t76
-rwxr-xr-xtests/core-condition.t26
-rwxr-xr-xtests/core-keepalive.t11
-rwxr-xr-xtests/core-request.t44
-rwxr-xr-xtests/core-response.t11
-rwxr-xr-xtests/core-var-include.t12
-rwxr-xr-xtests/core.t43
-rw-r--r--tests/docroot/123/Makefile.am2
-rw-r--r--tests/docroot/123/Makefile.in205
-rw-r--r--tests/docroot/Makefile.in336
-rwxr-xr-xtests/docroot/www/404.fcgi27
-rw-r--r--tests/docroot/www/404.html1
-rwxr-xr-xtests/docroot/www/404.pl33
-rw-r--r--tests/docroot/www/Makefile.am4
-rw-r--r--tests/docroot/www/Makefile.in340
-rw-r--r--tests/docroot/www/cgi-pathinfo.pl2
-rwxr-xr-xtests/docroot/www/cgi.php2
-rw-r--r--tests/docroot/www/cgi.pl2
-rw-r--r--tests/docroot/www/crlfcrash.pl4
-rw-r--r--tests/docroot/www/dummydir/.svn/README.txt2
-rw-r--r--tests/docroot/www/dummydir/.svn/empty-file0
-rw-r--r--tests/docroot/www/dummydir/.svn/entries13
-rw-r--r--tests/docroot/www/dummydir/.svn/format1
-rw-r--r--tests/docroot/www/expire/Makefile.in203
-rw-r--r--tests/docroot/www/get-env.php5
-rw-r--r--tests/docroot/www/get-server-env.php2
-rw-r--r--tests/docroot/www/go/Makefile.in203
-rwxr-xr-xtests/docroot/www/go/cgi.php2
-rw-r--r--tests/docroot/www/indexfile/Makefile.in203
-rw-r--r--tests/docroot/www/indexfile/return-404.php6
-rwxr-xr-xtests/docroot/www/nph-status.pl10
-rwxr-xr-xtests/docroot/www/send404.pl5
-rw-r--r--tests/docroot/www/sendfile.php13
-rw-r--r--tests/fastcgi-10.conf18
-rw-r--r--tests/fastcgi-13.conf22
-rw-r--r--tests/fastcgi-auth.conf65
-rw-r--r--tests/fastcgi-responder.conf72
-rw-r--r--tests/fcgi-auth.c21
-rw-r--r--tests/fcgi-responder.c23
-rw-r--r--tests/lighttpd.conf93
-rw-r--r--tests/lowercase.conf80
-rwxr-xr-xtests/lowercase.t94
-rwxr-xr-xtests/mod-access.t19
-rwxr-xr-xtests/mod-auth.t82
-rwxr-xr-xtests/mod-cgi.t38
-rw-r--r--tests/mod-compress.conf33
-rwxr-xr-xtests/mod-compress.t37
-rwxr-xr-xtests/mod-fastcgi.t148
-rwxr-xr-xtests/mod-proxy.t86
-rwxr-xr-xtests/mod-redirect.t20
-rwxr-xr-xtests/mod-rewrite.t46
-rwxr-xr-xtests/mod-secdownload.t79
-rwxr-xr-xtests/mod-setenv.t11
-rwxr-xr-xtests/mod-ssi.t10
-rwxr-xr-xtests/mod-userdir.t10
-rwxr-xr-xtests/prepare.sh3
-rw-r--r--tests/proxy.conf157
-rwxr-xr-xtests/request.t143
-rwxr-xr-xtests/run-tests.pl11
-rwxr-xr-xtests/symlink.t115
-rw-r--r--tests/var-include.conf14
-rwxr-xr-xtests/wrapper.sh8
339 files changed, 56247 insertions, 62324 deletions
diff --git a/AUTHORS b/AUTHORS
index 590be9d..80ea411 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,6 +1 @@
-Jan Kneschke <jan@kneschke.de>
-Elan Ruusamäe <glen@delfi.ee>
-Marcus Rückert <darix@opensu.se>
-mOo <moo.lighttpd@gmail.com>
-Robert Jakabosky <bobby@neoawareness.com>
-Stefan Bühler <stbuehler@web.de>
+jan kneschke <jan@kneschke.de>
diff --git a/COPYING b/COPYING
index 1333e45..3f69976 100644
--- a/COPYING
+++ b/COPYING
@@ -17,15 +17,15 @@ modification, are permitted provided that the following conditions are met:
be used to endorse or promote products derived from this software without
specific prior written permission.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..26e6528
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,4031 @@
+CVS-Version: $Id: ChangeLog,v 1.18 2004/04/09 22:08:19 weigon Exp $
+
+** NOTE **
+
+This file is abondend in favour of the NEWS file
+
+** NOTE **
+
+
+15.06.2005 20:10 - 1.3.15
+- mod_cml, mod_trigger_b4_dl
+
+ added both plugins
+
+ check http://trac.lighttpd.net/trac/log/branches/lighttpd-1.3.x/ for the
+ rest
+
+15.06.2005 13:59 - 1.3.14
+- documentation
+
+ more fix-ups for mod_fastcgi, configuration and mysql-vhost
+
+- tests
+
+ unified test-scripts to use the same framework
+
+14.06.2005 23:38
+- documentation
+
+ updated docs for mod_proxy and mod_scgi
+
+12.06.2005 12:55 - pre-release
+- mod_fastcgi
+
+ fixed event handling after delayed connect
+
+ make retry timeout configurable
+
+ removed unused events if we switch to FCGI_STATE_READ
+
+ disabled adaptive spawning
+
+- mod_proxy
+
+ added hash-based and round-robin balancing
+
+ use port 80 is default
+
+ fixed errorhandling on connection refused
+
+ fixed usage of dead hosts [285]
+
+- mod_cgi
+
+ send 500 if the CGI died before we received any data
+
+ redirect the stderr of CGI to our errorlog
+
+ cleanup cgi-env after we finished our request
+
+- uri-handling
+
+ don't replace + to space before the ?query part
+
+ accept characters > 127 again
+
+- mod_auth
+
+ fixed segfault if debugging is enabled [371]
+
+- mod_scgi
+
+ added SCGI support for python + WSGI [381], [382]
+
+- mod_setenv
+
+ fixed conditionals for setenv.add-environment [109]
+
+- generic
+
+ report an error on duplicate config-keys in configfile [267]
+
+ call initgroups to join the groups of the users [239]
+
+ fixed automatic redirects if SSL is used
+
+ fixed compilation on Solaris [283]
+
+ disable accept-filtering on FreeBSD if ssl is used [320]
+
+ fixed handling of range-request larger than 2Gb
+
+ fixed comparisions of mime-types to case-insensitive [266]
+
+ added quotation of ETags [376], [378]
+
+06.03.2005 12:22 - 1.3.13
+- mod_accesslog
+
+ fixed NULL dereference on logfile cycling if accesslog is not set
+
+05.03.2005 17:30
+- mod_proxy
+
+ handle delayed connect in the same way as mod_fastcgi
+
+03.03.2005 19:00
+- freebsd
+
+ handle remote-close gracefully
+
+- ssl
+
+ handle remote-close gracefully
+
+- dir-listing
+
+ added dir-listing.hide-dotfiles and added an option to set css files
+
+02.03.2005 19:41
+- fastcgi
+
+ fixed path-info for prefix-patterns
+
+ fixed path-info for PHP
+
+02.03.2005 14:47 - 1.3.12
+- mod_fastcgi
+
+ fixed handling of dead fastcgi process which sent their SIGCLD to
+ initd and not to lighttpd. Moving the daemonize before starting
+ the fastcgi procs fixes this.
+
+01.03.2005 23:59
+- irix
+
+ fixed minor compile issues with MIPSpro
+
+01.03.2005 11:57
+- request-handling
+
+ handle most duplicate headers as 400, Bug #25
+
+- mod_fastcgi
+
+ added more checks
+
+28.02.2005 18:26
+- mod_expire
+
+ don't ignore 'modification' any more, Bug #39
+ only handles static files
+
+- last-modified
+
+ really compare timestamps, Bug #34
+
+28.02.2005 11:54
+- buffer
+
+ rewrote int2buffer functions
+
+ simplified path_simplify
+
+- pid-file
+
+ ignore EACCESS on unlink
+
+28.02.2005 10:35
+- mod_fastcgi
+
+ accept \n\n, Bug #32
+
+- cygwin
+
+ moved functions used by plugin and main-program to *-glue.c
+
+- lemon
+
+ removed warnings about shadowed variables
+
+28.02.2005 01:00
+- ssl
+
+ added ssl.ca-file, Bug #19
+
+ improved error-messages
+
+27.02.2005 23:48
+- test cases
+
+ rewrote to test-framework to use Perl + Test::More
+ ported more test-cases
+
+22.02.2005 01:20
+- mod_fastcgi
+
+ replaced inet_addr by inet_aton
+
+- request-handling
+
+ fixed segfault if host is empty
+
+20.02.2005 20:05
+- cgi
+
+ fixed cgi.assign for empty handlers again
+
+20.02.2005 16:54 - 1.3.11
+- request handling
+
+ ignore \r\n before request-line in keep-alive requests (Bug #13)
+
+- cgi, fastcgi
+
+ added REMOTE_PORT and SERVER_ADDR
+
+ fixed check for broken status-code in nph-scripts (Bug #14)
+
+- fastcgi
+
+ fixed passing cmdline options the spawned binary (Bug #16)
+
+ fixed failed reconnects (Bug #9)
+
+- macos x
+
+ fixed build on max
+
+- mod_secdownload
+
+ parse conditional secure-download.secret (Bug #8)
+
+- mod_userdir
+
+ redirect if username is not followed by / (Bug #15)
+
+13.02.2005 17:33
+- mod_auth
+
+ fix crash if require, realm or method are empty (Bug #5)
+
+13.02.2005 14:52
+- network
+
+ handle EPIPE and ECONNRESET as 'client has closed connection' in writev()
+ (Bug #1)
+
+- macosx
+
+ compile error on MacOS X due to missing environ (patch by Johan Sörensen)
+ (Bug #2)
+
+- indexfiles
+
+ append the detected indexfile only once to uri.path (reported by Thomas
+ Seifert)
+ (Bug #3)
+
+06.02.2005 15:16 - 1.3.10
+- fastcgi
+
+ display a error-message if a hostname if specified in fastcgi.server->host
+ we need an IP here
+
+- debug
+
+ added debug.log-state-handling
+
+- spawn-fcgi
+
+ accept a full commandline for spawning
+
+06.02.2005 12:50
+- fastcgi
+
+ fixed openssl handling
+
+- network_freebsd_sendfilev
+
+ gracefull handling of connections closed on client-side
+ removed debug-message
+
+06.02.2005 01:44 - 1.3.9
+- documentation
+
+ added docs for SSL setup and mod_status
+
+- fastcgi
+
+ fixed config handling on PowerPC for local-spawning
+
+05.02.2005 15:14
+- fastcgi
+
+ added bin-environment to setup the environment of the spawned process
+
+ added bin-copy-environment to copy only the specified set of options
+ from the old environment
+
+ added handling of cmd-line options to bin-path
+
+- setenv
+
+ fixed crashed in setenv.add-response-header
+
+04.02.2005 18:09
+- configure
+
+ fixed docs for --with-mysql
+
+- fastcgi
+
+ improved performance of building the header (drop strlen())
+
+04.02.2005 01:59
+- cgi
+
+ don't send file on error
+
+ check if cgi-handler exists before executing it
+
+ added support for nph-...
+
+02.02.2005 21:18 - pre-release
+- request parsing
+
+ handle invalid characters in URI
+
+02.02.2005 15:12
+- makefiles
+
+ dropped unused header files from the distribution
+
+02.02.2005 14:18
+- fastcgi
+
+ delete sockets on shutdown
+
+- http/1.1
+
+ adding option to disable http/1.1
+
+01.02.2005 12:03
+- cygwin
+
+ fixed plugins_load to use the right extensions again
+ removed mmap check
+ added ssl support
+
+01.02.2005 01:49
+- configure
+
+ make check for valgrind.h covered by --with-valgrind
+
+- mod_localizer, mod_maps
+
+ remove both plugins from the distribution
+
+- file-not-found
+
+ handle file not found again
+
+30.01.2005 16:44
+- HEAD requests
+
+ don't send content on dynamic HEAD requests with status 200
+
+30.01.2005 15:16 - 1.3.8
+- network-handler
+
+ remove debug output on writev() if the remote side closed the connection
+
+- directory index
+
+ handle EACCES correctly
+
+29.01.2005 15:16 - pre-release
+- mod_alias
+
+ fixed mod_alias + pathinfo handling
+
+- mod_accesslog
+
+ added access-log to syslog patch from allan
+
+28.01.2005 17:30
+- directory redirect without Host-header
+
+ use server-ip instead of client-ip for the Location:
+
+- fastcgi + pathinfo
+
+ if fastcgi-auth redirects to a directory which doesn't exist handle it
+ correctly (bug introduced in 1.3.8)
+
+- requesting directories
+
+ clean physical.path if directory is requested and dir-listing is disabled
+ send 403 again (buf introduced in 1.3.8)
+
+28.01.2005 12:08
+- fastcgi
+
+ ignore FDEVENT_HUP for unix-sockets as a simple read + timeout will do
+ the job anyway
+
+22.01.2005 20:28 - pre-release
+- fastcgi
+
+ send content and headers if authorizer mode is used
+
+ use a new connection if connection is died to fastcgi
+ and we have not used it yet
+
+18.01.2005 21:21 - pre-release
+- plugins
+
+ added version-id to plugins to detect plugins which are not up-to-date
+
+16.01.2005 23:11
+- fastcgi
+
+ fixed write-failed after crash of fastcgi-child
+
+16.01.2005 20:43
+- setenv
+
+ fixed setenv.add-environment
+
+- fastcgi
+
+ fixed authorizer + added testcases
+
+16.01.2005 17:40 - pre-release
+- mod_status
+
+ beautified mod_status
+
+- mod_setenv
+
+ added setenv.add-environment
+
+- timeouts
+
+ add timeout to read-post
+
+15.01.2005 12:57
+- debug
+
+ added debug options to log
+ - missing files
+ - request header
+ - response header
+ - request handling
+
+ added a more usefull error message for the status-code changes in the
+ request parser
+
+- server announcement
+
+ set Server: header for dynamic content too
+
+- fastcgi
+
+ fixed double free
+
+ don't crash on FDEVENT_ERR
+
+ added a comment for EAGAIN on connect()
+
+08.01.2005 17:45
+- ssl
+
+ report an error if ssl.engine is enable but no ssl support compiled in
+
+08.01.2005 12:23
+- mod_status
+
+ added request time to the output
+
+ (late changelog) added host and filename to the output (fobax)
+ (late changelog) HTMLalized the output (fobax)
+
+06.01.2005 19:51 - pre-release
+- error-handler
+
+ let the error-handler handle 403 requests too
+
+ make the error-handler setable by a module
+
+- error-pages
+
+ reworked the error-page handling
+
+05.01.2005 13:10
+- keep-alive handling
+
+ made sure that keep-alive is really handled correctly
+
+04.01.2005 17:02
+- mod_setenv
+
+ added a module to added request and response headers on the fly
+
+- error-log
+
+ send error log to syslog() if no errorlogfile is specified (again)
+
+02.01.2005 22:44 - pre-release
+- response handling
+
+ cut of body for status 301, 304 and 205
+
+- buffer
+
+ optimized all _hex functions (Silvan Minghetti)
+
+02.01.2005 20:32
+- fastcgi
+
+ if bin-path is not specified, don't die (bug introduced in the last pre-rel)
+
+- auth
+
+ if userfile is empty don't auth.
+
+02.01.2005 19:06
+- mod_compress
+
+ fixed off by one if cache-dir is not set
+
+02.01.2005 16:10
+- conditional config
+
+ fixed !~ and !=
+
+- buffer
+
+ copy empty buffers correctly
+
+31.12.2004 17:45
+- ipv6 + pidfile
+
+ don't complain if we can't remove the pidfile (Silvan Minghetti)
+
+ remove ipv6 option from the commandline of lighttpd doesn't support
+ ipv6 (Silvan Minghetti)
+
+31.12.2004 15:41 - pre-release
+- kqueue
+
+ simplified event handling (adam)
+
+- fastcgi
+
+ fixed div-by-zero bugs in the adaptive process spawning
+
+- mysql-vhost
+
+ added mysql-vhost (Christer Holgersson)
+
+30.12.2004 19:09
+- fastcgi
+
+ added adaptive spawning of FastCGI processes
+
+- traffic shaping
+
+ added traffic shaping per virtual server
+
+28.12.2004 23:26
+- traffic shaping
+
+ added traffic shaping per connection
+
+25.12.2004 22:58
+- mod_status
+
+ fixed status.url again (Timo)
+
+21.12.2004 11:29
+- configure
+
+ added check for signal and select (compile fix for netbsd 1.4 and 1.5)
+
+11.12.2004 12:38 - 1.3.7
+- fastcgi + php
+
+ retry to connect to another PHP child if one of them dies after
+ connect
+
+- cgi + multipart
+
+ don't transform CONTENT_TYPE to HTTP_CONTENT_TYPE
+
+- debian
+
+ more cleanup, updated changelog, added more deps and suggests
+ (Chris Brown)
+
+10.12.2004 22:33
+- event handler
+
+ fixed crashes in kqueue
+
+10.12.2004 13:57 - pre-release
+- mod_status
+
+ fixed wraparound in total requests and total traffic
+
+- debian
+
+ updated licence and packaging
+
+- security
+
+ call setgroups() to get rid of all groups
+
+- ssl
+
+ handle SSL_shutdown() == 0 correctly
+
+ fixed openssl detection in configure
+
+ fixed handling of chunked encoding
+
+- request handling
+
+ handle Connection: keep-alive correctly (case as not ignored)
+
+21.11.2004 02:39
+- windows
+
+ merged basic native windows port (compiles with mingw)
+
+20.11.2004 18:43
+- conditional
+
+ ported
+ - cgi
+ - secdownload
+ - expire
+ - localizer
+ - usertrack
+ - status
+ - proxy
+
+- server-tag
+
+ Server: ... can now be specified by server.tag = "..."
+
+- spawn-fcgi
+
+ fixed typo in usage text
+
+- ssl
+
+ fixed detection of libs and headers
+
+05.11.2004 16:01
+- fastcgi
+
+ added more usefull error messages
+
+04.11.2004 23:01
+- ssi
+
+ added support for ${...}
+
+03.11.2004 14:51 - 1.3.6
+- fastcgi
+
+ added spawn-fcgi to the distribution
+ added spawn-local-fastcgi yourself ( bin-path )
+
+03.11.2004 11:22
+- accesslog
+
+ don't cycle accesslogs of external processes are used
+
+02.11.2004 15:34
+- fastcgi
+
+ handle END-OF-REQUEST correctly if chunk-encoding is not used
+
+02.11.2004 10:53
+- internal redirects
+
+ fixed handling of query strings in internal redirects for directories
+
+02.11.2004 09:54 - pre-release
+- cgi
+
+ add REMOTE_USER, suppress AUTHORIZATION
+ handle payloads > 4k
+
+- mod_alias
+
+ fixed url checking
+
+- follow-symlink
+
+ fixed config
+
+31.10.2004 11:30 - 1.3.5
+- writev
+
+ fixed seg-fault in debug-message if write() fails and LFS is enabled
+ handle EINTR
+
+- sendfile linux
+
+ handle EINTR
+
+31.10.2004 09:09
+- freebsd
+
+ added missing header in joblist.c
+ fixed test-scripts for zsh
+
+30.10.2004 22:26
+- modules
+
+ added mod_userdir and mod_alias
+ added docs for the new modules
+
+30.10.2004 19:52
+- porting
+
+ added defines for MAP_FAILED for NetBSD 1.3.x
+
+30.10.2004 18:54 - pre-release
+- pipelining
+
+ fixed offset calculations
+
+- ipv6
+
+ IPv6 might be disabled at compile-time
+
+- rewrite
+
+ close mem-leak
+
+- auth
+
+ forgot to reset the global-config handler
+
+- symlink
+
+ add option to disable follow-symlink
+
+- ssi
+
+ added support for exec-cmd
+
+23.10.2004 - 1.3.4
+- max-fds
+
+ set the upper limit of fds only if server.max-fds is set
+
+23.10.2004 13:49
+- accesslog
+
+ use a shell to handle accesslog-pipes
+
+22.10.2004 17:00
+- accesslog
+
+ added logging of user-supplied data via %{...}o and
+ X-LIGHTTPD-* header
+
+22.10.2004 14:57 - pre-release
+- openwrt
+
+ fixed configure-checks and Makefile.am's to build cleanly with a
+ cross-compiler
+
+ builds cleanly for openwrt
+
+22.10.2004 13:03
+- out-of-fd
+
+ improved the out-of-fd handler
+
+- cgi, fastcgi
+
+ set SERVER_NAME to server.name or the value submitted by Host:
+
+- error-handler
+
+ only set old status code if it wasn't set by a handler
+
+21.10.2004 22:36 - pre-release
+- fastcgi
+
+ don't crash on out-of-fd condition
+
+- out-of-fd
+
+ try handle the out-of-fd condition in a sane way
+
+21.10.2004 15:03
+- mod_auth
+
+ seperated auth.backend.*.userfile for plain, htpasswd and htdigest
+
+ added 'digest-auth' against 'plain-backend'
+
+ added auth.debug for debugging
+
+16.10.2004 10:18 - 1.3.3
+- mod_simple_vhost, mod_evhost
+
+ conditional-ized
+
+- mod_rrdtool
+
+ maintain the request-counter for each conditional-config (adam)
+
+14.10.2004 11:30
+- accesslogs
+
+ cycle all access-logs
+
+- mod_rewrite
+
+ tell the user to install pcre.h if he wants to use mod_rewrite
+
+10.10.2004 10:11 - pre-release
+- error-handler
+
+ added a error-handler for status 404 (server.error-handler-404)
+
+09.10.2004 16:28 - pre-release
+- cgi
+
+ added support for \n in headers
+
+- mod_auth
+
+ added conditional auth
+
+01.10.2004 09:28
+- plugins
+
+ fixed off by one error in plugin initialization (Mike)
+ related into a segfault on AMD64
+
+30.09.2004 21:44 - 1.3.2
+- file-cache
+
+ disabled the file-cache it was taken the wrong files from the cache
+
+30.09.2004 08:39 - 1.3.1
+- file-cache
+
+ drop a unused file-cache entry after 10 seconds
+ reuse unused entries
+
+- request-parser
+
+ accept IPv6 adresses in Host header
+
+- tests
+
+ modified the scripts to work with zsh (check on Linux, Irix and FreeBSD)
+
+26.09.2004 12:28
+- comparission function
+
+ file-cache has delivering the wrong entry if only the last character of
+ the filename differed and the filesize was the same.
+
+- cgi + cygwin
+
+ cgi need s SYSTEMROOT environment
+
+
+22.09.2004 08:55
+- network
+
+ detect of file has been shrinked while we are sending it out and terminate
+ the connection if would run over the edge
+
+22.09.2004 07:56
+- mod rewrite, fastcgi, ...
+
+ keep REQUEST_URI after rewrite
+
+21.09.2004 22:49
+- fastcgi authorizer
+
+ fixed cleanup code (matt)
+
+21.09.2004 20:08
+- rrdtool
+
+ rrdtool.db-name is now conditional
+
+ fixed check if write() failed (adam)
+
+17.09.2004 17:50 - 1.3.0
+- rewrite
+
+ added url.rewrite-final = ...
+
+17.09.2004 15:55
+- code cleanup
+
+ integrated the fixes from cygwin into the main tree
+
+- kqueue
+
+ init kqueue after daemonizing (broken since 12.09.2004 14:02)
+
+16.09.2004 21:00
+- cygwin + macosx
+
+ finished the cygwin port
+ this port seems to fix the problems on macosx too
+
+12.09.2004 14:02
+- socket handling
+
+ added support to handle more than one server socket
+
+11.09.2004 12:23 - 1.2.8
+- EINTR
+
+ handle EINTR for linux-sendfile
+
+- configfile
+
+ ignore an extra comma at the end of the array declaration
+
+11.09.2004 09:46
+- mod_proxy
+
+ pass remote-addr as X-Forwarded-For to the real server behind the proxy
+
+- code cleanup
+
+ moved all cut'n'paste versions of the inet_ntop cache to inet_ntop_cache.c
+
+- fcgi
+
+ don't overwrite the fd in fcgi_establish connection if connect fails. this
+ results in various problem in other places.
+
+05.09.2004 09:46
+- file-cache
+
+ cache the mimetype
+
+- last-modified
+
+ don't complain if the If-Modified-Since contains a valid comment/option
+ like <timestamp>; length = ...
+
+05.09.2004 09:13
+- expires
+
+ overwrite the Expire if it is set by a previous plugin
+
+- conditional config
+
+ conditional config as disabled in 1.2.7 by accident
+
+04.09.2004 10:02 - 1.2.7
+- mod-proxy
+
+ remove the \0 before the post content
+
+- cgi
+
+ fixed hanging process if cgi-crash terminates to fast (before we read its
+ response)
+
+- extented attributes
+
+ added xattr support, submitted by Ari
+
+29.08.2004 16:00
+- rrdtool
+
+ moved the rrdtool support from mod_status into its own module mod_rrdtool
+
+ rrdtool.binary = "/usr/bin/rrdtool"
+ rrdtool.db-name = "/var/www/lighttpd.rrd"
+
+29.08.2004 11:00 - pre-release
+- timeouts
+
+ server.max-keep-alive-requests = 0 replaces
+ server.use-keep-alive = "disable"
+
+ added
+ server.max-keep-alive-idle
+ server.max-read-idle
+ server.max-write-idle
+
+- docs
+
+ added a entry for each config-value into configuration.txt
+ added simple docs for
+ rewrite
+ redirect
+ compress
+ cgi
+ simple-vhost
+
+29.08.2004 10:05
+- config options
+
+ complain if no configfile is specified
+
+- fastcgi
+
+ removed stupid allocation bug which might cause a problem in really rare
+ cases
+
+26.08.2004 22:06 - 1.2.6
+- optimize
+
+ use array_strcasecmp() in favour of strcasecmp() as it is slightly
+ faster.
+
+ apply the case-insentive conversion also on the last character. (adam)
+
+ sort the checked elements in request.c and filter apply the logic to
+ compare some less fields, if the header is not used.
+
+ improved the config-patch function to use our internal buffer-compare
+ functions instead of strcmp
+
+22.08.2004 16:09 - pre-release
+- cgi
+
+ added missing cleanup code
+
+- fastcgi
+
+ remove double-free
+ added handling of EINTR in some places
+
+- leaks
+
+ fixed some leaks in the new config code
+
+- array_strcasecmp
+
+ fixed alignment in the improved array_strcasecmp function (adam)
+
+20.08.2004 14:46 - pre-release
+- performance
+
+ optimized a few useless strlen() away as we either know the length from
+ buffer->used - 1 or by sizeof(str) - 1 if it is constant.
+
+ optimized the 'find the \r\n\r\n' function.
+
+ improved the array_strcasecmp() based on another idea from (ralf)
+
+- accesslog
+
+ enabled the strftime cache again
+
+15.08.2004 23:41
+- accesslog
+
+ added apache-like CustomLog handling in accesslog.format
+
+ accesslog.format = "..."
+
+15.08.2004 21:08
+- test-cases
+
+ remove testdir
+
+- configfiles
+
+ handle escaping of " in strings properly
+
+13.08.2004 12:07
+- array
+
+ improved inner-loop of array_strcasecmp() (ralf)
+
+11.08.2004 14:14
+- fcgi socket
+
+ use SUN_LEN if available
+
+- keep-alive
+
+ disable keep-alive on request
+
+ server.use-keep-alive = "disable"
+
+10.08.2004 15:59 - 1.2.5
+- conditional config
+
+ mod_fastcgi
+ mod_rewrite
+ mod_redirect
+ mod_access
+ mod_compress
+ mod_accesslog
+
+ are ported
+
+10.08.2004 13:05
+- pipelining
+
+ fixed very stupid pipelining bug
+
+09.08.2004 22:07 - pre-release
+- conditional config
+
+ first code for conditional config
+
+09.08.2004 14:21
+- fcgi
+
+ fixed access to free()'d memory (doesn't create any harm)
+
+- isdigit, warings
+
+ signed -> unsigned for 2 more isdigit() calls (adam)
+ removed some unused var's if pcre is not available (adam)
+
+08.08.2004 20:57 - pre-release
+- debian
+
+ added a chmod to /var/log/lighttpd/ (allan)
+
+08.08.2004 12:05
+- kqueue
+
+ use EV_SET() instead of setting the ev-struct by hand (adam)
+
+- fcgi
+
+ fixed the EINPROGRESS handling to use getsockopt (er)
+ fixed a leak of server is disabled (er)
+
+- solaris 10 port-api
+
+ added a skeleton for the sol10 port api
+
+06.08.2004 10:18
+- mod_ssi
+
+ fix DATE_LOCAL so it displays the correct time zone (Jeremy Hinegardner)
+
+04.08.2004 11:43
+- openbsd fixes
+
+ dropped usage of MAX() in buffer.c
+ added prober includes for md5.h if openssl is enabled (brad)
+
+- memory usage
+
+ documented the way how lighttpd caches memory blocks
+ reset the buffers after they have been written by the network-layer
+
+- kqueue
+
+ modify fd-bitmask only if kevent succeeded (adam)
+
+
+03.08.2004 15:09
+- mod_compress
+
+ compress even if you have no cachedir set
+
+03.08.2004 13:26 - pre-release
+- Makefile
+
+ fixed dependencies for parallel build in mod_ssi_expr.c
+
+- combo patch
+
+ * Tinker with kqueue(). Add a reset method so that the kqueue file
+ descriptor can be re-enabled after a fork(). Emulate the devpoll driver
+ in that adds and deletes are sent to the notification mechanism im-
+ mediately, which should cut down on phantom events. Use
+ ev->kq_results as a sliding window.
+
+ * Change F_SETFD calls to use the preferred FD_CLOEXEC instead of 1.
+
+ * Remove unnecessary fdevent fcntl handlers. It appears that the only
+ driver that needs one is Linux RT signals.
+
+ * Quiet compiler warning about unused parameter.
+
+ * Set the close-on-exec flag for the /dev/poll and epoll_create() file
+ descriptors.
+
+ * Return failure if /dev/poll could not be opened instead of logging
+ and continuing.
+
+ * Detect EAGAIN after writev() failures. FreeBSD sendfile() doesn't need
+ protection, as the man page says:
+
+ When using a socket marked for non-blocking I/O, sendfile() may send
+ fewer bytes than requested. In this case, the number of bytes success-
+ fully written is returned in *sbytes (if specified), and the error
+ EAGAIN is returned.
+
+ (adam, georg, matt)
+
+
+02.08.2004 18:08
+- mod_ssi
+
+ check for pcre before compiling the module
+
+- fdevents
+
+ dropped fdevent_fcntl added by the last patch (adam)
+ kqueue: events == FDEVENT_IN -> events & FDEVENT_IN (adam)
+
+31.07.2004 22:07 - 1.2.4
+- fdevents
+
+ * Test at configure time for kqueue() and <sys/event.h>
+ * Remove various hard-coded constants from event handlers
+ * Move maxfds into the event structure, and out of the
+ fdevent_*_init handlers. Event handlers can use the maxfds
+ member to size arrays.
+ * Various event structure renames to discourage clashes
+ * Remove extra (ignored) call to fdevent_event_next_fdndx() in
+ the main server loop.
+ * Wrestle with kqueue(). The implementation has to deal with
+ phantom events (for fds which have been deleted/closed), similar
+ to the Linux RT signals code. Like the RT code, it maintains a
+ bitmask of active fds. After a successful call to kevent(), the
+ code will compress/overwrite dead events. The other annoyance is
+ that the handler must track the event filter for each fd, even
+ though you cannot support both read and write filters for the same
+ fd in one kqueue. The handler maintains a separate bitmask for fd
+ filters (1 == EVFILT_IN, 0 == EVFILT_OUT).
+ (adam)
+
+- server side includes
+
+ added native server-side includes based on the docs from apache:
+ http://httpd.apache.org/docs/mod/mod_include.html
+
+ not supported are:
+ - exec
+ - nested virtual
+ - config.errmsg
+ - echo.encoding
+
+24.07.2004
+- fdevents
+
+ added a bitset to figure out if we received a event for an unregistered fd
+ in rt-signal (adam)
+
+- kqueue
+
+ added kqueue support (Matt Levine)
+
+13.07.2004 08:58
+- configfile
+
+ parse keys correctly that contain a digit (Geoff Adams)
+
+- fcgi
+
+ fixed large post uploads (Geoff Adams)
+ fixed uri if docroot is set (Geoff Adams)
+
+03.07.2004 22:50 - 1.2.3
+- index-files
+
+ rewrite uri.path to the index-file instead of keeping it at .../
+ this fixes index-file handling in FastCGI/CGI docroot is used
+
+- close-on-exec
+
+ enable close-on-exec handling to simplify FD handling in CGI code
+
+- cgi
+
+ keep error-log-fd open to catch the error handling for execve()
+
+ report error if cgi-exec file doesn't exist
+
+- proxy
+
+ pass page-content on error to the user (E.R.)
+ code cleanup (E.R.)
+
+- ssi
+
+ first skeleton of a plugin for ServerSideIncludes
+
+- security
+
+ limit the headerlength again to 64k max
+
+03.07.2004 14:23
+- configure
+
+ fixed compile-check for libpcre if pcre-config doesn't point to /usr/lib
+
+02.07.2004 18:17
+- buffers
+
+ always allocate a multiply of 64bytes. this should reduce the number of
+ realloc()s and still doesn't has a too high overhead.
+
+02.07.2004 11:07
+- fds
+
+ connect stdin, stdout and stderr to /dev/null instead of just closing it
+ use dup2() instead of dup()
+
+- accesslog
+
+ if accesslog.filename starts with a | spawn a process which will get data
+ in one chunk once in a while
+
+01.07.2004 11:00
+- sample config
+
+ added text/css and text/javascript mimetypes
+
+28.06.2004 12:18
+- proxy module
+
+ added a proxy module (based on the fastcgi module) and added some
+ documentation
+
+25.06.2004 21:41
+- last-modified handling
+
+ replaced %Z by GMT. otherwise the last-modified check will most often fail.
+
+24.06.2004 20:20
+- relax http-parser
+
+ don't reply 400 in case of an empty header-field, just ignore it
+
+23.06.2004 22:10
+- file-cache
+
+ don't cache mmap() for files larger than 64k as we run out of RAM otherwise
+ too fast (check with some 200mb files)
+
+- 64bit fixes
+
+ fixed buffer_equal on sparc64
+
+15.06.2004 19:09 - 1.2.2
+- mmap cache
+
+ fixed mmap-caching in network_write.c and network_writev.c after a direct
+ hint by E.Rodichev
+
+- sendfile + linux
+
+ check at config-time if sendfile() works on Linux
+
+11.06.2004 15:09
+- fcgi + unix sockets
+
+ added support for unix domain sockets (spawn-fcgi 1.2.0 required)
+
+10.06.2004 11:49
+- configure
+
+ use pcre-config to determine the position of the pcre headers
+
+05.06.2004 22:06
+- filehandle-cache
+
+ remove mmap-segment if filecache gets invalidated
+
+30.05.2004 14:13 - lighttpd 1.2.1
+- response headers
+
+ request headers that appear twice are grouped together like expected by
+ the CGI spec (concat with a ", ")
+ response headers behaved the same way but are not grouped anymore. They
+ stay seperated. Actually they are concated by \r\n<key>: <value> which is
+ the same in the end.
+
+- file uploads
+
+ the handling of longer post requests is fixed now.
+
+28.05.2004 09:13
+- cgi
+
+ added support for direct calls to cgi-binary
+
+22.05.2004 21:58
+- pipeling
+
+ the code cleanup is finished successfully. Now all cases of pipelining are
+ handle the right way. POST pipelining was still not working up to now.
+
+22.05.2004 12:55
+- code cleanup
+
+ use the well-tested code from the write-queue as the base for the
+ read-queues and simplify the pipeline handling alot that way.
+
+20.05.2004 15:08
+- network backends
+
+ enabled sendfile support again (__FreeBSD__ instead of __freebsd__)
+
+ added a mmap cache as part of the filedescriptor cache
+
+ added AIX specific send_file() support (untested)
+
+20.05.2004 10:40
+- segfaults
+
+ fixed some minor segfaults on startup when no config file is used.
+
+17.05.2004 10:58 - lighttpd 1.2.0
+- documentation
+
+ reformated the documentation the doc/ directory
+
+15.05.2004 14:45
+- localizer
+
+ fixed build of localizer extension
+
+15.05.2004 12:35
+- POST requests
+
+ there is no need to die if we spot a simple POST request on a static file
+
+- pipelining
+
+ fixed HTTP/1.1 pipelining which caused the problems with opera
+
+- array handling
+
+ how did that bug survive such a long time ? a wrong compare function was
+ used in one case, but not the other.
+
+15.05.2004 03:20
+- secure and fast downloads
+
+ added a module which allows secure and fast downloading of files:
+ 1. the application (.php, ...) controls the access to the files
+ 2. the webserver is handling the transfer (and check the app generated
+ tokens)
+
+ the token is based on
+ - a secret
+ - a timestamp
+ - the filename
+ this means even if the token is is distributed by the user it will get
+ invalid after a given timeout (default 60 seconds)
+
+- errorfiles
+
+ check for errorfiles before using them
+
+- code cleanup
+
+ applied cleanup fixes from adam
+
+14.05.2004 18:47
+- fdevent handling
+
+ added a more generic callback interface to the fdevent structures which
+ simplifies the writing of plugins. this might destabilize lighttpd for a
+ while
+
+- cgi
+
+ fixed header parsing of the header is sent in chunks and the terminator is
+ sent in a single chunk
+
+- EINTR
+
+ fixed some occurences of EINTR which read()
+
+03.05.2004 23:55
+- portability
+
+ E.R.:
+ * portability fixes for Solaris 2.5
+
+02.05.2004 10:15
+- Expect: Handling
+
+ added incomplete support for Expect: 100-continue (RFC 2616 8.2.3) by
+ sending always 417 for every Expect-request (see 14.20)
+
+ we have been blamed for not supporting it:
+ http://lists.w3.org/Archives/Public/ietf-http-wg/2004JanMar/0059.html
+
+29.04.2004 23:07 - 1.1.9
+- usertracking
+
+ added a very basic usertracking cookie handler
+
+29.04.2004 19:37
+- network-writev
+
+ Adam:
+ * call munmap() on error in write()
+
+- docs
+
+ E.R:
+ * documented 'check-local'
+
+- test-env
+
+ made the shell scripts more portable (checked with zsh, bash and ksh)
+
+ fixed compilation on NetBSD
+
+28.04.2004 22:22
+- FastCGI
+
+ E.Rodichev:
+ * added "Authorizer" mode for FastCGI
+
+27.04.2004 18:08
+- ssl
+
+ Alexey Slynko:
+ * handle SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE in SSL_write the
+ right way.
+
+- FastCGI
+
+ add 'check-local' instead of the implicit 'if-docroot-is-set' handling
+ implemented at 24.04.2004 14:34
+
+ E.Rodichev:
+ * remove useless extra-/ in before uri.path
+ * add 'prefix' notation for FastCGI processes
+
+26.04.2004 16:52
+- code cleanup
+
+ patches from Alexey Slynko:
+ * remove the pidfile if lighttpd terminates the normal way (if not in chroot)
+ * init SSL before getting daemonized
+
+25.04.2004 19.15
+- mem-leak
+
+ fixed mem-leak on broken HTTP-headers
+
+- FastCGI
+
+ patches from E.Rodichev:
+
+ 1. CONTENT_LENGTH
+ "If no data are attached, then this metavariable is either NULL or not
+ defined".
+
+ 2. QUERY_STRING
+ If the Script-URI does not include a query component, the QUERY_STRING
+ metavariable MUST be defined as an empty string ("").
+
+ 3. Doubling of REMOTE_ADDR removed.
+
+ patches from adam:
+ * fixed bug in the sizeof() patches from yesterday.
+ * some more *_long to *_off_t
+
+24.04.2004 14:34
+- FastCGI
+
+ don't check for localfile if 'docroot' for a FastCGI host is specified.
+
+24.04.2004 12:13
+- POST
+
+ fixed POST request handling
+
+- chunk-encoding
+
+ the generated HEX strings where broken since the 1.1.8
+ (this effected all HTTP/1.1 requests without Content-Length like FastCGI-PHP)
+
+- code cleanup
+
+ patches from adam:
+ * malloc + memset -> calloc
+ * sizeof(int) -> sizeof(<variable>)
+ * assign fd_set instead of memcpy()
+ * init fd -> connection fd pointers to -1
+
+16.04.2004 08:48 - 1.1.8
+- code cleanup
+
+ don't reuse buffer > 64k (see settings.h)
+
+ added server.max-request-size to limit the maximum request-body size
+ (in kBytes)
+
+ don't accept HTTP-request headers larger then 32kBytes (see settings.h)
+
+ minor speed improvements in the request-parser
+
+ More cleanup patches from adam:
+
+ * change pre-ANSI C/valid C++ syntax for function declarations/definitions
+ from using () to (void). Ex: int foo(); --> int foo(void);
+ * use static linkage as much as possible, to limit possible symbol
+ collisions
+ * whack more unneeded variables
+ * try and prevent any errno clobbering by storing the old errno value before
+ any subsequent system calls, and restoring before function exit.
+ * change printf syntax for unsigned variables from %d to %u
+
+15.04.2004 18:41
+- code cleanup
+
+ handle all int != size_t cases in fcgi.c correctly
+
+ check headerfields to have a value
+
+ handle both EINVAL cases of writev() before the can occur
+
+ limit content-length to SSIZE_MAX
+ disallow negative content-length
+
+ the usage of ltostr() has been reduced to the minimum in favour of
+ buffer_/append|copy)_(long|off_t)
+
+ dropped ultostr() and ultohex() in favour of buffer_*
+
+15.04.2004 16:35
+- portablity
+
+ more patches from adam:
+
+ * remove warnings for unused parameters and variables
+ * remove warnings for mismatched pointer assignments
+ * change "gtime_r" to "gmtime_r"
+
+13.04.2004 20:48
+- test-cases
+
+ made the 'make check' target self-contained
+
+ In our case we have to call the targets in the following order:
+
+ $ ./configure ...
+ $ make
+ $ make install
+ $ make check
+
+ because the path to the plugins is hardcoded in the binary itself
+
+ using
+
+ $ ./configure --prefix=/tmp/lighttpd-1.1.x/
+ ...
+
+ will help if you don't really want to install before testing.
+
+13.04.2004 00:05
+- portability
+
+ adam sent another patchset:
+
+ * Wrap PCRE-specific data member access with an #ifdef
+ * Add const to pointer using return value from dlerror()
+ * Explicitly initialize pointer in the lemon parser to 0,
+ in order to catch missing else { } clause
+ * Use a time_t rather than an int for gmtime() call. On some
+ systems (including 32- and 64-bit SPARC) time_t is a long.
+
+12.04.2004 17:00 - 1.1.7
+- fastcgi
+
+ strip WS after HTTP-response headers coming from the FastCGI process
+
+ added REMOTE_USER to the Server->FastCGI headers
+ removed HTTP_AUTHORIZATION from the Server->FastCGI headers
+
+12.04.2004 10:24
+- cgi
+
+ if we don't get a partial HTTP-response-header send the content out as soon
+ as the cgi script is finished
+
+12.04.2004 01:23
+- compression
+
+ added bzip2 compression (supported by w3m)
+
+12.04.2004 00:12
+- configfile
+
+ add some usefull error messages if the tokenizer or the parser fail to
+ read the configfile
+
+11.04.2004 22:04
+- configure
+
+ added --with-ldap and --disable-lfs to the configure options
+
+11.04.2004 20:28
+- 64bit offset size
+
+ disable linux-sendfile support for linux 2.4.x for now as it don't
+ support 64bit transfers
+
+ fixed all assignments on the path from the stat() to the Content-Length
+ HTTP-header
+
+- head requests
+ set content-length in HEAD requests
+
+- accesslog
+
+ write accesslog entry on network error
+
+ write the correct amount of byte written to the accesslog
+
+11.04.2004 11:48
+- code cleanup
+
+ moved the config for the cgi-plugin from config.c to the plugin.
+
+ moved some buffers which were only used by a one or two plugin from
+ the server-structure to the plugins
+
+ keeping the plugins independent from the server-core is a 'good thing'
+
+10.04.2004 19:06
+- configfile parser
+
+ removed the leaks from the configfile parser
+
+09.04.2004 23:15 - 1.1.6
+- stricter http-parser
+
+ added line-folding although noone really seems to use it.
+
+09.04.2004 18:42
+- configfile parser
+
+ the hand-written configfile parser has been replaced by a LALR(1) one.
+ 'lemon' from the sqlite guys has been used to generate the parser.
+
+- by-host, by-url, by-file, by ...
+
+ $HTTP["url"] =~ "~$" {
+ access.deny = "all"
+ }
+
+ $HTTP["host"] =~ "." {
+ simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
+ simple-vhost.default-host = "grisu.home.kneschke.de"
+ simple-vhost.document-root = "pages"
+ }
+
+ $HTTP["host"] == "incremental.home.kneschke.de" {
+ server.docroot = "/hasdasd"
+ }
+
+ at least the parser can handle it now. Currently there is no real support
+ for this context-based config-option. But the syntax and the parser are
+ done.
+
+09.04.2004 10:58
+- ssl support
+
+ enable ssl support again
+
+- mmap
+
+ enabled mmap+write again
+
+08.04.2004 12:34
+- stricter http-parser
+
+ based on a thread at
+
+ http://lists.w3.org/Archives/Public/ietf-http-wg/2004JanMar/0050.html
+
+ the HTTP-parser has been adjusted to be more correct when it comes to
+ request-header fieldnames
+
+ the whitespace handling around the ':' has been relaxed as requested
+
+07.04.2004 17:06
+- sigaction
+
+ use sigaction instead of signal if possible
+
+07.04.2004 13:55
+- accesslog
+
+ use localtime-timestamps in accesslogs if struct tm has a tm_gmtoff field
+
+07.04.2004 10:41 - 1.1.5
+- -D_REENTRANT
+
+ solaris + localtime_r() needs it
+
+07.04.2004 02:54
+- mod_auth + ldap
+
+ added a ldap backend to the auth plugin.
+
+06.04.2004 13:37
+- pidfile
+
+ fixed the permissions of the pidfile (Matthijs van der Klip)
+
+- specfile
+
+ merge the RedHat and SuSE specfile with Matthijs
+
+- 64bit file-offsets
+
+ moved the FILE_OFFSET_BITS settings from the config.h the Makefile to enable
+ 64bit offsets the right way
+
+06.04.2004 12:32
+- mod_expire
+
+ added an apache compatible mod_expire which adds Expires: headers to the
+ request
+
+ expire.url = ( "/buggy/" => "access 2 hours" )
+
+05.04.2004 22:34
+- solaris devpoll
+
+ forgot to provide the infrastructure to actually enable the devpoll event
+ handler. the same has been done for the freebsd-kqueue handler (which
+ doesn't work yet)
+
+ fixed the devpoll support while testing it on a real solaris box
+
+05.04.2004 09:49
+- debian
+
+ added debian packaging support written by Vincent Wagelaar
+
+- solaris
+
+ Another set of patches for Solaris from Adam
+ * Detect <sys/devpoll.h>
+ * Detect and include <sys/filio.h> for definition of FIONREAD
+ * Detect and link against the library exporting hstrerror
+ * Correct typo in SENDFILE_LIB
+ * Use__sun instead of __solaris__ for detecting operating system.
+ Please see http://predef.sourceforge.net/preos.html for more
+ detail
+ * Explicitly cast arguments to isalpha() and toupper() to unsigned
+ char. The man page says that the functions support the range of
+ an unsigned char, and EOF.
+ * Include <limits.h> and define UIO_MAXIOV as IOV_MAX for Solaris.
+
+04.04.2004 18:05 - 1.1.4
+- pidfile
+
+ added pidfile writing after deamonizing
+
+04.04.2004 01:05
+- fdevent
+
+ added framework for freebsd_kqueue and solaris_devpoll
+
+ the solaris_devpoll one might event work (untested)
+
+03.04.2004 16:41
+- network
+
+ added framework for filebased chunks
+ - read-write + mmap-write
+ - linux-sendfile
+ - freebsd-sendfile
+ - solaris-sendfilev (untested)
+
+ and memorybased chunks
+ - write
+ - writev
+
+ made TCP_CORK a 'global' flag around the write_chunkqueue-calls
+
+ the writev() support should improve the performance for all non-static
+ pages.
+
+ 170 req/s against 158 req/s for the following script if writev() is used
+ instead of write()
+
+ <?php
+
+ for ($i = 0; $i < 1000; $i++) {
+ print $i."<br />\n";
+ flush();
+ }
+
+ ?>
+
+28.03.2004 13:42
+- cleanup
+
+ applied some cleanup patches submitted by Adam:
+ * variables modified in signal handlers should be sig_atomic_t
+ * assert statements should not have side effects
+ * STD{IN,OUT,ERR}_FILENO preferred instead of {0,1,2}
+ * dieing --> dying
+ * SEGFAULT calls abort directly, instead of derefencing a NULL pointer
+
+- mod_accesslog
+
+ modified the accesslog format to be CLF compatible
+ set locale for LC_TIME to C
+
+26.03.2004 16:13
+- path info
+
+ enabled the pathinfo code again
+
+
+25.03.2004 13:30 - 1.1.3
+- portability
+
+ compiles fine now without any patches on IRIX
+
+- hostname detection
+
+ reworked "get the hostname for HTTP/1.0 requests which don't specify a
+ Host: ..." to only query the name in this single case for the server side
+ of the connection
+
+- errorlog handling
+
+ stderr is only used until the errorlog is init'ed
+ if no error-log is specified, syslog() is used
+ if cycling error-log fails, syslog() is used
+
+- accesslog cycling
+
+ don't fall back to stdout anymore
+
+- event-handler
+
+ use poll() as the default event-handler again
+
+24.03.2004 01:37 - 1.1.2a
+- error messages
+
+ added some hints to the failing error-messages
+
+22.03.2004 01:58 - 1.1.2
+- configure
+
+ some protability changes to get the 'inline' working with the MIPS CC
+
+21.03.2004 22:00
+- mod_rewrite, mod_redirect
+
+ reading the config for those two plugins was not working
+
+- fdevents
+
+ changed the compile time setting for the event handling into a run-time
+ setting.
+
+ server.event-handler = "select" # poll, linux-rtsig, linux-sysepoll
+
+ added sys_epoll() for linux 2.6
+
+ select - all systems
+ poll - Linux 2.1.23+, all XPG4-UNIX
+ sigio - linux 2.4.0+
+ sysepoll - linux 2.5.66+
+
+ 1000-4k-nok 1000-100k-nok
+ select 1776.99 296.52
+ poll 678.02 607.28
+ sigio 3754.46 1411.23
+ sysepoll 3817.67 1431.02
+
+21.03.2004 00:10
+- configure script
+
+ rewrote large parts of the lib/header detection of the configure script
+
+20.03.2004 01:39
+- fastcgi
+
+ as the docroot on external hosts might be different than the webserver
+ docroot it can now be specified in the config:
+
+ fastcgi.server = ( ".php" =>
+ ( "grisu" =>
+ (
+ "host" => "192.168.2.41",
+ "docroot" => "/home/jan/servers/",
+ "port" => 1026
+ )
+ )
+ )
+
+ a huge internal cleanup in the config handling made the code more readable.
+ some more warnings and error checking should track most of the config
+ errors for the fastcgi plugin
+
+19.03.2004 12:34
+- external patches
+
+ Matthijs van der Klip submitted three nice patches:
+ - turn off writing in mod_status if status.rrd-reports is set to disable
+ - fix for a debug message
+ - get the hostname for HTTP/1.0 requests which don't specify a Host: ...
+ - rc-script for RedHat
+
+- documentation
+
+ added a documentation section about authentification
+ - doc/authentification.txt
+
+19.03.2004 05:11
+- optimizations
+
+ implemented special versions of
+ - strcasecmp (array_strcasecmp)
+ - isdigit, isalpha, isalnum (light_*)
+
+ added a faster check for a finished header
+
+ after disabling all modules it is still possible to get 20 kreq/s.
+
+15.03.2004 19:45 - 1.1.1
+- localizer server
+
+ added the localizer-server module to the code
+
+- chunked-encoding
+
+ Apple's Safari or HTTP-Handler doesn't handle chunked-extensions defined by
+ RFC 2616 correctly and doesn't ignore them. Disabled the chunked-extension
+ which were just used for debugging purposes.
+
+07.03.2004 12:20
+- optimization
+
+ moved the checks if a plugins support a given function from the dispatcher
+ (plugins_call) to plugins_call_init() to do the check only once.
+
+ equalized the plugins functions to only two types:
+ SERVER_FUNC()
+ CONNECTION_FUNC()
+
+ replaced all handwritten plugin_call-handlers with macros
+
+ made all plugin-functions 'static'
+
+ with all plugins loaded we are at 15kreq/s gain
+ without any plugin loaded at 16kreq/s
+
+ before the change we were at 13kreq/s
+
+06.03.2004 21:13
+- compilation fixes
+
+ fixed some warnings on FreeBSD and NetBSD by adding
+ #include <netinet/in.h>
+
+ ifdef'ed a pcre-entry in base.h
+
+ remove #define _XOPEN_SOURCE from http_auth.c for IRIX
+ crypt() on Linux needs _XOPEN_SOURCE
+
+06.03.2004 19:18 - 1.1.0
+- authentification
+
+ added htpasswd and htdigest backends to work against user-files generated
+ by htpasswd and htdigest.
+
+ for basic auth:
+ - plain
+ - htpasswd (crypt only)
+ - htdigest
+
+ for digest auth:
+ - plain
+ - htdigest
+
+06.03.2004 17:35
+- authentification
+
+ check the method in the authorization header againt the configured method
+
+06.03.2004 14:54
+- hostname parsing
+
+ added a RFC-2396 conforming "Host:" parser
+ added 17 checks for the parser
+
+06.03.2004 10:25
+- configuration
+
+ added a warning for unknown configuration variables.
+
+ dropped the 'specific-for.url' ideas for now as it is not known yet how to
+ implement it the right way
+
+ renamed some config-variables to reflect there actual meaning
+ - server.host -> server.bind
+ - server.virtual-* -> simple-vhost.*
+ - server.userid -> server.username
+ - server.groupid -> server.groupname
+ - server.docroot -> server.document-root
+
+
+05.03.2004 15:36
+- fastcgi
+
+ internals: moved all mod_fastcgi settings from the global struct to the
+ plugin itself
+
+- vhosting
+
+ got a patch for enhanced virtualhosting from christian kruse -> mod_evhost
+
+ moved the virtual hosting config (server.virtual-*) to it's own module
+ called mod_simple_vhost
+
+23.02.2004 10:06
+- configfile
+
+ rearragned the config-file structure again to be able to add settings for
+ a given URL, Host, Filename, ...
+ This change affects some config-options directly (access.deny,
+ url.rewrite, url.redirect, virtual-hosting, ...)
+
+ added 'specific-for.url' for url specific config settings
+
+- digest auth
+
+ FIX: md5-sess type
+
+ seperate the auth-backend stuff
+
+13.02.2004 22:23 - lighttpd 1.0.3
+- content-length + POST
+
+ FIX: If header and content didn't fit into one single packet the rest of
+ the content was not read correctly
+
+13.02.2004 01:07
+- content-length + POST
+
+ the check for content-length on a POST request vanished somehow in one of
+ the previous releases.
+
+- header search
+
+ FIX: the search for header fields was up to now case-sensitive. Now it is
+ like required by the standard case-in-sensitive.
+
+- browser bugs
+
+ w3m 0.2.5 adds an additional \r\n at the end of the POST requests which is
+ handled now
+
+10.02.2004 10:12
+- start script
+
+ took the suse rc-skeleton which states to be LSB compliant and modified it
+ for lighttpd needs
+
+09.02.2004 11:48
+- HEAD requests
+
+ FIX: HEAD requests for static files delived the content from the GET
+ request. (test case is added)
+
+08.02.2004 15:53
+- directory listings
+
+ FIX: the pathname has not encoded at all before it was transfered to the
+ browser. a proper url and html-encoding has been added.
+
+ added modification-time and filesize to the output
+
+ added a basic css for the virtual listings
+
+07.02.2004 22:15 - lighttpd 1.0.2
+- sample configfile
+
+ rearranged the config-file to have all the important options at the top
+
+- docs
+
+ added a mod-rewrite options
+
+- mod_accesslog
+
+ stdout is no longer used a default for the accesslog
+
+- error-messages
+
+ the 404 is now reported in the error-log
+
+07.02.2004 17:30
+- configfile handling
+
+ if a key is used twice like
+
+ url.rewrite = ( "url1" => "url")
+ url.rewrite = ( "url2" => "url")
+
+ you get an error now. You have to write:
+
+ url.rewrite = ( "url1" => "url",
+ "url2" => "url")
+
+31.01.2004 12:22 - lighttpd 1.0.1
+- log cycling
+
+ added a sighup-handler to the plugin interface and fixed the log-cycling
+ for access-logs
+
+- portability
+
+ disabled the interval-time optimization on IRIX
+
+- documentation
+
+ added a lot of new documentation to README
+
+31.01.2004 10:59
+- status module
+
+ added two new options rrd-dir and rrd-reports:
+
+ rrd-reports = (boolean) # enables RRD-reports
+ rrd-dir = (string) # path for the daily status-files
+
+ fixed the "status-files in /"-bug this way
+
+
+22.01.2004 13:38 - lighttpd 1.0.0
+- simple docroot
+
+ fixed handling of docroots if virtual-host is disabled
+
+27.12.2003 11:12
+- license handling
+
+ added the first interface to license handling.
+
+25.12.2003 23:48
+- protability
+
+ Verified again that the code compiles and runs cleanly on Linux, FreeBSD,
+ NetBSD and IRIX
+
+ compiling with gcc and the option -pedantic works fine
+ compiling with mipspro cc works fine, too
+
+- tests
+
+ added some more tests: 39 tests
+
+25.12.2003 16:01
+- protability
+
+ some compile fixes for FreeBSD have been applied and a new switch has been
+ added to choose between IPv4 and IPv6 on FreeBSD.
+ (cmdline: -6, configfile: server.use-ipv6)
+
+- packaging
+
+ cleaned up the specfile for building RPMs
+
+21.12.2003 01:00
+- authorization
+
+ brought basic and digest auth back to life. this module as the last one
+ which had to be updated after the config-file changes
+
+- test harness framework
+
+ add 3 tests for basic auth
+
+20.12.2003 22:10
+- compression
+
+ added gzip compression (gzip-header + deflate + crc)
+
+- test harness framework
+
+ added a 22 tests to verify the correct behaviour of lighttpd
+
+- request parsing
+
+ GET http://www.yahoo.com/ HTTP/1.0
+
+ is handled now as
+
+ GET / HTTP/1.0
+
+- plugins
+
+ moved FastCGI and CGI handling into modules which can be loaded at run-time
+
+17.12.2003 13:18
+- compression
+
+ the directory structure is now build automaticly
+
+15.12.2003 01:00
+- compression
+
+ added a compression cache to the compression module (mod_compress)
+
+ Vary: Accept-Encoding is set now as it influences to delivered stream of
+ bytes. This is important for caches.
+
+10.12.2003 00:24
+- config files
+
+ a new config-file format is ready for the final release of lighttpd.
+
+ it supports:
+
+ server.docroot = "string"
+ server.host = integer
+ server.modules = ( "string", "string" )
+ server.mimetypes = ( "key" => "value" )
+ server.complex = ( "key" => ( "string", integer ),
+ "string",
+ integer )
+
+ the syntax should look familar to all who worked with Perl or PHP.
+
+ config-file handling has been seperated into a parser and a lexer. Both
+ are currently written by hand and will propably be rewritten into bison +
+ flex if time permits. But that would be a cosmetical change.
+
+05.12.2003 03:07
+- status-page
+
+ improved the status page to display
+ - the current connection-stati
+ - average throughput over 5 seconds
+ (requests/s and output-bound traffic)
+
+ now you can see what is going on in the server
+
+- access-log
+
+ the accesslog is now a module and can be disabled by just removing the
+ plugin from the list of loaded plugins
+
+04.12.2003 16:18
+- chroot-ing
+
+ how-to: using chroot
+
+ - chroot to /home/www/
+ - docroot at /servers/<hostname>/pages/
+ - defaulthost www.example.org
+
+ e.g. (external view)
+ /home/www/servers/www.example.org/pages/index.html
+
+ (in chroot)
+ /servers/www.example.org/pages/index.html
+
+ config:
+
+ chroot /home/www/
+ userid wwwrun
+ groupid nogroup
+
+ virtual-server-root /servers/
+ virtual-server-default-host www.example.org
+ virtual-server-docroot /pages/
+
+ The FastCGI process is living outside this chroot definition as it is
+ started seperatly.
+
+01.12.2003 02:06
+- cleanup
+
+ in preparation for the first stable release some internals had to be
+ cleaned up. Basicly it was a cleanup of workflow of the creation of the
+ response-header. All modules can use a clean interface for this purpose
+ now. This is espacially usefull for all modules which have to pass some
+ HTTP-headers to the client.
+
+29.11.2003 22:22
+- modules
+
+ finally moved the modules to shared libraries and cleaned up some code
+ path to become more readable.
+
+ So far we have:
+
+ mod_rewrite
+ mod_redirect
+ mod_access
+ mod_auth
+ mod_cache
+ mod_chat
+ mod_status
+ mod_maps
+
+28.11.2003 18:16
+- redirects
+
+ as lighttpd supports url-rewriting redirection was a few lines of new code.
+
+ redirect ^/wishlist/(.+) http://jan.kneschke.de/wishlist/$1
+
+ rewrite ^/wishlist/(.+) /new/wishlist/$1
+
+28.11.2003 17:00
+- signal stuff
+
+ setitimer is used to send a event every second to call time() only once a
+ second. another system call which has been remove from the main-loop.
+
+ sending HUP to lighttpd will close and re-open the logfiles. this is used
+ for cycling logfiles.
+
+#! /bin/sh
+
+###
+#
+# a simple logfile rotator for lighttpd
+#
+
+DATE=`date +"%Y%m%d-%H%M"`
+LPID=`pidof lighttpd`
+mv access.log access.log.${DATE}
+kill -HUP ${LPID}
+gzip access.log.${DATE}
+
+27.11.2003 01:07
+- native win32 port
+
+ a first attempt for a native win32 has been done. For now mingw is the
+ base for the development as it provides a basic unix-like framework for
+ building native win32 applications.
+
+ the most internal files have been ported and the over all progress is
+ going well. At the end this will just be a prove of concept.
+
+26.11.2003 01:17
+- access denied
+
+ added a access-deny filter to block specific urls like
+
+ access-deny ~
+ access-deny .inc
+
+17.11.2003 01:06
+- bug fixing
+
+ a fstat() on a opened fd which has changed reports wrong the file-info.
+ Using stat() again helps to solve this problem.
+
+ the sig-io version doesn't suffer from this problem.
+
+ the etags are now used for verifing file-cache-entries.
+
+- chat
+
+ enabled the internal login mechanism again
+
+ added support transfering session-infos over MySQL.
+
+15.11.2003 00:19
+- optimizing
+
+ added a buffer_equal_reverse function which is optimized version of strcmp
+ which is going backwards as pathnames are often the same for in the first
+ bytes.
+
+ wrote a one-pass parser for the request-header. The combination of
+ strstr(..., "\r\n") to seperate lines and strchr(..., ':') to seperate
+ keys from values more or less touched every byte twice.
+
+ we are still at 18.000 req/s for 4kb keep-alive requests even with etags
+ and handling all header fields.
+
+14.11.2003 17:26
+- fcgi
+
+ Content-Type wasn't passed correctly to the FastCGI app. HTTP_CONTENT_TYPE
+ was sent instead.
+
+- cache
+
+ provided access to the Session-ID
+
+- error-log
+
+ the timestamp is now written in a human readable form
+
+22.10.2003 00:06
+- fcgi, cgi
+
+ added a special set of array-functions which are optimised for the "insert
+ only once" case.
+
+ this provides access to the headers which are now forwarded to the external
+ interfaces. Before this change only a limited set of request-headers were
+ forwarded.
+
+21.10.2003 11:58
+- modules
+
+ added a new module-hook after the basic-init of the module for handling
+ config-settings and prepare the overall operartion (like building
+ db-connections, compiling regexes, ...)
+
+- cache
+
+ use turckmm-cache 2.4.3 to get some numbers for the php-latency:
+
+ /usr/sbin/ab -n 10000 -c 10 http://alba.home.kneschke.de:1025/index.php
+
+ handling the cache-decision and the cache-hit in php:
+
+ cache-miss: 100% (-&gt; $version = 0)
+
+ plain : 108.13 req/s
+ turckmm-cache: 218.39 req/s
+
+ cache-hit: 100% (-&gt; $version = 1)
+
+ plain : 164.45 req/s
+ turckmm-cache: 653.98 req/s
+
+ handling the cache-decision and the cache-hit in the server:
+
+ cache-hit: 100%, but using index.cml
+
+ cml: 4918.84 req/s (no keep-alive)
+ cml: 6901.31 req/s (keep-alive)
+
+ cache-miss: 100%, but using index.cml
+
+ plain : 108.39 req/s
+ turckmm-cache: 217.84 req/s
+
+ Conclusion:
+ - there is no loss in the cache-miss case through the cml-handling
+ - the cache-hit case can be improved dramaticly with lighttpd-cache
+ - turckmm-cache improves the cache-miss case alot
+
+20.10.2003 00:40
+- cache
+
+ the first 'real-life' test showed dramatic improvements in the req/s
+ handling.
+
+ The basic idea was to move the decision if a php-page can be taken from
+ the cache from the php-code to the webserver.
+
+ See here why this is a good thing:
+
+ the quite common code which works for http://jan.kneschke.de/ is using
+ templates and is quite static, but depends on 4 external files (the
+ menu-structure, the template, the current content, the class-file).
+
+ the index-file is always:
+
+ include_once "jk.inc";
+
+ $v = new view();
+ print $v->get(array(array ("file" => "content.html")));
+
+ It is more or less the same for all pages.
+
+ This basic setup can deliver 100 requests/s.
+
+ The next step has:
+ - application bases caching
+
+ as we know that each pages depends on those 4 files, you can check if they
+ have been modified since the last request and deliver the content from the
+ cache otherwise.
+
+ this increased the throughput to 150 req/s. (cache-hit ratio 100%)
+
+ The next logic step is to move the decision-making process out of the PHP
+ code as PHP is to slow for the cache-hit path:
+
+ a CML (Cache-Markup-Language) has been written which describes the whole
+ decision process which has been written in PHP-code before:
+
+
+output.content-type text/html
+
+output.include _cache.html
+
+trigger.handler index.php
+
+trigger.if file.mtime("../lib/php/menu.csv") > file.mtime("_cache.html")
+trigger.if file.mtime("templates/jk.tmpl") > file.mtime("_cache.html")
+trigger.if file.mtime("content.html") > file.mtime("_cache.html")
+
+ if one of the 'trigger.if' statements is true the 'trigger.handler' is
+ called to generate the pages.
+
+ if none of the them is trigger the files from 'output.include' are sent to
+ the browser with content-type specified in the first line:
+
+ The result was very 'promissing':
+
+ 5900 req/s with keep-alive
+ 3800 req/s without keep-alive
+
+ (both for a cache-hit ratio of 100%)
+
+ for keep-alive this is factor <b>59</b> against the plain un-cached
+ version and still <b>39</b> againt the php-cache-version which is doing
+ exactly the same.
+
+ Time for party. :)
+
+19.10.2003 - 18:55
+- cache
+
+ the handling of functions has been improved. they are now 'plugable'. just
+ the dlopen() stuff is missing.
+
+ a new datatype has been added: the string
+
+ this makes it possible to evaluate something like:
+
+trigger.if unix.time.now() - file.mtime("head.html") > 30
+trigger.if mysql.query("SELECT count(*) " + \
+ " FROM structure AS struc, session AS sess " + \
+ " WHERE struct.user = sess.user" + \
+ " AND sess.id = \"" + mysql.escape("ab\"c") + "\"")
+
+ you see:
+ - string operations (concat)
+ - handing of escape-sequences
+ - functions
+ - comparisions
+
+18.10.2003 - 13:39
+- cvs
+
+ imported everything into the cvs server which makes the whole revision
+ handler a lot easier. The CVS server was up all the time but not used.
+ Importing required 5 minutes of work which included merge the freebsd and
+ the linux tree.
+
+- compilers + platforms
+
+ on a regular various compilers and platform are check to compile with with
+ the current code base:
+
+ platform | os | compiler | state
+ ---------+---------------------+--------------+---------
+ ia32 | Linux 2.4.22 | gcc 2.95.3 | ok
+ ia32 | FreeBSD 5.1-CURRENT | gcc 3.3.1 | ok
+ mips64 | IRIX 6.5 | gcc 3.2.2 | ok
+ misp64 | IRIX 6.5 | MIPSpro 7.41 | ok
+
+ the mipspro compiler revealed some warning which resulted in a nice
+ code-cleanup that made the code more readable.
+
+18.10.2003 - 03:00
+- e-tags and friends
+
+ in preparation for the php-conference at the begin of november in
+ frankfurt/main the server has the support some more caching/proxy tags
+ like:
+ - E-Tag (14.19) [done]
+ - If-Match (14.24)
+ - If-None-Match (14.26) [done]
+ - If-Range (14.27)
+
+ Section (13.3.3) binds them together. [RFC 2616]
+
+ using lxr.kde.org and lxr.mozilla.org revealed that
+ - konqui only uses if-none-match
+ - mozilla uses if-none-match and if-range
+
+ it looks like it isn't that easy to trigger the if-range case.
+
+ As ulf suggested the etag is a hash of file-size, inode-number and mtime.
+
+- fd-caching
+
+ ulf just phoned me ask proposed the free the cache more agressivly in case
+ of fd-shortage. increasing the the fd-limit is the better idea. :)
+
+17.10.2003 12:45
+- chat
+
+ finished the mysql-support for storing the sessions
+
+12.10.2003 20:56
+- valgrind
+
+ used valgrind again to verify that the code a free of mem-leaks and found
+ a 'leak generator' in the chunk-api.
+
+ the last few leaks were just some missing free()'s at the end of the
+ program run which would have been freed anyway.
+
+ at the end valgrind couldn't find any missing free()'s.
+
+11.10.2003 12:09
+- FastCGI
+
+ reduced the number of system calls for FastCGI to WebServer to 2 calls per
+ fd-event. (ioctl() + read())
+
+ this has no direct effect of the performance of the server, but improves
+ the possible througput of the load-balancer.
+
+10.10.2003 21:09
+- FastCGI - load-balancing
+
+ a brown paper bug has been fixed which caused to decreasing throughput if
+ load-balancing was enabled.
+
+
+ benchmarking the req/s with load-balancing shows really nice results:
+
+
+ server : req/s comment
+ ---------+--------------------------------------------------
+ ulf : 764.06 (php)
+ lappi : 800.06 (php)
+
+ ulf+lappi: 1526.95 (2 * php)
+
+ grisu : 1265.66 (php + ab + lighttpd)
+
+
+ all : 1647.72 (3 * php + ab + lighttpd)
+ all(nice): 1904.40 (same as all, but the local php on grisu
+ has been 'nice -20'd)
+
+
+ if a php is run on the load-balancer it has to get a lower priority than
+ the load-balancer itself as to handle the work of (here) 3 php-servers.
+
+
+10.10.2003 15:11
+- java ?
+
+ http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/common/AJPv13.html
+
+08.10.2003 21:08
+- gigE
+
+ Last week 3 RTL8169S gigE cards arrived and were installed in the
+ test-framework.
+
+ They are very cheap (20 Euros) and are a good start for a low-level
+ benchmark network.
+
+ First result show us:
+
+ 48 Mb/s with ab.
+
+ The webserver and the test-server are equipped with a 2000+ AMD CPU. The
+ system load 95%, user load is 3%, the rest is idle on both plattforms.
+
+ After some calculations at gets clear that there are various bottlenecks:
+
+ 1. The PCI-Bus (32bit/33Mhz) can only transfer 133Mb/s
+ - 48 Mb/s TCP-Traffic results in 55Mb/s Ethernet-Traffic (verified with
+ slurm) [outgoing]
+ - there is about 10Mb/s incomming traffic at the PCI bus which the
+ requests
+ - the rest of the devices at the PCI bus are eating the last few mb/s
+ 2. IRQ-Handling
+ - There are reasons why the RTL8169S cards are so cheap
+ - they can't send jumbo-frames
+ - only 8k/64k buffers which results in a interrupt every 3 packets
+ - they are at least handling checksum offloading for ip, udp and tcp
+
+ In the end there is a need for new hardware to limit the throughput by the
+ Ethernet again.
+ - PCI-X, 64bit-PCI, ...
+ - 'real' gigE-Network cards
+ - ...
+
+
+ BTW: 2.4.22 + the r8139 driver are very flacky and resulted in 3 lock-ups
+ for today.
+
+ In another test the dual-PPro-FreeBSD 5.1-CURRENT machine has been used as
+ server with a gigE interface (re0) at has shown that the CPU is the limit
+ for this combination. The maximum thoughput was 7Mb/s.
+
+ Another small benchmark:
+ $ ab -n 1000 -c 10 http://192.168.2.41:&lt;port&gt;/lighttpd-20030925.tar
+
+ port | server | CPU Idle
+ ------+-------­---------+-----------
+ 1025 | lighttpd | 75%
+ 1026 | thttpd 2.23b1 | 75%
+ 1027 | boa-0.94.14rc17 | 69% *
+ 1028 | apache 1.3.x | 77%
+
+
+ In all 4 cases the thoughput was 8600 kbytes/s.
+
+ * boa had 9 failed transfers.
+
+- FreeBSD
+
+ The problems with FreeBSD 5.0-RELEASE vanished after updating to
+ 5.1-CURRENT.
+
+26.09.2003 18:22
+- FreeBSD
+
+ A SMP-machine has been added to the test-farm. It is running FreeBSD
+ 5.1-RELEASE and will help to the improve the scalability.
+
+ fixed sendfile() handling.
+
+- FreeBSD problems
+
+ FreeBSD-5.1-RELEASE-SMP
+ 2 * Pentium Pro 200 MHz
+ 192.168.2.38 (doubleheart)
+ (webserver [lighttpd at port 1025, thttpd at port 1027])
+
+ Linux 2.4.20
+ 1 * AMD 2000+
+ 192.168.2.10 (grisu)
+ (ab)
+
+ Problem:
+ Connections are reset by the kernel without any application intervention.
+
+ Calling 'ab' (apachebench) at grisu with the following paramters:
+
+ /usr/sbin/ab -n 10000 -c 10 http://192.168.2.38:1025/index.html
+
+ results in the following output:
+
+ ...
+ Time taken for tests: 40.610 seconds
+ Complete requests: 10000
+ Failed requests: 5980
+ (Connect: 0, Length: 5980, Exceptions: 0)
+ ...
+
+
+ This is reproducable and the number of failed requests is always
+ 5980 +/- 50 requests. In other words: after 4000 requests tcpdump shows
+ the following output:
+
+ tcpdump shows:
+
+ 00:53:48.923029 192.168.2.10.39774 &gt; 192.168.2.38.1025: S [tcp sum ok]
+ 1013737315:1013737315(0) win 5840 &lt;mss 1460,sackOK,timestamp 5208461
+ 0,nop,wscale0&gt; (DF) (ttl 64, id 7918, len 60)
+0x0000 4500 003c 1eee 4000 4006 964d c0a8 020a E..&lt;..@.@..M....
+0x0010 c0a8 0226 9b5e 0401 3c6c 6763 0000 0000 ...&amp;.^..&lt;lgc....
+0x0020 a002 16d0 eeaa 0000 0204 05b4 0402 080a ................
+0x0030 004f 798d 0000 0000 0103 0300 .Oy.........
+
+ 00:53:48.923330 192.168.2.38.1025 &gt; 192.168.2.10.39774: S [tcp sum ok]
+ 1803860672:1803860672(0) ack 1013737316 win 65535 &lt;mss 1460,nop,wscale
+ 1,nop,nop,timestamp 4459794 5208461&gt; (DF) (ttl 64, id 6821, len 60)
+0x0000 4500 003c 1aa5 4000 4006 9a96 c0a8 0226 E..&lt;..@.@......&amp;
+0x0010 c0a8 020a 0401 9b5e 6b84 bac0 3c6c 6764 .......^k...&lt;lgd
+0x0020 a012 ffff d4ce 0000 0204 05b4 0103 0301 ................
+0x0030 0101 080a 0044 0d12 004f 798d .....D...Oy.
+
+ 00:53:48.924009 192.168.2.10.39774 &gt; 192.168.2.38.1025: . [tcp sum ok] ack 1
+ win 5840 &lt;nop,nop,timestamp 5208461 4459794&gt; (DF)
+ (ttl 64, id 7919, len 52)
+0x0000 4500 0034 1eef 4000 4006 9654 c0a8 020a E..4..@.@..T....
+0x0010 c0a8 0226 9b5e 0401 3c6c 6764 6b84 bac1 ...&amp;.^..&lt;lgdk...
+0x0020 8010 16d0 e9c3 0000 0101 080a 004f 798d .............Oy.
+0x0030 0044 0d12
+
+ 00:53:48.924150 192.168.2.10.39774 &gt; 192.168.2.38.1025: P [tcp sum ok]
+ 1:29(28) ack 1 win 5840 &lt;nop,nop,timestamp 5208461 4459794&gt; (DF)
+ (ttl 64, id 7920, len 80)
+ 0x0000 4500 0050 1ef0 4000 4006 9637 c0a8 020a E..P..@.@..7....
+ 0x0010 c0a8 0226 9b5e 0401 3c6c 6764 6b84 bac1 ...&amp;.^..&lt;lgdk...
+ 0x0020 8018 16d0 27e4 0000 0101 080a 004f 798d ....'........Oy.
+ 0x0030 0044 0d12 4745 5420 2f69 6e64 6578 2e68 .D..GET./index.h
+ 0x0040 746d 6c20 4854 5450 2f31 2e30 0d0a 0d0a tml.HTTP/1.0....
+
+ 00:53:48.924728 192.168.2.38.1025 &gt; 192.168.2.10.39774: R [tcp sum ok]
+ 1803860673:1803860673(0) win 0 (ttl 64, id 6831, len 40)
+0x0000 4500 0028 1aaf 0000 4006 daa0 c0a8 0226 E..(....@......&amp;
+0x0010 c0a8 020a 0401 9b5e 6b84 bac1 0000 0000 .......^k.......
+0x0020 5004 0000 64ba 0000
+
+ SYN, SYN+ACK, ACK, DATA, RST
+
+ strace shows that no connection attempt has been reported to the
+ application which is poll()'ing the server socket.
+
+ /* the common loop without any block attempts */
+
+ accept(3, {sa_family=AF_UNSPEC, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, [0]) = 5
+ fcntl(5, F_SETFL, O_RDWR|O_NONBLOCK) = 0
+ read(5, "GET /index.html HTTP/1.0\r\n\r\n", 4095) = 28
+ stat("/home/jan/lighttpd-0.1.0/servers/", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
+ fstat(6, {st_mode=S_IFREG|0644, st_size=4348, ...}) = 0
+ write(5, "HTTP/1.0 200 OK\r\nConnection: clo"..., 235) = 235
+ write(2, "1064875136: (network.c.210) 235 "..., 33) = 33
+ syscall_393(0x6, 0x5, 0, 0, 0x10fc, 0, 0xbfbff2c0, 0) = 0
+ close(5) = 0
+
+ /* no futher waiting connections */
+
+ accept(3, 0xbfbff700, [1852702730]) = -1 EAGAIN (Resource temporarily unavailable)
+
+ /* enter the main-loop */
+
+ gettimeofday({1769235301, 1663069807}, NULL) = 0
+ poll([{fd=3, events=POLLIN}], 1, 1000) = 0
+ gettimeofday({4294967295, 65537}, NULL) = 0
+ poll([{fd=3, events=POLLIN}], 1, 1000) = 0
+ gettimeofday({4294967295, 65537}, NULL) = 0
+ poll([{fd=3, events=POLLIN}], 1, 1000) = 0
+ ...
+
+ (strace is broken for accept() and gettimeofday(), syscall_393() is sendfile())
+
+ after entering the main-loop the webserver doesn't receive any new POLLIN
+ events at all for the next 10-15 seconds. Any connection-attempt within
+ the period is, as you can see in the tcpdump output, accepted by the
+ kernel and the received data is thrown away as the kernel sends a RST.
+ After those 10-15 seconds the application gets a POLLIN event for the
+ server socket and the normal data-transfer taken place for the next 4000
+ requests.
+
+ This behaviour is reproducable with thttpd 2.20c and the current lighttpd.
+
+
+26.09.2003 11:42
+- localizer
+
+ ported the localizer-server application into a module for lighttpd. After
+ 30 minutes the code was ported and funtional. This modules provides access
+ to the localizer-db by a HTTP-Interface and generates the response as
+ HTML, CSV and plain-text.
+
+ So far, the module-interface looks good and flexible enough.
+
+ 7000 req/s is good enough too. Generating the HTML and querying the DB
+ needs some time.
+
+22.09.2003 08:40
+- modules
+
+ introduced a simple module interface which allow to hook into the process
+ of handling the requests. Basicly it allows to move the url-rewriter, the
+ auth-sub-system and the cache out of the main-code. The module-interface
+ will be extended to allow the cgi and the fastcgi sub-processes to be
+ moved into a module.
+
+15.09.2003 09:36
+- error-handling
+
+ fastcgi and cgi connections are now closed correctly if the corresponding
+ client-connection has died.
+
+14.09.2003 10:40
+- cgi
+
+ finally streaming works with CGI, too
+
+ this enable support for cgiirc.sf.net and friends which use streaming as
+ there transport mechanism.
+
+ streaming has been verified with cgiirc-0.5.2.
+
+- fdevents
+
+ there where some reports that sigio didn't work as expected. It just
+ reported no events at all. Looks like a known bug in the glibc on
+ those platforms.
+
+ Using poll() instead solve the problems.
+
+27.08.2003 22:12
+- rewrite
+
+ a pcre based rewrite engine has been integrated
+
+- cgi
+
+ the file-based cgi interface has been replace by two pipes.
+
+23.07.2003 13:29
+- fdevents
+
+ the whole fd-event handling has been reworked and several smaller bugs
+ and design-errors have fixed.
+
+ sigio, poll() and select() are working fine again.
+
+ On IRIX 6.5 SIGIO could be used, but without further testing poll() is used.
+
+- cgi
+ CGI-support is still broken.
+
+21.07.2003 18:46
+- dnotify
+
+ using the F_NOTIFY feautre of the Linux 2.4.x kernel gives anothre nice
+ performance boost as lighttpd can cache the stat()'s the right way, now.
+
+ 23009.66 @ 5-4k-k which means +10% against 30.06.2003 14:03
+
+ for 1000-4k-nok the performace nearly doubles: 3730.23 goes up to 6144.39
+
+17.07.2003 13:21
+- FreeBSD
+
+ a small patch (#include &lt;&gt;) to compile lighttpd on FreeBSD again.
+
+08.07.2003 10:48
+- fileinfo-cache
+
+ A reallife test showed that the cache wasn't perfect at all as it made
+ lighttpd crash. This is fixed now.
+
+30.06.2003 17:40
+- lighttpd-bench
+
+ After some problems with other benchmarking tools for webservers the first
+ version of lighttpd-bench has been written.
+
+ It a revealed a nasty strange behaviour which was fixed by increasing the
+ listen-backlog from 5 to 1024.
+
+30.06.2003 14:03
+- fileinfo-cache
+
+ the fileinfo-cache has been relaxed a little bit and there are always 2
+ fstat()'s per file-request now. This isn't that dramatic:
+
+ 21800.74 req/s is still a very good result (7-4k-k).
+
+29.06.2003 03:29
+- fileinfo-cache
+
+ a fileinfo cache has been added to reduce the number of system-calls to
+ stat and open a file.
+
+ in the releases before the same file was stat'ed at least 2 times plus a
+ stat on the docroot for each request. Now the stat()'s and the
+ corresponding open() + close() calls are cached and the number of system
+ calls has been reduced to the minimum:
+
+ $ strace -eopen,stat64,read,write,sendfile,accept,shutdown,close \
+ -p `pidof lighttpd`
+
+/* first connection */
+accept(3, {sin_family=AF_INET6, sin6_port=htons(56211),
+ inet_pton(AF_INET6, "::ffff:192.168.2.10", &amp;sin6_addr), sin6_flowinfo=0,
+ sin6_scope_id=0}, [28]) = 5
+accept(3, 0xbffff470, [28]) = -1 EAGAIN
+read(5, "GET /index.html HTTP/1.0\r\nUser-A"..., 4095) = 91
+stat64("/home/weigon/projects/lighttpd/servers/grisu.home.kneschke.de:1025/pages/",
+ {st_mode=S_IFDIR|0755, st_size=3656, ...}) = 0
+stat64("/home/weigon/projects/lighttpd/servers/grisu.home.kneschke.de:1025/pages//index.html",
+ {st_mode=S_IFREG|0644, st_size=4348, ...}) = 0
+open("/home/weigon/projects/lighttpd/servers/grisu.home.kneschke.de:1025/pages//index.html",
+ O_RDONLY) = 6
+write(5, "HTTP/1.0 200 OK\r\nConnection: clo"..., 235) = 235
+sendfile(5, 6, [0], 4348) = 4348
+shutdown(5, 1 /* send */) = 0
+close(5) = 0
+
+/* second connection */
+accept(3, {sin_family=AF_INET6, sin6_port=htons(56212), inet_pton(AF_INET6,
+ "::ffff:192.168.2.10", &amp;sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28])
+ = 5
+accept(3, 0xbffff470, [28]) = -1 EAGAIN
+read(5, "GET /index.html HTTP/1.0\r\nUser-A"..., 4095) = 91
+write(5, "HTTP/1.0 200 OK\r\nConnection: clo"..., 235) = 235
+sendfile(5, 6, [0], 4348) = 4348
+shutdown(5, 1 /* send */) = 0
+close(5) = 0
+
+
+ In the end we have a new speed record:
+
+ (ab -c 8 -n 100000 http://192.168.2.10:1025/index.html with poll())
+ Requests per second: 23435.67 [#/sec] (mean)
+
+ This is a speed increasement of 20-30% against the last internal benchmark.
+
+
+28.06.2003 02:30
+- caching framework
+
+ the trigger.if directive is working fine. the basic algebra is done ( +,
+ -, *, / and comperations =, &lt;=, &gt;=, &gt;, &lt; and the boolean logic
+ &amp;&amp; and || including braces)
+
+ two basic function are available:
+ - unix.time.now
+ - file.mtime(...)
+
+25.06.2003 17:33
+- caching framework
+
+ added output.include, output.content-type for a cache-hit and
+ trigger.handler for a cache-miss.
+
+ the actual decision is made be trigger.if which will be added tomorrow.
+
+15.06.2003 15:33
+- sig-io
+
+ After several other smaller optimisations lighttpd performs better with
+ sig-io under high load:
+
+ sigio+poll poll
+ c1000-4k-nok : 2635.95 1643.39
+ c1000-4k-k : 7335.68 6788.87
+ c1000-100k-nok: 2353.49 1217.73
+ c1000-100k-k : 3097.89 2080.73
+
+
+ The user-space part has been optimized a lot. Now it is time to optimized
+ the number of context-switches between user and kernel-mode.
+
+ user 0m0.180s
+ sys 0m1.160s
+
+ a fileinfo-cache is the way to go.
+
+ struct {
+ buffer *name;
+ struct stat st;
+ int handler;
+ ...
+
+ int fd;
+ void *mmap_p;
+ }
+
+11.06.2003 14:57
+- sig-io is back again
+
+ and it works fine.
+
+ sigio (Realtime-Signals under Linux 2.4.x) sends one signal per event and
+ buffers the rest of the events in a kernel queue. If the is full a SIGIO
+ is sent and poll() gets all events at once for further processing.
+
+
+ Currently the behaviour is a little bit strange:
+ - sig-io + poll() is good for non-keep-alive connections
+ - poll() for keep-alive connections
+
+ c1000-4k-nok: (1000 concurrent request, 4k filesize, no keepalive)
+ poll : 1521.38
+ sigio+poll: 2124.00
+
+ c1000-4k-k: (1000 concurrent request, 4k filesize, keepalive)
+ poll : 5882.35
+ sigio+poll: 1239.46
+
+ Very strange for now.
+
+09.06.2003 23:59
+- code-cleanup
+
+ the event-handling code has been rewritten to handle single events better
+ as they are expected from sig-io.
+
+ the fallback-mode of sig-io is broken now, but the normal poll() mode got
+ a 10% increasement in speed. This means the we are back the speed level of
+ 20030308-0155 are as fast as zeus again.
+
+ Especially under higher load the current lighttpd performes better.
+
+09.06.2003 11:51
+- sig-io benchmark
+
+ 20030609-1151 20030608-2110 20030308-0155
+-c 10 sigio select() poll() poll()
+4k : 7870.92 7937.77 8035.36 9443.76
+4k (keep-alive) : 14098.41 14590.02 14275.52 17985.61
+100k : 3366.32 3382.03 3261.15 3722.32
+100k (keep-alive) : 5544.77 5576.00 5573.20 5975.86
+-c 100
+4k : 6144.77 5821.40 5714.29 6724.95
+4k (keep-alive) : 9097.53 9213.19 8979.08 10833.06
+100k : 2549.33 2495.94 2318.95 2607.36
+100k (keep-alive) : 4267.67 4283.94 4094.17 4314.06
+
+
+For -c 100 4k and 100k sig-io gives a small increasment.
+
+09.06.2003 01:00
+- sig-io
+
+ writing large files works now as expected. After removing the limit for
+ the chunks of sendfile the write-buffer-is-empty-again signal is
+ generated. that was missing.
+
+ 321 of 10000 connections still have the wrong length. After that is fixed
+ it is time to start some benchmarks again.
+
+08.06.2003 21:10
+- sig-io
+
+ first attempts in getting SIGIO support running which were not very
+ successfull yet.
+
+- poll()/select() benchmark
+
+ 20030608-2110 20030525-1623 20030308-0155
+-c 10 select() poll() poll() poll()
+4k : 7937.77 8035.36 8166.60 9443.76
+4k (keep-alive) : 14590.02 14275.52 14781.97 17985.61
+100k : 3382.03 3261.15 3176.42 3722.32
+100k (keep-alive) : 5576.00 5573.20 5809.56 5975.86
+-c 100
+4k : 5821.40 5714.29 5669.26 6724.95
+4k (keep-alive) : 9213.19 8979.08 8418.22 10833.06
+100k : 2495.94 2318.95 2314.28 2607.36
+100k (keep-alive) : 4283.94 4094.17 4456.92 4314.06
+
+
+ as the overall processing cycle has been rearranged the overall figures
+ changed in minor ranges. c100-4k-k increased, *-100k-k decreased.
+
+ At least it still works.
+
+08.06.2003 12:45
+- select()/poll()
+
+ implementate an abstration layer for fd-events (like eevry other webserver).
+ currently we support poll() and select().
+
+ This should bring us support for Mac OS X and propably Windows.
+
+04.06.2003 18:35
+- configure
+
+ lighttpd can now be build without ssl-support even if openssl is installed
+
+- protability
+
+ - on IRIX IPv6 is supported now out of the box
+ - for FreeBSD some missing haeders have been added
+
+04.06.2003 14:34
+- pipelining
+
+ adding support for pipeling introduces a problem if the request-header
+ was broken. this has been fixed now.
+
+- unneccesary slashes
+
+ when building pathes from different portions of a string (e.g. docroot +
+ virt-server-docroot + request-uri) slashes where added for security and
+ simplicity. This resulted in up to 5 adjacent slashes which caused no harm
+ but looked strange. (fixed)
+
+04.06.2003 09:57
+- start/stop messages
+
+ the error-log contains the start and end-times of the lighttpd process,
+ now.
+
+- configfile
+
+ the config-file parser has been relaxed to accepts tabs instead of spaces.
+
+- better error-handling
+
+ fixed a <a
+ href="http://bugs.php.net/?id=24009">bug in the FastCGI-SAPI of PHP</a>
+
+ if the fastcgi process dies or closes the connection unexpectedly we
+ return 500 now instead of closing the connection to the client.
+
+- Location
+
+ the CGI/1.1-rev-03 specification requires us to send Status 302 if a
+ Location-header is sent by the client and a Status-header is missing.
+
+- PATH_TRANSLATED
+
+ if PHP is compiled without --discard-path PATH_TRANSLATED has to be
+ provided.
+
+27.05.2003 15:54
+- directory listings
+
+ if a directory is requested and the directory doesn't contain a index-file
+ a directory-listing can be displayed. You have to enable directory-listings
+ in the config-file (directory-listings on)
+
+- url-decoding
+
+ up to know urls where not decoded at all (%26 -> . and so on). This has
+ been added. Unicode isn't supported as we use 8-bit chars internally.
+
+26.05.2003 00:44
+- pipelining
+
+ as Sascha required pipelining for his benchmarking tool it has been
+ implemented.
+
+ pipelining allows sending a bunch of requests at once without waiting for
+ the actual responses. This reduces the network-overhead and the
+ round-trip-time.
+
+- non-free()d memory
+
+ dmalloc helped to close some non-free()d memory. For the normal operation
+ this isn't important as only memory chunks which had to be free()d at the
+ end of the live-time of the lighttpd-process were not de-allocated.
+
+- partly-initialized variables
+
+ lighttpd wasn't initializing the main-structure which resulted in strange
+ behaviour in rare circumstances.
+
+
+25.05.2003 16:23
+- benchmarks
+
+ after removing some useless internal copies we are more or less at the old
+ speed levels.
+
+ after adding virtual-hosts 10% of the performance were lost. Using less
+ memcpy() operations might add several other boosts.
+
+ I've just checked how lighttpd compares to Zeus.
+
+ lighttpd (current) (old)
+-c 10 20030525-1623 20030308-0155 Zeus 4_2
+4k : 8166.60 9443.76 7278.55
+4k (keep-alive) : 14781.97 17985.61 16496.21
+100k : 3176.42 3722.32 3156.37
+100k (keep-alive) : 5809.56 5975.86 5460.30
+-c 100
+4k : 5669.26 6724.95 5134.26
+4k (keep-alive) : 8418.22 10833.06 8010.25
+100k : 2314.28 2607.36 2688.32
+100k (keep-alive) : 4456.92 4314.06 4240.70
+
+23.05.2003 14:38
+- cgi-variables
+
+ HTTP_HOST was missing for the cgi-module while the fcgi-module passed it
+ through to the handler. Fixed that.
+
+- fcgi-errors
+
+ the connection to the fcgi was dropped and poll() reported an error, the
+ error wasn't reported to the client the right way.
+
+22.05.2003 23:02
+- authorization
+
+ the first password-storage has been added:
+
+ [auth]
+ backend plan
+ plain-userfile &lt;filename&gt;
+
+ require /download/ user=jan|user=anom
+ http-auth /download/ "download archiv" digest
+
+ groups are prepared but not implemented. basic and digest are working fine.
+
+20.05.2003 17:53
+- authentification
+
+ The auth-methods from RFC 2617 have been added.
+ - auth basic
+ - auth digest
+
+ The only source for accounts is currently only the config-file.
+
+ auth-digest needs the plain-text passwort. Are there any source which
+ provide a plain-text password ?
+
+12.05.2003 14:33
+- virtual hosts
+
+ added very basic virtual-host support
+
+ virtual-server-root /home/weigon/projects/lighttpd/servers/
+ virtual-server-default-host grisu.home.kneschke.de:1025
+ virtual-server-docroot /pages/
+
+ docroot is
+
+ - if http-host exists
+ &lt;virtual-server-root&gt; + &lt;http-host&gt; + &lt;virtual-server-docroot&gt;
+
+ - otherwise
+ &lt;virtual-server-root&gt; + &lt;virtual-server-default-host&gt; +
+ &lt;virtual-server-docroot&gt;
+
+ - if even virtual-server-default-host does not exist, 500 is sent
+
+
+12.05.2003 13:02
+- code cleanup
+
+ After two month of development it was time clean-up the internal
+ structures. It looks like every went fine as lighttpd works es expected
+ like before.
+
+- deflate
+ the on-the-fly compression has been verified to work fine with opera,
+ konqui, mozilla and the IE.
+
+12.05.2003 02:10
+- on-the-fly compression: deflate
+
+ Why the hell are the defining a "deflate" encoding in the form of
+
+ _deflate_ The "zlib" format defined in RFC 1950 [31] in combination
+ with the "deflate" compression mechanism described in RFC 1951 [29].
+ (RFC 2616)
+
+ and noone implements it that way ? Konqui and Mozilla expect a plain
+ deflate() package without the zlib-header.
+
+ Konqui is using "inflate2(..., -MAX_WBITS); " which is noted in the zlib
+ source as
+
+ /* handle undocumented nowrap option (no zlib header or check) */
+
+ Funny. Very, very funny.
+
+
+ Anyway. We have mimetype-depended compression support now.
+
+11.05.2003 21:56
+- logging
+ re-arranged the logfile structure to write CLF + useragent + referrer.
+
+11.05.2003 10:23
+- POST file-upload
+ added the missing functionality to send more than a single packet to the
+ FCGI-Server (or Client ? ... the PHP).
+
+ This gives us the file-upload thing for eg. PHP and large user-forms
+ (&gt;16kb).
+
+05.05.2003 15:21
+- PATH_INFO
+
+ added support for PATH_INFO. PHP is a little strange and doesn't trust the
+ passed PATH_INFO setting. Works fine now.
+
+30.04.2003 15:25
+- bug-fixing day
+
+ While testing the FastCGI interface with the MSIE Björn Schotte discovered
+ that sometimes the output repeats itself from the start in an endless loop.
+ This bug has been fixed.
+
+ The read-write-fallback for ancient systems seeked the wrong FDs.
+
+ The FastCGI handler is now separting the HTTP-Header from the
+ response-body what results in a cleaner interface. The "header too long
+ for caching" message is gone now.
+
+28.04.2003 18:18
+- chunked transfer-encoding
+
+ The FastCGI part is now using Chunked-Transfer-Encoding if HTTP/1.1 is
+ used and no content-length is specified.
+
+27.04.2003 23:10
+- chunked transfer-encoding
+ added "Transfer-Encoding: chunked" which is currently used in the web-chat
+ for the endless stream. Perhaps it helps some browsers.
+
+ The FastCGI interface will get a the chunked-support too, as it will
+ enable keep-alive even if no content-length is returned from the FastCGI
+ process. We know the size of the chunks and will report it to the browser.
+
+16.04.2003 12:02
+- gigE deatchmatch
+
+ sascha compared the current lighttpd to his premium thttpd in his
+ gigabit-Ethernet-Network.
+
+ <a
+href="http://schumann.cx/gbit_deathmatch.txt">http://schumann.cx/gbit_deathmatch.txt</a>
+
+ small comment:
+ lighttpd provides the same performance (req/s and thoughput), but uses more
+ CPU-Time.
+
+10.04.2003 17:22
+- works on IRIX
+
+ Jörg Behrens provided me login to his SGI Origin and after fixing two small
+ typos it worked fine on IRIX. (#if define HAVE... was missing a 'd' and
+ getopt returns a 'int' and not a 'char')
+
+ IPv6 support is currently disabled for IRIX a gethostbyname2() isn't
+ available.
+
+10.04.2003 15:56
+- another bug-fixing day
+ The upper limit of open connections was enforced and a caused a seg-fault.
+ The current limit is set to 4096 parallel connections.
+
+ As sascha benchmarked lighttpd and his premium thttpd I tried to reproduce
+ his reported results and had to fix 2 flaws in the async-io handling of
+ httpd_load which was used for the testing.
+
+ If sascha starts another benchmark session I'll put a link to it here.
+
+09.04.2003 00:08
+- bug-fixing time
+ Date: and Last-Modified: where sending a timezone != GMT what was invalid.
+ The timestamp itself was correct, just the timezone use the wrong
+ characters.
+
+ the fcgi-code had an buffer-overflow for larger POST-Requests.
+
+ The fcgi-code still has problems with POST-Request larger than 16kb as the
+ the write buffer is full. Currently we don't handle this case except from
+ reporting it in the error-log.
+
+02.04.2003 01:17
+- cgi is back
+
+ The CGI Interface wasn't tested for a longer time. It don't really
+ survived the introduction of the config-file handling and the internal
+ changes that were part of it.
+
+ A small test with
+
+#! /usr/bin/perl
+print "Content-Type: text/html\r\n\r\n";
+print time()."\n";
+0;
+
+ produced 219 req/s.
+
+ Calling PHP via the CGI interface results in 100 req/s. Same script, same
+ parameters for 'ab' and same PHP result in 1400 req/s if we use the
+ FastCGI interface.
+
+ <b>Don't forget</b>: these benchmarks only represent figures for scenarios which
+ are not very realistic. They are just usefull for comparisions of the
+ internals. We don't want to benchmark applications.
+
+01.04.2003 23:04
+- new benchmarks
+
+ This time we wanted to see if we can get the fastcgi-Interface a little bit
+ faster. We use this small script for the testing the interface.
+
+&lt;?php
+
+ob_start(/*"ob_gzhandler"*/);
+print "12345&lt;br /&gt;\n";
+header("Content-Length: ".ob_get_length());
+ob_end_flush();
+
+?&gt;
+
+ It generate a small network load and is the best case for benchmarking the
+ overhead of the call to the fastcgi-php.
+
+ Using the chunk-API instead auf tmp-files increase the req/s vom 1200req/s
+ to 1600 req/s and the IO-load went down as expected. Waiting for the
+ filesystem and creating 1200 files per second required some time. The
+ CGI-Interface is still using tempfiles.
+
+01.04.2003 19:28 (no april fools joke)
+- added SSL support
+ I took -lssl and -lcrypto and added SSLv2/SSLv3/TLS support to lighttpd.
+
+ After some reading I realisized that libcrypto contained some of my code.
+ They have a similar buffer-struct with similar functions and they use the
+ same MD5-code from the RFC. :)
+
+ Adding basic SSL-support was quite esay: replacing all write/read-calls by
+ SSL_write/read, initializing the ssl-context the right way and telling
+ openssl where to get the data from (SSL_set_fd). It fits really well into
+ lighttpd.
+
+- sidenote
+ sooner or later the con->filename handler will vanish in favour of the
+ direct interface to the chunk-API which will simplifiy the design a little
+ bit.
+
+31.03.2003 20:50
+- added a web-chat module
+ 1400 lines of C-code are neccesary to add a web-chat to lighttpd.
+
+ Features:
+ - bb-code for text-layouting
+ - auto-highlight for URLs and Email-adresses
+ - unlimited number of channels
+ - max. 32.000 users per channel
+ - fast as it is directly integrated into the web-server
+ - easy to install (as easy as lighttpd)
+ - IRC-like (/msg, /kick, /me, ...)
+ - works with MS IE, Mozilla, Konqueror, ...
+ - uses as little JavaScript as possible to stay compatible with all browsers
+ - flood-protection (2 Levels: ignore and kick)
+ - uses CSS for customized look-and-feel
+
+25.03.2003 00:36
+- finished the config-file support
+ now we have config-sections
+
+ [fastcgi]
+ fastcgi .php 192.168.2.76 1025
+
+ The only this missing is -HUP handling to re-read the config. But that
+ will follow when I'm up again.
+
+20.03.2003 01:04
+- adding config-file support
+ the most boring part of the writing programs after writing documentation.
+ The format is quite simple and good enough for lighttpd.
+
+19.03.2003 03:05
+- more on sendfile support
+ added support for freebsd's version of sendfile().
+
+ Linux:
+ ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
+
+ FreeBSD:
+ int sendfile(int fd, int s, off_t offset, size_t nbytes,
+ struct sf_hdtr *hdtr, off_t *sbytes, int flags);
+
+ the first 2 params are swap, the next 2 are the same and the last 3 are
+ set to NULL or 0.
+
+ Solaris 9 is providing a direct interface to the chunk-API with the
+ sendfilev() system call:
+
+ ssize_t sendfilev(int fildes,
+ const struct sendfilevec *vec, int sfvcnt, size_t *xferred);
+
+ recovering from a failure is a little bit more complex, but it should be
+ fast. I just need a system to test it. Anyone ?
+
+18.03.2003 17:32
+- in the news
+ what a surprise: lighttpd is announced in entwickler.com.
+
+ <a href="http://www.entwickler.com/itr/news/psecom,id,9483,nodeid,82.html">http://www.entwickler.com/itr/news/psecom,id,9483,nodeid,82.html</a>
+
+ this was not planned.
+
+
+- implemented the chunked-API
+ rather writing the content of multi-range'd requests to a temp-file we
+ just register the parts in a chunk-queue.
+
+ chunk 1 [mem] - part-header
+ chunk 2 [file] - source-file (offset, len)
+ chunk 3 [mem] - part-header
+ chunk 4 [file] - source-file (offset, len)
+ chunk 5 [mem] - part-footer
+
+ If everything is prepared, the content-length is calculated and the
+ http-header is generated and prepended to the chunk-queue.
+
+ the handle_write() function which handles the write-process just sends the
+ chunks to the network without only further modifications.
+
+ the chunk-api even simplifies the
+ 'my-fastcgi-process-needs-some-time-to-create-the-response-
+ and-sends-the-data-in-chunks' case. Just add the chunk to the queue if it
+ is received.
+
+13.03.2003 10:49
+- another set of real-life benchmarks
+
+ the chairman was benchmarked a little bit. Chairman is full-flegded WCMS.
+ As every CMS it needs some time to generate pages. To speed the page
+ generating the static-parts of the page can be cached internally.
+
+ without caching with caching
+apache + mod_php : 2.50 10.64 req/s
+lighttpd + fcgi-php: 2.50 22.74 req/s
+
+ Looks like lighttpd is the way to go :)
+
+ Please, don't compare these numbers with the other benchmarks:
+ We used a different test-machine which is a little bit under-powered
+ for this test-case.
+
+12.03.2003 13:43
+- another large application works with lighttpd
+
+ <a
+href="http://www.thinkphp.de/content/content2.php?CatID=44&amp;NewsID=95">Chairman</a> from <a href="http://www.thinkphp.de/">thinkphp</a> has been verified to work with lighttpd.
+
+ Three things are worth to note:
+
+ 1. ALWAYS use log_error in the php.ini if you use FastCGI
+ otherwise it will put the errormessages directly into fastcgi-socket
+ without any FastCGI Header. This will result in strange errors.
+ (its a PHP bug)
+ 2. DOCUMENT_ROOT has been added to the environment variables
+ 3. a small bug for sending larger output from a fastcgi client has been
+ fixed.
+
+11.03.2003 11:52
+- added two neccesary features
+ - redirect _dir_ to _dir_/
+ - append index-file to _dir_/ if they exist
+
+11.03.2003 00:13
+- another target
+ after adding some headers lighttpd compiles without any warnings
+ under cygwin on Windows.
+
+ A native windows port will take some time as I have to figure out the
+ changes on the winsock.h to the unix headers.
+
+10.03.2003 11:52
+- added Solaris 8 and 9
+ lighttpd has been confirmed to compile and work on
+
+ - linux
+ - FreeBSD, NetBSD
+ - Solaris 8, 9
+
+ Perhaps I can get lcc to compile it on windows.
+
+10.03.2003 01:30
+- another platform was confirmed
+ lighttpd works on NetBSD
+
+- another webserver benchmark
+ mathopd (http://www.mathopd.org/)
+
+ Mathopd/1.4
+-c 10
+4k : 6329.11 [#/sec]
+4k (keep-alive) : 10235.41 [#/sec]
+100k : 1168.50 [#/sec]
+100k (keep-alive) : 268.82 [#/sec] (99% idle)
+-c 100
+4k : ---- (connections dropped)
+4k (keep-alive) : ----
+100k : ----
+100k (keep-alive) : ----
+
+Very good values for small files, but the rest ?
+
+10.03.2003 00:06
+- added more write-handlers
+ 1. sendfile (linux only)
+ 2. mmap + write
+ 3. read + write
+
+ This means that lighttpd runs on some more systems. It has been verified
+ to compile and work on linux 2.4.x and FreeBSD.
+
+
+-c 100
+ sendfile mmap read
+4k 6476.68 5698.01 5363.08 [#/sec]
+100k 2312.35 841.54 783.09 [#/sec]
+
+ The mmap() numbers could be better with a fd+mmap-cache. The zero-copy thing
+ is good for our performance.
+
+- tested another small httpd - BOA
+ just to get a better view about the performance of lighttpd i've tested
+ another httpd: Boa/0.94.14rc16 (http://www.boa.org/)
+
+ Boa/0.94.14rc16
+-c 10
+4k : 5659.63 [#/sec]
+4k (keep-alive) : 250.23 [#/sec]
+100k : 1104.29 [#/sec]
+100k (keep-alive) : 1363.14 [#/sec]
+-c 100
+4k : 4319.65 [#/sec]
+4k (keep-alive) : 2490.66 [#/sec]
+100k : 815.93 [#/sec]
+100k (keep-alive) : 1007.05 [#/sec]
+
+ The results are a little bit strange. Keep-Alive for small files seems to be
+ broken.
+
+ It looks like lighttpd has enough power for now. Time the port and add more
+ features.
+
+09.03.2003 13:26
+- load-balancing works great
+
+ I used the framework from http://framework.netuse.de/ as a
+ real-life example again to test the load-balancer.
+
+ setup:
+ - grisu
+ - AMD athlon XP 2000+
+ - runs lighttpd + ab + a 'nice -15'ed FastCGI-PHP
+ - generates 153 req/s alone
+
+ - laptop
+ - Intel PIII 850
+ - runs a FastCGI-PHP
+ - generates 88 req/s
+
+ using the internal load-balancer of lighttpd which balances the
+ php-requests over grisu and laptop generate:
+ 221 req/s
+
+ An apache with mod_php running on grisu gives 117.04 req/s only.
+
+09.03.2003 12:46
+- building the connect connection to the fcgi-php is not non-blocking
+ socket() -> connect() -> fcntl(non-blocking) resulted in some problems as
+ the connect() call blocked sometimes for 1 seconds.
+
+ socket() -> fcntl(non-blocking) -> connect() solves this problem, but
+ addes more overhead. The first connect-attempt seems always to
+ return EINPROGRESS.
+
+08.03.2003 15:06
+- the first 'real-life' PHP test showed 2 bugs in the POST handling.
+ 1. the Content-Type header was not forwarded via fastcgi
+ 2. the internal content_length handler wasn't reset after the request
+
+ now lighttpd + php work with
+
+ http://framework.netuse.de/
+
+ the basic application gives us 145 req/s
+
+08.03.2003 11:06
+- use diet to 'test' your code
+ diet gives some use full warnings which should be followed. I took the
+ chance and removed the last few fprintf() and sprintf() from the code.
+ now, we don't need stdio.h anymore.
+
+ a staticly linked, stripped lighttpd is 42884 bytes large.
+
+08.03.2003 01:55
+- buffer_strcat() uses strlen() to get the length of the 'to-be-catted-string'
+ if the string is constant or has a known length you can pass that function
+ which gives use buffer_strcat_len() which passes the string length as a
+ parameter.
+
+- using a ramdisk as the base for the tempfiles generated mkstemp() is a
+ very cood idea
+ it reduces the io-load on the system and gives as more cpu-time for
+ load-balancing the php-requests.
+
+- cache the output of strftime(), gmtime() and localtime
+ we generate more then 10.000 req/s which results in using the same
+ timestamp over and over again. It is sufficient to generate the timestamp
+ once a second and give us a bunch of CPU-cycles for sending files.
+
+ the same applies for other timestamps like Last-modified which sends a
+ string version of st.st_mtime. Cache it.
+
+- don't try to overoptimize for code for the sake of clean code
+ the range support require some hack in the first versions like setting the
+ write_offset to the start of the range and keeping the rest of the
+ "code 200" send code as usual. Only a few lines added this first range
+ feature. fast, but a hack. It made things more complicated then neccesary
+ to add multi-range support in this scenario.
+
+ removing the hack doing small clean preprocessing helps to clean up the
+ whole 'write a chunk on the wire' code. At the end we use less code and
+ have a cleaner design.
+
+ Sascha proposed a chunked layer which just takes the chunks (http-header,
+ part-header, part-message, ... and the last boundary) and passes them to
+ the write-to-the-wire-code. This is far more elegant and will perhaps same
+ us from other problems, too. Currently I think that it is not necessary.
+ First we have to fix some protability issues.
+
+Ok, today benches:
+
+ today last
+-c 10
+4k : 9443.76 7739.94 + 22%
+4k (keep-alive) : 17985.61 13885.03 + 29%
+100k : 3722.32 3349.97 + 11%
+100k (keep-alive) : 5975.86 4965.49 + 20%
+-c 100
+4k : 6724.95 5918.56 + 13%
+4k (keep-alive) : 10833.06 8405.48 + 28%
+100k : 2607.36 2393.60 + 9%
+100k (keep-alive) : 4314.06 4035.35 + 7%
+
+Top Transfer Rate:
+
+ 86365.77 [Kbytes/sec] received
+
+Too much for a GigE-link ?
+
+
+so far:
+
+- use state-engines
+
+ a non-forking webserver like described in
+
+ http://www.kegel.com/c10k.html
+
+- don't use fprintf() for logging.
+ writing one line to log file takes more time that sending responsing the a
+ HTTP-request
+
+- take care of your memory
+
+ typedef struct {
+ char *ptr;
+ size_t used;
+ size_t size;
+ } buffer;
+
+ buffer* buffer_init();
+ void buffer_free(buffer *b);
+ int buffer_prepare_copy(buffer *b, size_t size);
+ int buffer_prepare_append(buffer *b, size_t size);
+ int buffer_strcpy(buffer *b, const char *s);
+ int buffer_strcpy_len(buffer *b, const char *s, int s_len);
+ int buffer_strcat(buffer *b, const char *s);
+ int buffer_strcat_len(buffer *b, const char *s, int s_len);
+
+ buffer_init() is only called once per buffer. If you don't need the
+ buffer, set 'used' to zero and reused it afterward.
+ buffer_strcpy() + buffer_strcat() check if the 'used' + the new strlen()
+ fit in to the 'size' of the buffer. If not the realloc() the buffer.
+ buffer_strcat() uses memcpy(ptr + used - 1, s, s_len + 1); which should
+ be faster than the original strcat().
+
+ Using those buffers keep the memory usage at 2Mb. malloc() and free() are
+ only called at the beginnig of the programm and at the end.
+
+- don't used sprintf() to convert a integer into a string as like
+ sprintf(buf, "%d", l);
+
+ write your own ltostr function. sprintf() is to general for the case and
+ is slow.
+
+
+Speed:
+------
+
+Let's assume that <a
+href="http://www.acme.com/software/thttpd/">thttpd</a> is (one of) the
+fastest webservers out there.
+
+all httpds were started with:
+
+$ ./thttpd -p 1026 -D \
+ -d /home/weigon/projects/localizer/src/lighttpd/docroot/ \
+ -l thttpd.access.log
+
+(lighttpd uses the same parameters).
+
+We used ApacheBench for testing the RPS (requests per second).
+
+$ /usr/sbin/ab -dS -c 10 -n 100000 http://192.168.2.10:80/dummy.out
+
+ lighttpd thttpd/2.21b+php thttpd/2.20c thttpd/2.23b1
+(concurrency 10)
+4k : 7739.94 6040.84 5078.20 5888.24 [#/sec]
+4k (keep-alive): 13885.03 10349.82 5034.49 5853.09 [#/sec]
+100k : 3349.97 1176.29[1] 1188.74 1198.29 [#/sec]
+100k (keep-a.) : 4965.49 2513.38[2] 1100.65 1130.51 [#/sec]
+(concurrency 100)
+4k : 5918.56 4907.01 4987.53 4886.87 [#/sec]
+4k (keep-alive): 8405.48 6379.99 4938.76 4816.26 [#/sec]
+100k : 2393.60 972.73 958.27 961.09 [#/sec]
+100k (keep-a.) : 4035.35 893.51[3] 970.21 955.05 [#/sec]
+
+thttpd/2.21b+php has been patched with the keep-alive + php patches from PHP4
+sapi/thttpd/thttpd_patch.
+
+[1] ab reported:
+Failed requests: 1
+ (Connect: 0, Length: 1, Exceptions: 0)
+[2] ab reported:
+Failed requests: 5
+ (Connect: 0, Length: 5, Exceptions: 0)
+[3] ab reported:
+Failed requests: 24
+ (Connect: 0, Length: 24, Exceptions: 0)
+
+Tunning the thttpd:
+-------------------
+- disable symlink checking (chroot() or -nos)
+- log to /dev/shm/logfile, a ramdisk or disable logging
+
+
+$ ./thttpd -p 1026 -D \
+ -d /home/weigon/projects/localizer/src/lighttpd/docroot/ \
+ -l /dev/null
+
diff --git a/INSTALL b/INSTALL
index f0ca061..1ecc9ed 100644
--- a/INSTALL
+++ b/INSTALL
@@ -10,7 +10,7 @@ Installation
Installation
------------
-Get the source from
+Get the source from
http://www.lighttpd.net/download/
diff --git a/Makefile.am b/Makefile.am
index 0898d4a..dcd2605 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,3 @@
-SUBDIRS=src doc tests
+SUBDIRS=src doc tests cygwin openwrt
-EXTRA_DIST=autogen.sh SConstruct
-
-ACLOCAL_AMFLAGS = -I m4
-
-distcleancheck_listfiles = find -type f -exec sh -c 'test -f $(srcdir)/{} || echo {}' ';'
+EXTRA_DIST=lighttpd.spec
diff --git a/Makefile.in b/Makefile.in
index 26da2e5..33e3307 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,12 +13,15 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -34,45 +36,30 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
-subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
- $(srcdir)/distribute.sh.in $(top_srcdir)/configure AUTHORS \
- COPYING INSTALL NEWS compile config.guess config.sub depcomp \
- install-sh ltmain.sh missing
+ $(srcdir)/distribute.sh.in $(srcdir)/lighttpd.spec.in \
+ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
+ compile config.guess config.sub depcomp install-sh ltmain.sh \
+ missing mkinstalldirs
+subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = distribute.sh
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
+CONFIG_CLEAN_FILES = lighttpd.spec distribute.sh
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
- install-dvi-recursive install-exec-recursive \
- install-html-recursive install-info-recursive \
- install-pdf-recursive install-ps-recursive install-recursive \
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
- distdir dist dist-all distcheck
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
@@ -80,44 +67,17 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
- if test -d "$(distdir)"; then \
- find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -rf "$(distdir)" \
- || { sleep 5 && rm -rf "$(distdir)"; }; \
- else :; fi
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
-am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
- | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ATTR_LIB = @ATTR_LIB@
AUTOCONF = @AUTOCONF@
@@ -128,73 +88,69 @@ BZ_LIB = @BZ_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@
+CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
+CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
CRYPT_LIB = @CRYPT_LIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
+ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
FAM_CFLAGS = @FAM_CFLAGS@
FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
+FFLAGS = @FFLAGS@
GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LBER_LIB = @LBER_LIB@
-LD = @LD@
LDAP_LIB = @LDAP_LIB@
LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LUACONFIG = @LUACONFIG@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
+NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@
+NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@
OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
PCRE_LIB = @PCRE_LIB@
PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
-SED = @SED@
SENDFILE_LIB = @SENDFILE_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -203,18 +159,20 @@ SQLITE_LIBS = @SQLITE_LIBS@
SSL_LIB = @SSL_LIB@
STRIP = @STRIP@
U = @U@
-UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -226,67 +184,53 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
-builddir = @builddir@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
-localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = src doc tests
-EXTRA_DIST = autogen.sh SConstruct
-ACLOCAL_AMFLAGS = -I m4
-distcleancheck_listfiles = find -type f -exec sh -c 'test -f $(srcdir)/{} || echo {}' ';'
+SUBDIRS = src doc tests cygwin openwrt
+EXTRA_DIST = lighttpd.spec
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
-am--refresh: Makefile
+am--refresh:
@:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
+ cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -301,26 +245,29 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
-$(top_srcdir)/configure: $(am__configure_deps)
- $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
- @if test ! -f $@; then rm -f stamp-h1; else :; fi
- @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) stamp-h1; \
+ else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.h.in: $(am__configure_deps)
- ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
+lighttpd.spec: $(top_builddir)/config.status $(srcdir)/lighttpd.spec.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
distribute.sh: $(top_builddir)/config.status $(srcdir)/distribute.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $@
@@ -331,7 +278,8 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
- -rm -f libtool config.lt
+ -rm -f libtool
+uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
@@ -340,7 +288,7 @@ distclean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @fail= failcom='exit 1'; \
+ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -357,15 +305,16 @@ $(RECURSIVE_TARGETS):
else \
local_target="$$target"; \
fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
-$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -391,16 +340,16 @@ $(RECURSIVE_CLEAN_TARGETS):
else \
local_target="$$target"; \
fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -408,14 +357,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- set x; \
+ tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
@@ -427,131 +376,99 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
+ $$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
- test -d "$(distdir)" || mkdir "$(distdir)"
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
+ mkdir $(distdir)
+ $(mkdir_p) $(distdir)/. $(distdir)/cygwin $(distdir)/openwrt
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
done
- -test -n "$(am__skip_mode_fix)" \
- || find "$(distdir)" -type d ! -perm -755 \
- -exec chmod u+rwx,go+rx {} \; -o \
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r "$(distdir)"
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
-dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
- $(am__remove_distdir)
-dist-lzip: distdir
- tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
- $(am__remove_distdir)
-
-dist-lzma: distdir
- tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
- $(am__remove_distdir)
-
-dist-xz: distdir
- tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
@@ -569,7 +486,6 @@ dist-zip: distdir
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
@@ -578,19 +494,13 @@ dist dist-all: distdir
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
- bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.lzma*) \
- lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
- *.tar.lz*) \
- lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
- *.tar.xz*) \
- xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
@@ -598,13 +508,10 @@ distcheck: dist
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
- test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
+ && cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
- $(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -625,24 +532,14 @@ distcheck: dist
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
- && cd "$$am__cwd" \
- || exit 1
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
distuninstallcheck:
- @test -n '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: trying to run $@ with an empty' \
- '$$(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- $(am__cd) '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
@@ -673,22 +570,16 @@ install-am: all-am
installcheck: installcheck-recursive
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -709,38 +600,18 @@ dvi-am:
html: html-recursive
-html-am:
-
info: info-recursive
info-am:
install-data-am:
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
install-exec-am:
-install-html: install-html-recursive
-
-install-html-am:
-
install-info: install-info-recursive
-install-info-am:
-
install-man:
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
installcheck-am:
maintainer-clean: maintainer-clean-recursive
@@ -761,27 +632,24 @@ ps: ps-recursive
ps-am:
-uninstall-am:
+uninstall-am: uninstall-info-am
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
- ctags-recursive install-am install-strip tags-recursive
+uninstall-info: uninstall-info-recursive
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am am--refresh check check-am clean clean-generic \
- clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
- dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \
- dist-zip distcheck distclean distclean-generic distclean-hdr \
- distclean-libtool distclean-tags distcleancheck distdir \
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+ check-am clean clean-generic clean-libtool clean-recursive \
+ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+ dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-recursive distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
- ps ps-am tags tags-recursive uninstall uninstall-am
-
+ maintainer-clean-recursive mostlyclean mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/NEWS b/NEWS
index 7d555fa..bc1caa4 100644
--- a/NEWS
+++ b/NEWS
@@ -3,618 +3,32 @@
NEWS
====
-- 1.4.31 -
- * [ssl] fix segfault in counting renegotiations for openssl versions without TLSEXT/SNI (thx carpii for reporting)
- * Move fdevent subsystem includes to implementation files to reduce conflicts (fixes #2373)
- * [mod_compress] fix handling if etags are disabled but cache-dir is set - may lead to double response
- * disable mmap by default (fixes #2391)
- * buffer_caseless_compare: always convert letters to lowercase to get transitive results, fixing array lookups (fixes #2405)
- * Fix handling of empty header list entries in http_request_split_value, fixing invalid read in valgrind (fixes #2413)
- * Fix access log escaping of " and \\ (fixes #1551)
- * [mod_auth] Fix digest "md5-sess" implementation (Errata ID 1649, RFC 2617) (fixes #2410)
- * [auth] Add "AUTH_TYPE" environment (for *cgi), remove fastcgi specific workaround, add fastcgi test case (fixes #889)
- * [mod_*cgi,mod_accesslog] Fix splitting :port with ipv6 (fixes #2333, thx simoncpu)
- * Detect multiple -f options: show error message instead of assert (fixes #2416)
- * [mod_extforward] Support ipv6 addresses (fixes #1889)
- * [mod_redirect] Support url.redirect-code option (fixes #2247)
- * Fix --enable-mmap handling in configure.ac
-
-- 1.4.30 - 2011-12-18
- * Always use our 'own' md5 implementation, fixes linking issues on MacOS (fixes #2331)
- * Limit amount of bytes we send in one go; fixes stalling in one connection and timeouts on slow systems.
- * [ssl] fix build errors when Elliptic-Curve Diffie-Hellman is disabled
- * Add static-file.disable-pathinfo option to prevent handling of urls like .../secret.php/image.jpg as static file
- * Don't overwrite 401 (auth required) with 501 (unknown method) (fixes #2341)
- * Fix mod_status bug: always showed "0/0" in the "Read" column for uploads (fixes #2351)
- * [mod_auth] Fix signedness error in http_auth (fixes #2370, CVE-2011-4362)
- * [ssl] count renegotiations to prevent client renegotiations
- * [ssl] add option to honor server cipher order (fixes #2364, BEAST attack)
- * [core] accept dots in ipv6 addresses in host header (fixes #2359)
- * [ssl] fix ssl connection aborts if files are larger than the MAX_WRITE_LIMIT (256kb)
- * [libev/cgi] fix waitpid ECHILD errors in cgi with libev (fixes #2324)
-
-- 1.4.29 - 2011-07-03
- * Fix mod_proxy waiting for response even if content-length is 0 (fixes #2259)
- * Silence annoying "connection closed: poll() -> ERR" error.log message (fixes #2257)
- * mod_cgi: make read buffer as big as incoming data block
- * [build] Fix detection of libev (fixes #2300)
- * ssl: Support for Diffie-Hellman and Elliptic-Curve Diffie-Hellman key exchange (fixes #2301)
- add ssl.use-sslv3 (fixes #2246)
- load all algorithms (fixes #2239)
- * [ssl/md5] prefix our own md5 implementation with li_ so it doesn't conflict with the openssl one (fixes #2269)
- * [ssl/build] some minor fixes; fix compile without ssl, cleanup ssl config buffers
- * [proc,include_shell] log error if exec shell fails (fixes #2280)
- * [*cgi] Use physical base dir (alias, userdir) as DOCUMENT_ROOT in cgi environments (fixes #2216)
- * [doc] Move docs to outdated/ subdir and refer to wiki instead (fixes #2248)
- * fdevent: add solaris eventports (fixes #2171)
-
-- 1.4.28 - 2010-08-22
- * Rename fdevent_event_add to _set to reflect what the function does. Fix some handlers. (fixes #2249)
- * Fix buffer.h to include stdio.h as it is needer for SEGFAULT() (fixes #2250)
-
-- 1.4.27 - 2010-08-13
- * Fix handling return value of SSL_CTX_set_options (fixes #2157, thx mlcreech)
- * Fix mod_proxy HUP handling (send final chunk, fix usage counter)
- * mod_proxy: close connection on write error (fixes #2114)
- * Check uri instead of physical path for directory redirect
- * Fix detecting git repository (fixes #2173, thx ncopa)
- * [mod_compress] Fix segfault when etags are disabled (fixes #2169)
- * Reset uri.authority before TLS servername handling, reset all "keep-alive" data in connection_del (fixes #2125)
- * Print double quotes properly when dumping config file (fixes #1806)
- * Include IP addresses on error log on password failures (fixes #2191)
- * Fix stalls while reading from ssl sockets (fixes #2197)
- * Fix etag formatting on boxes with 32-bit longs
- * Fix two compiler warnings
- * mod_accesslog: fix %p for ipv6 sockets (fixes #2228, thx jo.henke)
- * mod_fastcgi: Send 502 "Bad Gateway" if we couldn't open the file for X-Sendfile (fixes #2226)
- * mod_staticfile: add debug output if we ignore a file with static-file.exclude-extensions (fixes #2215)
- * mod_cgi: fix race condition leaving response not forwarded to client (fixes #2217)
- * mod_accesslog: Fix var declarations mixed in source (fixes #2233)
- * mod_status: Add version to status page (fixes #2219)
- * mod_accesslog: optimize accesslog_append_escaped (fixes #2236, thx crypt)
- * openssl: silence annoying error messages for errno==0 (fixes #2213)
- * array.c: improve array_get_unused_element to check data type; fix mem leak if unused_element didn't find a matching entry (fixes #2145)
- * add check to stop loading plugins twice
- * cleanup fdevent code, removed linux-rtsig handler, replaced some fprintf calls
- * only require FDEVENT_IN bit to be set for listening connections (fixes #2227)
- * add libev fdevent handler: server.event-handler = "libev"
- * mod_proxy: return response as soon as it is available (fixes #2196)
- * don't overwrite global server.force-lowercase-filenames setting (fixes #2042)
- * bind to IPV6-only if ipv6 address was specified (http://redmine.lighttpd.net/projects/lighttpd/wiki/IPv6-Config)
-
-- 1.4.26 - 2010-02-07
- * Fix request parser to handle packets with splitted \r\n\r\n (fixes #2105)
- * Remove dependency on automake >= 1.11 with m4_ifdef check
- * mod_accesslog: support %e (fixes #2113, thx presbrey)
- * Fix mod_cgi cgi.execute-x-only option in global block
- * mod_fastcgi: x-sendfile2 parse error debugging
- * Fix mod_proxy dead host detection if connect() fails
- * Fix fd leaks in mod_cgi (fds not closed on pipe/fork failures, found by Rodrigo, fixes #2158, #2159)
- * Fix segfault with broken rewrite/redirect patterns (fixes #2140, found by crypt)
- * Append to previous buffer in con read, fix DoS/OOM vulnerability (fixes #2147, found by liming, CVE-2010-0295)
- * Fix HUP detection in close-state if event-backend doesn't support FDEVENT_HUP (like select or poll on FreeBSD)
-
-- 1.4.25 - 2009-11-21
- * mod_magnet: fix pairs() for normal tables and strings (fixes #1307)
- * mod_magnet: add traceback for printing lua errors
- * mod_rewrite: fix compile error if compiled without pcre
- * disable warning "CLOSE-read" (fixes #2091)
- * mod_rrdtool: fix creating file if it doesn't exist (#1788)
- * reset tlsext_server_name in connection_reset - fixes random hostnames in the $HTTP["host"] conditional
- * export some SSL_CLIENT_* vars for client cert validation (fixes #1288, thx presbrey)
- * mod_fastcgi: fix mod_fastcgi packet parsing
- * mod_fastcgi: Don't reconnect after connect() succeeded (fixes #2096)
- * Fix configure.ac to allow autoreconf, also enables make V=0
-
-- 1.4.24 - 2009-10-25
- * Add T_CONFIG_INT for bigger integers from the config (needed for #1966)
- * Use unsigned int (and T_CONFIG_INT) for max_request_size
- * Use unsigned int for secdownload.timeout (fixes #1966)
- * Keep url/host values from connection to display information while keep-alive in mod_status (fixes #1202)
- * Add server.breakagelog, a "special" stderr (fixes #1863)
- * Fix config evaluation for debug.log-timeouts option (#1529)
- * Add "cgi.execute-x-only" to mod_cgi, requires +x for cgi scripts (fixes #2013)
- * Fix FD_SETSIZE comparision warnings
- * Add "lua-5.1" to searched pkg-config names for lua
- * Fix unused function webdav_lockdiscovery in mod_webdav
- * cmake: Fix crypt lib check
- * cmake: Add -export-dynamic to link flags, fixes build on FreeBSD
- * Set FD_CLOEXEC for bound sockets before pipe-logger forks (fixes #2026)
- * Reset ignored signals to SIG_DFL before exec() in fastcgi/scgi (fixes #2029)
- * Show "no uri specified -> 400" error only when "debug.log-request-header-on-error" is enabled (fixes #2030)
- * Fix hanging connection in mod_scgi (fixes #2024)
- * Allow digits in hostnames in more places (fixes #1148)
- * Use connection_reset instead of handle_request_done for cleanup callbacks
- * Change mod_expire to append Cache-Control instead of overwriting it (fixes #1997)
- * Allow all comparisons for $SERVER["socket"] - only bind for "=="
- * Remove strptime failed message (fixes #2031)
- * Fix issues found with clang analyzer
- * Try to fix server.tag issue with localized svnversion
- * Fix handling network-write return values (#2024)
- * Use disable-time in fastcgi for all disables after errors, default is 1sec (fixes #2040)
- * Remove adaptive spawning code from fastcgi (was disabled for a long time)
- * Allow mod_mysql_vhost to use stored procedures (fixes #2011, thx Ben Brown)
- * Fix ipv6 in mod_proxy (fixes #2043)
- * Print errors from include_shell to stderr
- * Set tm.tm_isdst = 0 before mktime() (fixes #2047)
- * Use linux-epoll by default if available (fixes #2021, thx Olaf van der Spek)
- * Print an error if you use too many captures in a regex pattern (fixes #2059)
- * Combine Cache-Control header value in mod_expire to existing HTTP header if header already added by other modules (fixes #2068)
- * Remember keep-alive-idle in separate variable (fixes #1988)
- * Fix header inclusion order, always include "config.h" before any system header
- * mod_webdav: Patch to skip login information for domain part of Destination field (fixes #1793)
- * mod_webdav: Delete old properties before updating new for MOVE (fixes #1317)
- * Read hostname from absolute uris in the request line (fixes #1937)
- * mod_fastcgi: don't disable backend if disable-time is 0 (fixes #1825)
- * mod_compress: match partial+full content-type (fixes #1552)
- * mod_fastcgi: fix is_local detection, respawn backends if bin-path is set (fixes #897)
- * Fix linger-on-close behaviour to avoid rare failure conditions (was r2636, fixes #657)
- * mod_fastcgi: restart local procs immediately after they terminated, fix local procs handling
- * Fix segfault on invalid config "duplicate else conditions" (fixes #2065)
- * mod_usertrack: Use T_CONFIG_INT for max-age, solves range problem (#1455)
- * mod_accesslog: configurable timestamp logging (fixes #1479)
- * always define _GNU_SOURCE
- * Add some iterators for mod_magnet (fixes #1307)
- * Fix close_timeout_ts trigger (should finally fix lingering close)
- * mod_rewrite: add url.rewrite-[repeat-]if-not-file to rewrite if file doesn't exist or is not a regular file (fixes #985, thx lucas aerbeydt)
- * Add TLS servername indication (SNI) support (fixes #386, thx Peter Colberg <peter@colberg.org>)
- * Add SSL Client Certificate verification (#1288)
- * mod_fastcgi: Fix host->active_procs counter, return 503 if connect wasn't successful after 5 tries (fixes #1825)
- * mod_accesslog: escape special characters (fixes #1551, thx icy)
- * fix mod_webdav crash from #1793 (fixes #2084, thx hiroya)
- * Don't print ssl error if client didn't support TLS SNI
- * Fix linger close timeout handling, drop timeout to 5 seconds (fixes #2086)
- * Fix broken return values from int to enum in mod_fastcgi
-
-- 1.4.23 - 2009-06-19
- * Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
- * New lighttpd man page (moved it to section 8) (fixes #1875)
- * Create rrd file for empty rrdfile in mod_rrdtool (#1788)
- * Fix workaround for incorrect path info/scriptname if fastcgi prefix is "/" (fixes #729)
- * Finally removed spawn-fcgi
- * Allow xattr to overwrite mime type (fixes #1929)
- * Remove link from errormsg about fastcgi apps (fixes #1942)
- * Strip trailing dot from "Host:" header
- * Remove the optional port info from SERVER_NAME (thx Mr_Bond)
- * Fix mod_proxy RoundRobin (off by one problem if only one backend is up)
- * Rename configure.in to configure.ac, with small cleanups (fixes #1932)
- * Add proper SUID bit detection (fixes #416)
- * Check for regular file in mod_cgi, so we don't try to start directories
- * Include mmap.h from chunk.h to fix some problems with #define mmap mmap64 (fixes #1923)
- * Add support for pipe logging for server.errorlog (fixes #296)
- * Add revision number to package version for svn/git checkouts
- * Use server.tag for SERVER_SOFTWARE if configured (fixes #357)
- * Fix trailing zero char in REQUEST_URI after "strip-request-uri" in mod_fastcgi
- * mod_magnet: Add env["request.remote-ip"] (fixes #1740)
- * mod_magnet: Add env["request.path-info"]
- * Change name/version separator back to "/" (affects every place where the version is printed)
- * Fix bug with FastCGI request id overflow under high load; just use always id 1 as we don't use multiplexing. (thx jgray)
- * Add some dirlisting enhancements (fixes #1458)
- * Add option to enable TCP_DEFER_ACCEPT (fixes #1447)
- * Limit amount of bytes read for one read-event (fixes #1070)
- * Add evasive.silent option (fixes #1438)
- * Make mod_extforward headers configurable (fixes #1545)
- * Add '%_' pattern for complete hostname in mod_evhost (fixes #1737)
- * Add IPv6 support to mod_proxy (fixes #1537)
- * mod_ssi printenv: print cgi env, add environment vars to cgi env (fixes #1713)
- * Fix error message if no auth backend was set
- * Fix SERVER_NAME port stripping (fixes #1968)
- * Fix x-sendfile 2gb limiting (fixes #1970)
- * Fix mod_cgi environment keys mangling (fixes #1969)
- * Fix workaround for incorrect path info/scriptname if scgi prefix is "/" (fixes #729)
- * Fix max-age value in mod_expire for 'modification' (fixes #1978)
- * Fix evasive.silent option (#1438)
- * Fix mod-fastcgi counters
- * Modify fastcgi error message
- * Backup errno for later usage (reported by Guido Reina via mailinglist)
- * Improve FastCGI performance (fixes #1999)
- * Workaround broken operating systems: check for trailing '/' in filenames (fixes #1989)
- * Allow using pcre with cross-compiling (pcre-config got fixed; fixes #1986)
- * Add "lighty.req_env" table to mod_magnet for setting/getting environment values for cgi (fixes #1967, thx presbrey)
- * Fix segfault in mod_expire after failed config parsing (fixes #1992)
- * Add ssi.content-type option (default text/html, fixes #615)
- * Add support for "real" entropy from /dev/[u]random (fixes #1977)
- * Adding support for additional chars in LDAP usernames (fixes #1941)
- * Ignore multiple "If-None-Match" headers (only use first one, fixes #753)
- * Fix 100% cpu usage if time() < 0 (thx to gaspa and cate, fixes #1964)
- * Allow max-keep-alive-requests to depend on conditional (fixes #1881)
- * Make dependency on svnversion/git optional (for devel versionstamp, fixes #2009)
-
-- 1.4.22 - 2009-03-07
- * Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)
- * Fix default vhost in mod_simple_vhost (fixes #1905)
- * Handle EINTR in mod_rrdtool (fixes #604)
- * Fix rrd error after graceful restart (fixes #419)
- * Fix EAGAIN handling for freebsd sendfile (fixes #1913, thx AnMaster for spotting the problem)
- * Fix segfault in mod_scgi (fixes #1911)
- * Treat EPIPE as connection-closed error in network_freebsd_sendfile.c (another fix from #1913)
- * Fix useless redirection of stderr in mod_rrdtool, as it gets redirected to /dev/null later. (fixes #1922)
- * Fix some problems with more strict compilers (#1923)
- * Fix segfault if siginfo_t* is NULL in sigaction handler (fixes #1926)
-
-- 1.4.21 - 2009-02-16
-
- * Fix base64 decoding in mod_auth (#1757, thx guido)
- * Fix mod_cgi segfault when bound to unix domain socket (#653)
- * Do not rely on ioctl FIONREAD (#673)
- * Now really fix mod auth ldap (#1066)
- * Fix leaving zombie process with include_shell (#1777)
- * Removed debian/, openwrt/ and cygwin/; they weren't kept up-to-date, and we decided to remove dist. specific stuff
- * Try to convert string options to shorts for numeric options in config file; allows to use env-vars for numeric options. (#1159, thx andrewb)
- * Do not cache default vhost in mod_simple_vhost (#709)
- * Trust pcre-config, do not check for pcre manually (#1769)
- * Fix fastcgi authorization in subdirectories with check-local=disabled; don't split pathinfo for authorizer. (#963)
- * Add possibility to disable methods in mod_compress (#1773)
- * Fix duplicate connection keep-alive/transfer-encoding headers (#960)
- * Fixed fix for round-robin in mod_proxy (forgot to increment the index) (#1715)
- * Fix fastcgi-authorizer handling; Status: 200 is now accepted as the doc requests
- * Compare address family in inet_ntop_cache
- * Revert CVE-2008-4359 (#1720) fix "encoding+simplifying urls for rewrite/redirect": too many regressions.
- * Use FD_CLOEXEC if possible (fixes #1821)
- * Optimized buffer usage in mod_proxy (fixes #1850)
- * Fix uninitialized value in time struct after strptime
- * Do not pass Proxy-Connection: header from client to backend http server in mod_proxy (#1877)
- * Fix wrong malloc sizes in mod_accesslog (probably nothing bad happened...) (fixes #1855, thx ycheng)
- * Some small buffer.c fixes (closes #1837)
- * Remove floating point math from server.c (fixes #1402)
- * Disable SSLv2 by default
- * Use/enforce sane max-connection values (fixes #1803)
- * Allow mod_compress to return 304 (Not Modified); compress ignores the static-file.etags option.(fixes #1884)
- * Add option to ignore the "Expect: 100-continue" header instead of returning 417 Expectation failed (closes #1017)
- * Use modified etags in mod_compress (fixes #1800)
- * Fix max-connection limit handling/100% cpu usage (fixes #1436)
- * Fix error handling in freebsd-sendfile (fixes #1813)
- * Silenced the annoying "request timed out" warning, enable with the "debug.log-timeouts" option (fixes #1529)
- * Allow tabs in header values (fixes #1822)
- * Added Language conditional (fixes #1119); patch by petar
- * Fix wrong format strings (#1900, thx stepancheg)
-
-- 1.4.20 - 2008-09-30
-
- * Fix mod_compress to compile with old gcc version (#1592)
- * Fix mod_extforward to compile with old gcc version (#1591)
- * Update documentation for #1587
- * Fix #285 again: read error after SSL_shutdown (thx marton.illes@balabit.com) and clear the error queue before some other calls (CVE-2008-1531)
- * Fix mod_magnet: enable "request.method" and "request.protocol" in lighty.env (#1308)
- * Fix segfault for appending matched parts if there was no regex matching (just give empty strings) (#1601)
- * Use data_response_init in mod_fastcgi x-sendfile handling for response.headers, fix a small "memleak" (#1628)
- * Don't send empty Server headers (#1620)
- * Fix conditional interpretation of core options
- * Enable escaping of % and $ in redirect/rewrite; only two cases changed their behaviour: "%%" => "%", "$$" => "$"
- * Fix accesslog port (should be port from the connection, not the "server.port") (#1618)
- * Fix mod_fastcgi prefix matching: match the prefix always against url, not the absolute filepath (regardless of check-local)
- * Overwrite Content-Type header in mod_dirlisting instead of inserting (#1614), patch by Henrik Holst
- * Handle EINTR in mod_cgi during write() (#1640)
- * Allow all http status codes by default; disable body only for 204,205 and 304; generate error pages for 4xx and 5xx (#1639)
- * Fix mod_magnet to set con->mode = p->id if it generates content, so returning 4xx/5xx doesn't append an error page
- * Remove lighttpd.spec* from source, fixing all problems with it ;-)
- * Do not rely on PATH_MAX (POSIX does not require it) (#580)
- * Disable logging to access.log if filename is an empty string
- * Implement a clean way to open /dev/null and use it to close stdin/out/err in the needed places (#624)
- * merge spawn-fcgi changes from trunk (from @2191)
- * let spawn-fcgi propagate exit code from spawned fcgi application
- * close connection after redirect in trigger_b4_dl (thx icy)
- * close connection in mod_magnet if returned status code
- * fix bug with IPv6 in mod_evasive (#1579)
- * fix scgi HTTP/1.* status parsing (#1638), found by met@uberstats.com
- * [tests] fixed system, use foreground daemons and waitpid
- * [tests] removed pidfile from test system
- * [tests] fixed tests needing php running (if not running on port 1026, search php in env[PHP] or /usr/bin/php-cgi)
- * fixed typo in mod_accesslog (#1699)
- * replaced buffer_{append,copy}_string with the _len variant where possible (#1732) (thx crypt)
- * case insensitive match for secdownload md5 token (#1710)
- * Handle only HEAD, GET and POST in mod_dirlisting (same as in staticfile) (#1687)
- * fixed mod_secdownload problem with unsigned time_t (#1688)
- * handle EAGAIN and EINTR for freebsd sendfile (#1675)
- * Use filedescriptor 0 for mod_scgi spawn socket, redirect STDERR to /dev/null (#1716)
- * fixed round-robin balancing in mod_proxy (#1715)
- * fixed EINTR handling for waitpid in mod_fastcgi
- * mod_{fast,s}cgi: overwrite environment variables (#1722)
- * inserted many con->mode checks; they should prevent two modules to handle the same request if they shouldn't (#631)
- * fixed url encoding to encode more characters (#266)
- * allow digits in [s]cgi env vars (#1712)
- * fixed dropping last character of evhost pattern (#161)
- * print helpful error message on conditionals in global block (#1550)
- * decode url before matching in mod_rewrite (#1720) -- (reverted for 1.4.21)
- * fixed conditional patching of ldap filter (#1564)
- * Match headers case insensitive in response (removing of X-{Sendfile,LIGHTTPD-*}, catching Date/Server) [2281]
- * fixed bug with case-insensitive filenames in mod_userdir (#1589), spotted by "anders1" (CVE-2008-4360)
- * fixed format string bugs in mod_accesslog for SYSLOG
- * replaced fprintf with log_error_write in fastcgi debug
- * fixed mem leak in ssi expression parser (#1753), thx Take5k
- * hide some ssl errors per default, enable them with debug.log-ssl-noise (#397)
- * do not send content-encoding for 304 (#1754), thx yzlai
- * fix segfault for stat_cache(fam) calls with relative path (without '/', can be triggered by x-sendfile) (#1750)
- * fix splitting of auth-ldap filter
- * workaround ldap connection leak if a ldap connection failed (restarting ldap)
- * fix auth.backend.ldap.bind-dn/pw problems (only read from global context for temporary ldap reconnects, thx ruskie)
- * fix memleak in request header parsing (#1774, thx qhy) (CVE-2008-4298)
- * fix mod_rewrite memleak/endless loop detection (#1775, thx phy - again!)
- * use decoded url for matching in mod_redirect (#1720) (CVE-2008-4359) -- (reverted for 1.4.21)
-
-- 1.4.19 - 2008-03-10
-
- * added support for If-Range: <date> (#1346)
- * added support for matching $HTTP["scheme"] in configs
- * fixed initgroups() called after chroot (#1384)
- * fixed case-sensitive check for Auth-Method (#1456)
- * execute fcgi app without /bin/sh if used as argument to spawn-fcgi (#1428)
- * fixed a bug that made /-prefixed extensions being handled also when
- matching the end of the uri in fcgi,scgi and proxy modules (#1489)
- * print error if X-LIGHTTPD-send-file cannot be done; reset header
- Content-Length for send-file. Patches by Stefan Buehler
- * prevent crash in certain php-fcgi configurations (#841)
- * add IdleServers and Scoreboard directives in ?auto mode for mod_status (#1507)
- * open log immediately after daemonizing, fixes SIGPIPEs on startup (#165)
- * HTTPS env var should be "on" when using mod_extforward and the X-Forwarded-Proto header is set. (#1499)
- * generate ETag and Last-Modified headers for mod_ssi based on newest modified include (#1491)
- * support letterhomes in mod_userdir (#1473)
- * support chained proxies in mod_extforward (#1528)
- * fixed bogus "cgi died ?" if we kill the CGI process on shutdown
- * fixed ECONNRESET handling in network-openssl
- * fixed handling of EAGAIN in network-linux-sendfile (#657)
- * reset conditional cache (#1164)
- * create directories in mod_compress (was broken with alias/userdir) (#1027)
- * fixed out of range access in fd array (#1562, #372) (CVE-2008-0983)
- * mod_compress should check if the request is already handled, e.g. by fastcgi (#1565)
- * remove broken workaround for buggy Opera version with ssl/chunked encoding (#285)
- * generate etag/last-modified header for on-the-fly-compressed files (#1171)
- * req-method OPTIONS: do not insert default response if request was denied, do not deny OPTIONS by default (#1324)
- * fixed memory leak on windows (#1347)
- * fixed building outside of the src dir (#1349)
- * fixed including of stdint.h/inttypes.h in etag.c (#1413)
- * do not add Accept-Ranges header if range-request is disabled (#1449)
- * log the ip of failed auth tries in error.log (enhancement #1544)
- * fixed RoundRobin in mod_proxy (#516)
- * check for symlinks after successful pathinfo matching (#1574)
- * fixed mod-proxy.t to run with a builddir outside of the src dir
- * do not suppress content on "307 Temporary Redirect" (#1412)
- * fixed Content-Length header if response body gets removed in connections.c (#1412, part 2)
- * do not generate a "Content-Length: 0" header for HEAD requests, added test too
- * remove compress cache file if compression or write failed (#1150)
- * fixed body handling of status 300 requests
- * spawn-fcgi: only try to connect to unix socket (not tcp) before spawning (#1575)
- * fix sending source of cgi script instead of 500 error if fork fails (CVE-2008-1111)
- * fix min-procs handling in mod_scgi.c, just set to max-procs (patch from #623)
- * fix sending "408 - Timeout" instead of "410 - Gone" for timedout urls in mod_secdownload (#1440)
- * workaround #1587: require userdir.path to be set to enable mod_userdir (empty string allowed) (CVE-2008-1270)
- * make configure checks for --with-pcre, --with-zlib and --with-bzip2 failing if the headers aren't found
- * fixed handling of waitpid() == EINTR mod_ssi on solaris
-
-- 1.4.18 - 2007-09-09
-
- * fixed compile error on IRIX 6.5.x on prctl() (#1333)
- * fixed forwarding a SIGINT and SIGHUP when using max-workers (#902)
- * fixed FastCGI header overrun in mod_fastcgi (reported by mattias@secweb.se)
- * fixed hanging redirects with keep-alive due to missing
- "Content-Length: 0" headers
- * fixed crashing when using undefined environment variables in the config
- * fixed compilation of mod_mysql_vhost on irix (#1341)
-
-- 1.4.17 - 2007-08-29
-
- * added dir-listing.set-footer in mod_dirlisting (#1277)
- * added sending UID and PID for SIGTERM and SIGINT to the logs
- * fixed hardcoded font-sizes in mod_dirlisting (#1267)
- * fixed different ETag length on 32/64 platforms (#1279)
- * fixed compression of files < 128 bytes by disabling compression (#1241)
- * fixed mysql server reconnects (#518)
- * fixed disabled keep-alive for dynamic content with HTTP/1.0 (#1166)
- * fixed crash on mixed EOL sequences in mod_cgi
- * fixed key compare (#1287)
- * fixed invalid char in header values (#1286)
- * fixed invalid "304 Not Modified" on broken timestamps
- * fixed endless loop on shrinked files with sendfile() on BSD (#1289)
- * fixed counter overrun in ?auto in mod_status (#909)
- * fixed too aggresive caching of nested conditionals (#41)
- * fixed possible overflow in unix-socket path checks on BSD (#713)
- * fixed extra Content-Length header on 1xx, 204 and 304 (#1002)
- * fixed handling of duplicate If-Modified-Since to return 304
- * fixed extracting status code from NPH scripts (#1125)
- * fixed prctl() usage (#1310)
- * removed config-check if passwd files exist (#1188)
- * fixed crash when etags are disabled but the client sends one (#1322)
- * fixed crash when freeing the config in mod_alias
- * fixed server.error-handler-404 breakage from 1.4.16 (#1270)
- * fixed entering 404-handler from dynamic content (#948)
- * added more debug infos for FAM based stat-cache
- * use more LSB like paths in the sample config (#1242)
-
-- 1.4.16 - 2007-07-25
-
- * added static-file.etags, etag.use-inode, etag.use-mtime, etag.use-size
- to customize the generation of ETags for static files. (#1209)
- (patch by <Yusufg@gmail.com>)
- * fixed typecast of NULL on execl() (#1235)
- (patch by F. Denis)
- * fixed circumventing url.access-deny by trailing slash (#1230)
- * fixed crash on duplicate headers with trailing WS (#1232)
- * fixed accepting more connections then requested (#1216)
- * fixed mem-leak in mod_auth (reported by Stefan Esser)
- * fixed crash with md5-sess and cnonce not set in mod_auth (reported by Stefan Esser)
- * fixed missing check for base64 encoded string in mod_auth and Basic auth
- (reported by Stefan Esser)
- * fixed possible crash in Auth-Digest header parser on trailing WS in
- mod_auth (reported by Stefan Esser)
- * fixed check on stale errno values, which broke handling of broken fastcgi
- applications. (#1245)
- * fixed crash on 32bit archs when debug-msgs are printed in mod_scgi, mod_fastcgi
- and mod_webdav (#1263)
-
-- 1.4.15 - 2007-04-13
-
- * fixed broken Set-Cookie headers
-
-- 1.4.14 - 2007-04-13
-
- * fix crash if gethostbyaddr() failed on redirect [1718]
- * properly handle 206 responses generated by *cgi scripts. (#755) [1716]
- * added HTTPS=on to the environment of cgi scripts (#861) [1684]
- * fix handling of 303 (#1045) [1678]
- * made the configure check for lua more portable [1677]
- * added mod_extforward module [1665]
- * references to the fam stat cache engine should be conditional (#1039) [1664]
- * fix http 500 errors (colin.stephen/at/o2.com) #1041 [1663]
- * prevent wrong pidfile unlinking on graceful restart (Chris Webb) [1656]
- * ignore empty packets from STDERR stream. #998
- * fix a crash for files with an mtime of 0 reported by cubiq on irc [1519]
- CVE-2007-1870
- * allow empty passwords with ldap (Jörg Sonnenberger) [1516]
- * mod_scgi.c segfault fix #964 [1501]
- * Added round-robin support to mod_fastcgi [1500]
- * Handle DragonFlyBSD the same way as Freebsd (Jörg Sonnenberger) [1492,1676]
- * added now and weeks support to mod_expire. #943
- * fix cpu hog in certain requests [1473] CVE-2007-1869
- * fix for handling hostnames with trailing dot [1406]
- * fixed header-injection via server.tag (#1106)
- * disabled caching of files without a content-type to solve the
- aggressive caching of FF
- * remove trailing white-spaces from HTTP-requests before parsing (#1098)
- * fixed accesslog.use-syslog in a conditional and the caching of the
- accesslog for files (fixes #1064)
- * fixed various crashes at startup on broken accesslog.format strings (#1000)
- * fixed handling of %% in accesslog.format
- * fixed conditional dir-listing.exclude (#930)
- * reduced default PATH_MAX to 255 (#826)
- * ECONNABORTED is not known on cygwin (#863)
- * fixed crash on url.redirect and url.rewrite if %0 is used in a global context
- (#800)
- * fixed possible crash in debug-message in mod_extforward
- * fixed compilation of mod_extforward on glibc < 2.3.4
- * fixed include of empty in the configfiles (#1076)
- * send SIGUSR1 to fastcgi children before SIGTERM. libfcgi wants SIGUSR1. (#737)
- * fixed missing AUTH_TYPE entry in the fastcgi environment. (#889)
- * fixed compilation in network_writev.c on MacOS X 10.3.9 (#903)
- * added kill-signal as another setting for fastcgi backends. See the wiki for more.
-
-- 1.4.13 - 2006-10-09
-
- * added initgroups in spawn-fcgi (#871)
- * added apr1 support htpasswd in mod-auth (#870)
- * added lighty.stat() to mod_magnet
- * fixed segfault in splitted CRLF CRLF sequences
- (introduced in 1.4.12) (#876)
- * fixed compilation of LOCK support in mod-webdav
- * fixed fragments in request-URLs (#869)
- * fixed pkg-config check for lua5.1 on debian
- * fixed Content-Length = 0 on HEAD requests without
- a known Content-Length (#119)
- * fixed mkdir() forcing 0700 (#884)
- * fixed writev() on FreeBSD 4.x and older (#875)
- * removed warning about a 404-error-handler
- returned 404
- * backported and fixed the buildsystem changes for
- webdav locks
- * fixed plugin loading so we can finally load lua
- extensions in mod_magnet scripts
- * fixed large uploads if xattr is enabled
-
-- 1.4.12 - 2006-09-23
-
- * added experimental LOCK support for webdav
- * added Content-Range support for PUT in webdav
- * added support for += on empty arrays in config-files
- * added ssl.cipher-list and ssl.use-sslv2
- * added $HTTP["querystring"] conditional
- * added mod_magnet as long-term replacement for mod_cml
- * added work-around for a Opera Bug with SSL + Chunked-Encoding
- * changed --print-config to print to stdout instead of stderr
- * changed no longer use 0600 for new files with webdav. umask is
- honored. Make sure you have set a proper umask.
- * fixed upload hangs with SSL
- * fixed connection drops with SSL (aka bad retry)
- * fixed path traversal with \ on cygwin
- * fixed mem-leak in mod_flv_streaming
- * fixed required trailing newline in configfiles (#142)
- * fixed quoting the autoconf files (#466)
- * fixed empty Host: + $HTTP["host"] handling (#458)
- * fixed handling of If-Modified-Since if ETag is not set
- * fixed default-shell if SHELL is not set (#441)
- * fixed appending and assigning of env.* vars
- * fixed empty FCGI_STDERR packets
- * fixed conditional server.allow-http-11
- * fixed handling of follow-symlink + lstat()
- * fixed SIGHUP handling if max-workers is used
- * fixed "Software caused connection abort" messages on FreeBSD
-
-- 1.4.11 - 2006-03-09
-
- * added ability to specify which ip address spawn-fci listens on
- (agkr/at/pobox.com)
- * added mod_flv_streaming to streaming Flash Movies efficiently
- * fixed handling of error codes returned by mod_dav_svn behing a
- mod_proxy
- * fixed error-messages in mod_auth and mod_fastcgi
- * fixed re-enabling overloaded local fastcgi backends
- * fixed handling of deleted files in linux-sendfile
- * fixed compilation on BSD and MacOSX
- * fixed $SERVER["socket"] on a already bound socket
- * fixed local source retrieval on windows
- (secunia)
- * fixed hanging cgi if remote side is dieing while reading
- from the pipe (sandy/at/meebo.com)
-
-- 1.4.10 - 2006-02-08
-
- * added docs for mod_dirlisting
- * added fastcgi.map-extensions to mod_fastcgi
- * fixed load balancing for mod_fastcgi
- * fixed extra newline for syslog() in mod_accesslog
- * fixed user-track cookie for IE in mod_usertrack
- * fixed crash in digest handling in mod_auth
- * fixed handling of 301 response-bodies from a mod_proxy backend
- * fixed loading of base modules if server.modules is not set
- * fixed broken cgi if mod_scgi is loaded
-
-- 1.4.9 - 2006-01-14
-
- * added server.core-files option (sandy <sandy/at/meebo.com>)
- * added docs for mod_status
- * added mod_evasive to limit the number of connections by IP (<w1zzard/at/techpowerup.com>)
- * added the power-magnet to mod_cml
- * added internal statistics to mod_fastcgi
- * added server.statistics-url to get internal statistics from mod_status
- * added support for conditional range-requests through If-Range
- * added static building via scons
- * fixed 100% cpu loops in mod_cgi ("sandy" <sjen/at/cs.stanford.edu>)
- * fixed handling for secure-download.timeout (jamis/at/37signals.com)
- * fixed IE bug in content-charset in the output of mod_dirlisting (sniper/at/php.net)
- * fixed typos and language in the docs (ryan-2005/at/ryandesign.com)
- * fixed assertion in mod_cgi on HEAD request is Content-Length (<sandy/at/meebo.com>)
- * fixed handling if equal but duplicate If-Modified-Since request headers
- * fixed endless loops in mod_fastcgi if backend is dead
- * fixed Depth: 1 handling in PROPFIND requests on empty dirs
- * fixed encoding of UTF8 encoded dirlistings (Jani Taskinen <sniper/at/iki.fi>)
- * fixed initial bind to a unix-domain socket through server.bind
- * fixed handling of lowercase filesystems
- * fixed duplicate request headers cause by mod_setenv
-
- 1.4.8 - 2005-11-23
* added auto-reconnect to ldap-server in mod_auth
- (joerg/at/netbsd.org)
- * changed auth.ldap-cafile to be optional
- (joerg/at/netbsd.org)
+ (joerg@netbsd.org)
+ * changed auth.ldap-cafile to be optional
+ (joerg@netbsd.org)
* added strip_request_uri in mod_fastcgi
* added more X-* headers to mod_proxy
- (Ben Grimm <bengrimm/at/gmail.com>)
- * added 'debug' to simple-vhost to suppress the
+ (Ben Grimm <bengrimm@gmail.com>)
+ * added 'debug' to simple-vhost to suppress the
(mod_simple_vhost.c.157) No such file or directory /servers/ww.lighttpd.net/pages/
messages by default
- * added support to let the server listen on UNIX-socket
+ * added support to let the server listen on UNIX-socket
* changed default stat-cache-engine to 'simple'
* removed debian/ dir from source package on request by packager
* fixed max-age timestamps in mod_expire
* fixed encoding the filenames in PROPFIND in mod_webdav
* fixed range request handling in network_writev
* fixed retry on connect error in mod_fastcgi
- (Robert G. Jakabosky <bobby/at/alphatrade.com>)
- * fixed possible crash in mod_webdav if sqlite3 support
+ (Robert G. Jakabosky <bobby@alphatrade.com>)
+ * fixed possible crash in mod_webdav if sqlite3 support
is available but not use
* fixed fdvent-handler init if server.max-worker was used
- (Siddharth Vijayakrishnan <mail/at/bluefireworks.net>)
+ (Siddharth Vijayakrishnan <mail@bluefireworks.net>)
* fixed missing cleanup in mysql_vhost
- * fixed assert() in "connections.c:962:
+ * fixed assert() in "connections.c:962:
connection_handle_read_state: Assertion 'c->mem->used' failed."
* fixed 64bit issue in md5
* fixed crash in mod_status
@@ -623,7 +37,7 @@ NEWS
* fixed unsigned/signed comparisions
* fixed streaming in mod_cgi
* fixed possible overflow in password-salt handling
- (reported on slashdot by james-web/at/and.org)
+ (reported on slashdot by james-web@and.org)
* fixed server-traffic-limit if connection limit is not set
- 1.4.7 - 2005-11-02
@@ -633,13 +47,13 @@ NEWS
* added madvise() to instruct the kernel the do proper read-ahead in network_writev
* added support for %I in mod_accesslog
* added better compat to Apache for ?auto in mod_status
- * added support for userdirs without a entry in /etc/passwd in mod_userdir
- (rob/at/inversepath.com)
+ * added support for userdirs without a entry in /etc/passwd in mod_userdir
+ (rob@inversepath.com)
* added startup-time selectable network-backend
* added location of upload-files to config as array
* added webdav.log-xml for logging xml-content in mod_webdav
* added Cache-Control: max-age to mod_expire
- * workaround missing client-bug by assuming we received a close-notify on
+ * workaround missing client-bug by assuming we received a close-notify on
non-keep-alive requests in SSL request
* disabled kerberos5 support by default to fix compilation on RHEL
* fixed order of library checks to fix compilation on Solaris 9
@@ -690,10 +104,10 @@ NEWS
- 1.4.3 - 2005-09-01
* added gracefull shutdown
- * added server.max-connections
+ * added server.max-connections
* fixed compilation on all BSD platforms
* fixed init of kqueue and /dev/poll after daemonize
- * fixed segfault if select() is event-handler and more than FD_SETSIZE
+ * fixed segfault if select() is event-handler and more than FD_SETSIZE
fds are opened
* fixed compilation of mod_cml
* fixed bin-copy-env in mod_fastcgi
@@ -713,13 +127,13 @@ NEWS
* added a complete Class 1 complient mod_webdav
* fixed ssl support (especially on OpenBSD)
* fixed response header in body problem in mod_cgi
- * fixed numbers before body problem
+ * fixed numbers before body problem
* fixed compilation on Solaris and FreeBSD
* fixed conditional options in mod_dirlisting
* fixed segfault in mod_dirlisting for NFS directories
* fixed check for docroot in change-root environments
-- 1.4.0 - 2005-08-17
+- 1.4.0 - 2005-08-17
* added nested conditionals
* added remote-ip to $HTTP
@@ -735,7 +149,7 @@ NEWS
* added support for accesslog to syslog
* added support for PATH_INFO guessing if check-local is disabled in
mod_fastcgi
- * added switch to disable range-requests
+ * added switch to disable range-requests
* added valid-user option for mod_auth (tigger at gentoo.org)
* added JavaScript based sorting to mod_status (erik)
* added selective TCP_CORK (Christian von Roques)
@@ -748,7 +162,7 @@ NEWS
- 1.3.15 - 2005-07-15
- * added mod_cml
+ * added mod_cml
* added mod_trigger_b4_dl
* added encoding to mod_dirlisting
* added ?auto to mod_status
@@ -791,7 +205,7 @@ NEWS
* added REMOTE_PORT and SERVER_ADDR to CGI-env
* relaxed handling of newlines before keep-alive requests
* relaxed uri-parser again
- * fixed PHP_SELF for php
+ * fixed PHP_SELF for php
* fixed compilation on MacOS X
* fixed handling of EPIPE and ECONNRESET
* fixed crash in mod_auth if config-options are missing
@@ -805,7 +219,7 @@ NEWS
* added support for full commandline in spawn-fcgi
* fixed missing check for IP-address in mod_fastcgi
* fixed compile error with openssl in mod_fastcgi
- * removed a debug-message from network-functions
+ * removed a debug-message from network-functions
- 1.3.9 - 2005-02-06
@@ -817,9 +231,9 @@ NEWS
* fixed min-procs and max-procs in FastCGI on PowerPC
* fixed crash in setenv.add-response-header
* fixed handling of nph-scripts in CGI
- * fixed accidently sending out physical file in CGI on error
+ * fixed accidently sending out physical file in CGI on error
* fixed cygwin support
- * fixed handling of missing files
+ * fixed handling of missing files
* fixed HEAD requests for dynamic requests
- 1.3.8 - 2005-01-30
@@ -834,22 +248,22 @@ NEWS
* fixed build problems on netbsd 1.4.x and 1.5.x
* fixed status.url configuration
* fixed handling of != and !~ in configutation
- * fixed special cases in keep-alive handling
+ * fixed special cases in keep-alive handling
* fixed timeout handling in handling POST requests
- * fixed mode AUTHORIZER in FastCGI
+ * fixed mode AUTHORIZER in FastCGI
* fixed handling if internal redirects if no Host: is supplied
- * fixed mod_alias + pathinfo
+ * fixed mod_alias + pathinfo
* fixed directory indexes and permissions
* enabled sending errorlog to syslog again
- 1.3.7 - 2004-12-11
- * added retries for a fastcgi connect if a php-childs
+ * added retries for a fastcgi connect if a php-childs
dies at startup
* update the debian directory
* added setgroups() to drop all group-privs
* added native port to windows via mingw32
- * added server.tag = '...'
+ * added server.tag = '...'
* added support for ${...} in mod_ssi
* ported all plugins to conditional support
* fixed multipart handling in cgi
@@ -863,10 +277,10 @@ NEWS
- 1.3.6 - 2004-11-03
* added spawn-fcgi to the distribution
- * added support in fastcgi module to spawn fastcgi
+ * added support in fastcgi module to spawn fastcgi
processes itself
* fixed logfile cycling if external logging is used
- * fixed connection handling in fastcgi if no chunk
+ * fixed connection handling in fastcgi if no chunk
encoding is used
* fixed internal redirects on directories if a query
string is supplied
@@ -875,7 +289,7 @@ NEWS
- 1.3.5 - 2004-10-31
- * added mod_alias
+ * added mod_alias
* added mod_userdir
* added the exec command to the SSI handler
* added a switch to disable follow-symlinks
@@ -891,12 +305,12 @@ NEWS
* added build target for OpenWRT
* added plain backend support for auth-digest
* fixed handling the external accesslog processes
- * fixed SERVER_NAME in CGI and FastCGI
+ * fixed SERVER_NAME in CGI and FastCGI
- 1.3.3 - 2004-10-16
* added support for NL terminators in CGI-scripts
- * added support for conditionals in mod_auth,
+ * added support for conditionals in mod_auth,
mod_simple_vhost and mod_evhost
* added a error-handler for 404 codes
* fixed request counter in the rrdtool module
@@ -1000,7 +414,7 @@ NEWS
- 1.2.0 - 2004-05-17
* added conforming Expect: handling
- * added a module for secure and fast downloading
+ * added a module for secure and fast downloading
* rewrote the event handling interface
* fixed array handling which might lead to 'missing header'
* fixed pipelining support
diff --git a/README b/README
index cb72e75..5a70155 100644
--- a/README
+++ b/README
@@ -12,20 +12,17 @@ a light httpd
:Revision: $Revision: 1.8 $
:abstract:
- lighttpd a secure, fast, compliant and very flexible web-server
+ lighttpd a secure, fast, compliant and very flexible web-server
which has been optimized for high-performance environments. It has a very
low memory footprint compared to other webservers and takes care of cpu-load.
Its advanced feature-set (FastCGI, CGI, Auth, Output-Compression,
URL-Rewriting and many more) make lighttpd the perfect webserver-software
for every server that is suffering load problems.
-:documentation:
- http://wiki.lighttpd.net/
-
the naming
----------
-lighttpd is a __httpd__ which is
+lighttpd is a __httpd__ which is
- fast as __light__ning and
- __light__ when it comes to memory consumption and system requirements
@@ -53,7 +50,7 @@ Advanced Features
- load-balanced FastCGI
(one webserver distributes requests to multiple PHP-servers via FastCGI)
- custom error pages (for Response-Code 400-599)
-- virtual hosts
+- virtual hosts
- directory listings
- streaming CGI and FastCGI
- URL-Rewriting
@@ -74,18 +71,18 @@ PHP-Support
- includes a utility to spawn FastCGI processes (necessary for PHP 4.3.x)
Security features
-`````````````````
+`````````````````
- chroot(), set UID, set GID
- protecting docroot
HTTP/1.1 features
-`````````````````
+`````````````````
- Ranges (start-end, start-, -end, multiple ranges)
- HTTP/1.0 Keep-Alive + HTTP/1.1 persistent Connections
- methods: GET, HEAD, POST
-- Last-Modified + If-Modified handling
+- Last-Modified + If-Modified handling
- sends Content-Length if possible
- sends Transfer-Encoding: chunk, if Content-Length is not possible
- sends Content-Type
@@ -94,7 +91,7 @@ HTTP/1.1 features
(http://www.ietf.org/rfc/rfc2617.txt)
HTTP/1.1 compliance
-```````````````````
+```````````````````
- Sends 206 for Range Requests
- Sends 304 for If-Modified Requests
@@ -104,7 +101,7 @@ HTTP/1.1 compliance
- Sends 416 for "out-of-range" on Range: Header
- Sends 501 for request-method != (GET|POST|HEAD)
- Sends 505 for protocol != HTTP/1.0 or HTTP/1.1
-- Sends Date: on every requests
+- Sends Date: on every requests
Intended Audience
-----------------
@@ -121,14 +118,14 @@ It has been tested to work with
- IE 6.0
- Mozilla 1.x
-- Konqueror 3.1
+- Konqueror 3.1
(for Keep-Alive/Persistent Connections, Accept-Encoding for PHP + gzip)
-- wget
+- wget
(for Resuming)
- acrobat plugin
(for multiple ranges)
-
-
+
+
Works on
--------
diff --git a/SConstruct b/SConstruct
deleted file mode 100644
index 4223930..0000000
--- a/SConstruct
+++ /dev/null
@@ -1,277 +0,0 @@
-import os
-import sys
-import re
-import string
-from stat import *
-
-package = 'lighttpd'
-version = '1.4.31'
-
-def checkCHeaders(autoconf, hdrs):
- p = re.compile('[^A-Z0-9]')
- for hdr in hdrs:
- if not hdr:
- continue
- _hdr = Split(hdr)
- if autoconf.CheckCHeader(_hdr):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_' + p.sub('_', _hdr[-1].upper()) ])
-
-def checkFuncs(autoconf, funcs):
- p = re.compile('[^A-Z0-9]')
- for func in funcs:
- if autoconf.CheckFunc(func):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_' + p.sub('_', func.upper()) ])
-
-def checkTypes(autoconf, types):
- p = re.compile('[^A-Z0-9]')
- for type in types:
- if autoconf.CheckType(type, '#include <sys/types.h>'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_' + p.sub('_', type.upper()) ])
-
-def checkProgram(env, withname, progname):
- withname = 'with_' + withname
- binpath = None
-
- if env[withname] != 1:
- binpath = env[withname]
- else:
- prog = env.Detect(progname)
- if prog:
- binpath = env.WhereIs(prog)
-
- if binpath:
- mode = os.stat(binpath)[ST_MODE]
- if S_ISDIR(mode):
- print >> sys.stderr, "* error: path `%s' is a directory" % (binpath)
- env.Exit(-1)
- if not S_ISREG(mode):
- print >> sys.stderr, "* error: path `%s' is not a file or not exists" % (binpath)
- env.Exit(-1)
-
- if not binpath:
- print >> sys.stderr, "* error: can't find program `%s'" % (progname)
- env.Exit(-1)
-
- return binpath
-
-def checkStructMember(context):
- struct_member = """
-#include <time.h>
-int main() {
- struct tm a;
- a.tm_gmtoff = 0;
- return 0;
-}
-"""
- context.Message('Checking for tm_gmtoff in struct tm...')
- result = context.TryLink(struct_member, '.c')
- context.Result(result)
-
- return result
-
-
-BuildDir('build', 'src', duplicate = 0)
-
-opts = Options('config.py')
-opts.AddOptions(
- ('prefix', 'prefix', '/usr/local'),
- ('bindir', 'binary directory', '${prefix}/bin'),
- ('sbindir', 'binary directory', '${prefix}/sbin'),
- ('libdir', 'library directory', '${prefix}/lib'),
- PackageOption('with_mysql', 'enable mysql support', 'no'),
- PackageOption('with_xml', 'enable xml support', 'no'),
- PackageOption('with_pcre', 'enable pcre support', 'yes'),
- PathOption('CC', 'path to the c-compiler', None),
- BoolOption('build_dynamic', 'enable dynamic build', 'yes'),
- BoolOption('build_static', 'enable static build', 'no'),
- BoolOption('build_fullstatic', 'enable fullstatic build', 'no'),
- BoolOption('with_sqlite3', 'enable sqlite3 support', 'no'),
- BoolOption('with_memcache', 'enable memcache support', 'no'),
- BoolOption('with_fam', 'enable FAM/gamin support', 'no'),
- BoolOption('with_openssl', 'enable memcache support', 'no'),
- BoolOption('with_gzip', 'enable gzip compression', 'no'),
- BoolOption('with_bzip2', 'enable bzip2 compression', 'no'),
- BoolOption('with_lua', 'enable lua support for mod_cml', 'no'),
- BoolOption('with_ldap', 'enable ldap auth support', 'no'))
-
-env = Environment(
- env = os.environ,
- options = opts,
- CPPPATH = Split('#build')
-)
-
-env.Help(opts.GenerateHelpText(env))
-
-if env.subst('${CC}') is not '':
- env['CC'] = env.subst('${CC}')
-
-env['package'] = package
-env['version'] = version
-if env['CC'] == 'gcc':
- ## we need x-open 6 and bsd 4.3 features
- env.Append(CCFLAGS = Split('-Wall -O2 -g -W -pedantic -Wunused -Wshadow -std=gnu99'))
-
-# cache configure checks
-if 1:
- autoconf = Configure(env, custom_tests = {'CheckStructMember': checkStructMember })
- autoconf.headerfile = "foo.h"
- checkCHeaders(autoconf, string.split("""
- arpa/inet.h
- fcntl.h
- netinet/in.h
- sys/types.h netinet/in.h
- stdlib.h
- string.h
- sys/socket.h
- sys/types.h sys/socket.h
- sys/time.h
- unistd.h
- sys/sendfile.h
- sys/uio.h
- sys/types.h sys/uio.h
- getopt.h
- sys/epoll.h
- sys/select.h
- sys/types.h sys/select.h
- poll.h
- sys/poll.h
- sys/devpoll.h
- sys/filio.h
- sys/mman.h
- sys/types.h sys/mman.h
- sys/event.h
- sys/types.h sys/event.h
- sys/port.h
- winsock2.h
- pwd.h
- sys/syslimits.h
- sys/resource.h
- sys/time.h sys/types.h sys/resource.h
- sys/un.h
- sys/types.h sys/un.h
- syslog.h
- stdint.h
- inttypes.h
- sys/prctl.h
- sys/wait.h""", "\n"))
-
- checkFuncs(autoconf, Split('fork stat lstat strftime dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
- strdup strerror strstr strtol sendfile getopt socket \
- gethostbyname poll epoll_ctl getrlimit chroot \
- getuid select signal pathconf madvise prctl\
- writev sigaction sendfile64 send_file kqueue port_create localtime_r posix_fadvise issetugid inet_pton'))
-
- checkTypes(autoconf, Split('pid_t size_t off_t'))
-
- autoconf.env.Append( LIBSQLITE3 = '', LIBXML2 = '', LIBMYSQL = '', LIBZ = '',
- LIBBZ2 = '', LIBCRYPT = '', LIBMEMCACHE = '', LIBFCGI = '', LIBPCRE = '',
- LIBLDAP = '', LIBLBER = '', LIBLUA = '', LIBLUALIB = '', LIBDL = '')
-
- if env['with_fam']:
- if autoconf.CheckLibWithHeader('fam', 'fam.h', 'C'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_FAM_H', '-DHAVE_LIBFAM' ], LIBS = 'fam')
- checkFuncs(autoconf, ['FAMNoExists']);
-
-
- if autoconf.CheckLibWithHeader('crypt', 'crypt.h', 'C'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_CRYPT_H', '-DHAVE_LIBCRYPT' ], LIBCRYPT = 'crypt')
-
- if autoconf.CheckLibWithHeader('uuid', 'uuid/uuid.h', 'C'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_UUID_UUID_H', '-DHAVE_LIBUUID' ], LIBUUID = 'uuid')
-
- if env['with_openssl']:
- if autoconf.CheckLibWithHeader('ssl', 'openssl/ssl.h', 'C'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_OPENSSL_SSL_H', '-DHAVE_LIBSSL'] , LIBS = [ 'ssl', 'crypto' ])
-
- if env['with_gzip']:
- if autoconf.CheckLibWithHeader('z', 'zlib.h', 'C'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_ZLIB_H', '-DHAVE_LIBZ' ], LIBZ = 'z')
-
- if env['with_ldap']:
- if autoconf.CheckLibWithHeader('ldap', 'ldap.h', 'C'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_LDAP_H', '-DHAVE_LIBLDAP' ], LIBLDAP = 'ldap')
- if autoconf.CheckLibWithHeader('lber', 'lber.h', 'C'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_LBER_H', '-DHAVE_LIBLBER' ], LIBLBER = 'lber')
-
- if env['with_bzip2']:
- if autoconf.CheckLibWithHeader('bz2', 'bzlib.h', 'C'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_BZLIB_H', '-DHAVE_LIBBZ2' ], LIBBZ2 = 'bz2')
-
- if env['with_memcache']:
- if autoconf.CheckLibWithHeader('memcache', 'memcache.h', 'C'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_MEMCACHE_H', '-DHAVE_LIBMEMCACHE' ], LIBMEMCACHE = 'memcache')
-
- if env['with_sqlite3']:
- if autoconf.CheckLibWithHeader('sqlite3', 'sqlite3.h', 'C'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_SQLITE3_H', '-DHAVE_LIBSQLITE3' ], LIBSQLITE3 = 'sqlite3')
-
- ol = env['LIBS']
- if autoconf.CheckLibWithHeader('fcgi', 'fastcgi.h', 'C'):
- autoconf.env.Append(LIBFCGI = 'fcgi')
- env['LIBS'] = ol
-
- ol = env['LIBS']
- if autoconf.CheckLibWithHeader('dl', 'dlfcn.h', 'C'):
- autoconf.env.Append(LIBDL = 'dl')
- env['LIBS'] = ol
-
- if autoconf.CheckType('socklen_t', '#include <unistd.h>\n#include <sys/socket.h>\n#include <sys/types.h>'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_SOCKLEN_T' ])
-
- if autoconf.CheckType('struct sockaddr_storage', '#include <sys/socket.h>\n'):
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_STRUCT_SOCKADDR_STORAGE' ])
-
- if autoconf.CheckStructMember():
- autoconf.env.Append(CPPFLAGS = [ '-DHAVE_STRUCT_TM_GMTOFF' ])
-
- env = autoconf.Finish()
-
- if env['with_lua']:
- oldlibs = env['LIBS']
- env.ParseConfig("pkg-config 'lua >= 5.0' --cflags --libs")
- lualibs = env['LIBS'][len(oldlibs):]
- env.Append(LIBLUA = lualibs)
- env.Append(CPPFLAGS = [ '-DHAVE_LUA_H' ])
- env['LIBS'] = oldlibs
-
-
-if env['with_pcre']:
- pcre_config = checkProgram(env, 'pcre', 'pcre-config')
- env.ParseConfig(pcre_config + ' --cflags --libs')
- env.Append(CPPFLAGS = [ '-DHAVE_PCRE_H', '-DHAVE_LIBPCRE' ], LIBPCRE = 'pcre')
-
-if env['with_xml']:
- xml2_config = checkProgram(env, 'xml', 'xml2-config')
- oldlib = env['LIBS']
- env['LIBS'] = []
- env.ParseConfig(xml2_config + ' --cflags --libs')
- env.Append(CPPFLAGS = [ '-DHAVE_LIBXML_H', '-DHAVE_LIBXML2' ], LIBXML2 = env['LIBS'])
- env['LIBS'] = oldlib
-
-if env['with_mysql']:
- mysql_config = checkProgram(env, 'mysql', 'mysql_config')
- oldlib = env['LIBS']
- env['LIBS'] = []
- env.ParseConfig(mysql_config + ' --cflags --libs')
- env.Append(CPPFLAGS = [ '-DHAVE_MYSQL_H', '-DHAVE_LIBMYSQL' ], LIBMYSQL = 'mysqlclient')
- env['LIBS'] = oldlib
-
-if re.compile("cygwin|mingw").search(env['PLATFORM']):
- env.Append(COMMON_LIB = 'bin')
-elif re.compile("darwin|aix").search(env['PLATFORM']):
- env.Append(COMMON_LIB = 'lib')
-else:
- env.Append(COMMON_LIB = False)
-
-versions = string.split(version, '.')
-version_id = int(versions[0]) << 16 | int(versions[1]) << 8 | int(versions[2])
-env.Append(CPPFLAGS = [
- '-DLIGHTTPD_VERSION_ID=' + str(version_id),
- '-DPACKAGE_NAME=\\"' + package + '\\"',
- '-DPACKAGE_VERSION=\\"' + version + '\\"',
- '-DLIBRARY_DIR="\\"${libdir}\\""',
- '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_LARGE_FILES'
- ] )
-
-SConscript( 'src/SConscript', 'env', build_dir = 'build', duplicate = 0)
-SConscript( 'tests/SConscript', 'env' )
diff --git a/aclocal.m4 b/aclocal.m4
index b0e811a..b2f7550 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,8 +1,7 @@
-# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
+# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
-# Inc.
+# 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -12,18 +11,4074 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
-
-# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-# serial 1 (pkg-config-0.24)
-#
-# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+
+# serial 47 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+ [],
+ [m4_define([AC_PROVIDE_IFELSE],
+ [m4_ifdef([AC_PROVIDE_$1],
+ [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+ AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [AC_LIBTOOL_CXX],
+ [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+ ])])
+dnl And a similar setup for Fortran 77 support
+ AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [AC_LIBTOOL_F77],
+ [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [ifdef([AC_PROG_GCJ],
+ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([A][M_PROG_GCJ],
+ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([LT_AC_PROG_GCJ],
+ [define([LT_AC_PROG_GCJ],
+ defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ AC_PATH_MAGIC
+ fi
+ ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+ [AC_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+AC_DEFUN([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_LINKER_BOILERPLATE
+
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+[$]*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+ echo_test_string="`eval $cmd`" &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+ ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+ $SED '/^$/d' conftest.err >conftest.er2
+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ ifelse([$5], , :, [$5])
+else
+ ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
+ $SED '/^$/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ ifelse([$4], , :, [$4])
+else
+ ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ *)
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+ = "XX$teststring") >/dev/null 2>&1 &&
+ new_result=`expr "X$teststring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}]
+EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_unknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+ $SED '/^$/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
+ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_AC_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # find out which ABI we are using
+ libsuff=
+ case "$host_cpu" in
+ x86_64*|s390x*|powerpc64*)
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *64-bit*)
+ libsuff=64
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+ [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+ [include additional configurations @<:@automatic@:>@])],
+ [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ AC_MSG_WARN([output file `$ofile' does not exist])
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+ else
+ AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+ fi
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+ "") ;;
+ *) AC_MSG_ERROR([invalid tag name: $tagname])
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ AC_MSG_ERROR([tag name \"$tagname\" already exists])
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_LIBTOOL_LANG_CXX_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+ AC_LIBTOOL_LANG_F77_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+ AC_LIBTOOL_LANG_GCJ_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ RC)
+ AC_LIBTOOL_LANG_RC_CONFIG
+ ;;
+
+ *)
+ AC_MSG_ERROR([Unsupported tag name: $tagname])
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
+ fi
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+ AC_MSG_ERROR([unable to update list of available tagged configurations.])
+ fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 dll's
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+ [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+ [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+ [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+ [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="ifelse([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+ [AC_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | kfreebsd*-gnu | dragonfly*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case "$host_cpu" in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+nto-qnx*)
+ lt_cv_deplibs_check_method=unknown
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+])# AC_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
+# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!). If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ case $enable_ltdl_convenience in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments. Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
+# DIRECTORY is not provided and an installed libltdl is not found, it is
+# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/'
+# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
+# quotes!). If your package is not flat and you're not using automake,
+# define top_builddir and top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_CHECK_LIB(ltdl, lt_dlinit,
+ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+ [if test x"$enable_ltdl_install" = xno; then
+ AC_MSG_WARN([libltdl not installed, but installation disabled])
+ else
+ enable_ltdl_install=yes
+ fi
+ ])
+ if test x"$enable_ltdl_install" = x"yes"; then
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ else
+ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+ LIBLTDL="-lltdl"
+ LTDLINCL=
+ fi
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+# _LT_AC_PROG_CXXCPP
+# ---------------
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
+[
+AC_REQUIRE([AC_PROG_CXX])
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+fi
+])# _LT_AC_PROG_CXXCPP
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+ [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+ [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+ [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+ case $host_os in
+ sco3.2v5*)
+ _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+ ;;
+ esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+ AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+ if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then :
+ else
+ AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+ _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+ fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+ $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+ [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4* | aix5*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ AC_PROG_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GXX" = yes ; then
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ freebsd-elf*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ ia64*|hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc*)
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC*)
+ # Portland Group C++ compiler
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ esac
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ openbsd*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd='echo'
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+ $rm $lib.exp'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ sco*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The C++ compiler is used as linker so we must use $wl
+ # flag to pass the commands to the underlying system
+ # linker. We must also pass each convience library through
+ # to the system linker between allextract/defaultextract.
+ # The C++ compiler will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ fi
+ ;;
+ esac
+ ;;
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+ _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+ _LT_AC_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+ _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$rm -f confest.$objext
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=" program t\n end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+aix4* | aix5*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars. Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ _LT_AC_TAGVAR(compiler, $1) \
+ _LT_AC_TAGVAR(CC, $1) \
+ _LT_AC_TAGVAR(LD, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+ _LT_AC_TAGVAR(old_archive_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+ _LT_AC_TAGVAR(predep_objects, $1) \
+ _LT_AC_TAGVAR(postdep_objects, $1) \
+ _LT_AC_TAGVAR(predeps, $1) \
+ _LT_AC_TAGVAR(postdeps, $1) \
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+ _LT_AC_TAGVAR(archive_cmds, $1) \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(postinstall_cmds, $1) \
+ _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+ _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+ _LT_AC_TAGVAR(no_undefined_flag, $1) \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+ _LT_AC_TAGVAR(hardcode_automatic, $1) \
+ _LT_AC_TAGVAR(module_cmds, $1) \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+ _LT_AC_TAGVAR(exclude_expsyms, $1) \
+ _LT_AC_TAGVAR(include_expsyms, $1); do
+
+ case $var in
+ _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(module_cmds, $1) | \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\[$]0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+ ;;
+ esac
+
+ifelse([$1], [],
+ [cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ AC_MSG_NOTICE([creating $ofile])],
+ [cfgfile="$ofile"])
+
+ cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -37,198 +4092,2170 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
-AC_DEFUN([PKG_PROG_PKG_CONFIG],
-[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
-m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
-AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
-AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
- AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
+ esac
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+])
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
fi
-if test -n "$PKG_CONFIG"; then
- _pkg_min_version=m4_default([$1], [0.9.0])
- AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
- AC_MSG_RESULT([yes])
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+linux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDGIRSTW]]'
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris* | sysv5*)
+ symcode='[[BDRT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+ cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
else
- AC_MSG_RESULT([no])
- PKG_CONFIG=""
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
fi
-fi[]dnl
-])# PKG_PROG_PKG_CONFIG
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -f conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | os2* | pw32*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix4* | aix5*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ icpc* | ecpc*)
+ # Intel C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC*)
+ # Portland Group C++ compiler.
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ sco*)
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ unixware*)
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ linux*)
+ case $cc_basename in
+ icc* | ecc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgcc* | pgf77* | pgf90*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ ccc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ unicos*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
-# Check to see whether a particular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+# Check to make sure the PIC flag actually works.
#
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurence in configure.ac, so if the first place
-# it's called might be skipped (such as if it is within an "if", you
-# have to call PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_EXISTS],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-if test -n "$PKG_CONFIG" && \
- AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
- m4_default([$2], [:])
-m4_ifvaln([$3], [else
- $3])dnl
-fi])
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+ [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+])
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
-m4_define([_PKG_CONFIG],
-[if test -n "$$1"; then
- pkg_cv_[]$1="$$1"
- elif test -n "$PKG_CONFIG"; then
- PKG_CHECK_EXISTS([$3],
- [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes ],
- [pkg_failed=yes])
- else
- pkg_failed=untried
-fi[]dnl
-])# _PKG_CONFIG
-
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
-AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix4* | aix5*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+],[
+ runpath_var=
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)=
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+ _LT_AC_TAGVAR(module_cmds, $1)=
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_AC_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+ # Just being paranoid about ensuring that cc_basename is set.
+ _LT_CC_BASENAME([$compiler])
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ linux*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ tmp_addflag=
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ ;;
+ pgf77* | pgf90* ) # Portland Group f77 and f90 compilers
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_addflag=' -fpic -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test $supports_anon_versioning = yes; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ $echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ # see comment about different semantics on the GNU ld section
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ bsdi[[45]]*)
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ darwin* | rhapsody*)
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ openbsd*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ sco3.2v5*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ wlarc=''
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl, iff we do not link with $LD.
+ # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ case $wlarc in
+ '')
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+ *)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ esac ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv5*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_AC_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+ then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+ ;;
+ esac
+ fi
+ ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
#
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_MODULES],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
-AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+# __hDllInstance_base = hInst;
+# return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)
+])
-pkg_failed=no
-AC_MSG_CHECKING([for $1])
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
-_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
-_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_MSG_RESULT([$SED])
+])
-m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
-and $1[]_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.])
-if test $pkg_failed = yes; then
- AC_MSG_RESULT([no])
- _PKG_SHORT_ERRORS_SUPPORTED
- if test $_pkg_short_errors_supported = yes; then
- $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
- else
- $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
+dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
+dnl also defines GSTUFF_PKG_ERRORS on error
+AC_DEFUN([PKG_CHECK_MODULES], [
+ succeeded=no
- m4_default([$4], [AC_MSG_ERROR(
-[Package requirements ($2) were not met:
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
-$$1_PKG_ERRORS
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ AC_MSG_CHECKING(for $2)
+
+ if $PKG_CONFIG --exists "$2" ; then
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+
+ AC_MSG_CHECKING($1_CFLAGS)
+ $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
+ AC_MSG_RESULT($$1_CFLAGS)
+
+ AC_MSG_CHECKING($1_LIBS)
+ $1_LIBS=`$PKG_CONFIG --libs "$2"`
+ AC_MSG_RESULT($$1_LIBS)
+ else
+ $1_CFLAGS=""
+ $1_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+ ifelse([$4], ,echo $$1_PKG_ERRORS,)
+ fi
+
+ AC_SUBST($1_CFLAGS)
+ AC_SUBST($1_LIBS)
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
+ if test $succeeded = yes; then
+ ifelse([$3], , :, [$3])
+ else
+ ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
+ fi
+])
-_PKG_TEXT])[]dnl
- ])
-elif test $pkg_failed = untried; then
- AC_MSG_RESULT([no])
- m4_default([$4], [AC_MSG_FAILURE(
-[The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-_PKG_TEXT
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
- ])
-else
- $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
- $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
- AC_MSG_RESULT([yes])
- $3
-fi[]dnl
-])# PKG_CHECK_MODULES
-
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.3], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.3])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+ [AM_AUTOMAKE_VERSION([1.9.5])])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
@@ -276,14 +6303,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 9
+# serial 7
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
@@ -292,11 +6319,8 @@ AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='#'
@@ -310,14 +6334,15 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010, 2011 Free Software Foundation, Inc.
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 12
+# serial 8
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
@@ -345,7 +6370,6 @@ AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], UPC, [depcc="$UPC" am_compiler_list=],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
@@ -357,7 +6381,6 @@ AC_CACHE_CHECK([dependency style of $depcc],
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
- rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
@@ -375,16 +6398,6 @@ AC_CACHE_CHECK([dependency style of $depcc],
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
- am__universal=false
- m4_case([$1], [CC],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac],
- [CXX],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac])
-
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
@@ -402,17 +6415,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
@@ -422,23 +6425,18 @@ AC_CACHE_CHECK([dependency style of $depcc],
break
fi
;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
none) break ;;
esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
@@ -487,79 +6485,63 @@ AC_DEFUN([AM_DEP_TRACK],
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
- am__nodep='_no'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
+AC_SUBST([AMDEPBACKSLASH])
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-#serial 5
+#serial 3
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
done
-}
+done
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@@ -578,14 +6560,14 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 16
+# serial 12
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
@@ -602,20 +6584,16 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.58])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
# test whether we have cygpath
@@ -635,9 +6613,6 @@ m4_ifval([$2],
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
@@ -653,8 +6628,8 @@ AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
-AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
@@ -662,37 +6637,20 @@ AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
-AC_CONFIG_COMMANDS_PRE(dnl
-[m4_provide_if([_AM_COMPILER_EXEEXT],
- [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
])
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
-dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
-dnl mangled by Autoconf and run in a shell conditional statement.
-m4_define([_AC_COMPILER_EXEEXT],
-m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
@@ -703,40 +6661,29 @@ m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
-_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
- $_am_arg | $_am_arg:* )
+ $1 | $1:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
@@ -760,9 +6707,11 @@ fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
-# Check to see how 'make' treats includes. -*- Autoconf -*-
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
-# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -770,6 +6719,33 @@ AC_SUBST([am__leading_dot])])
# serial 4
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
@@ -777,7 +6753,7 @@ AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
- @echo this is the am__doit target
+ @echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
@@ -787,24 +6763,24 @@ am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
@@ -812,51 +6788,16 @@ AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
-# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 6
-
-# AM_PROG_CC_C_O
-# --------------
-# Like AC_PROG_CC_C_O, but changed for automake.
-AC_DEFUN([AM_PROG_CC_C_O],
-[AC_REQUIRE([AC_PROG_CC_C_O])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-dnl Make sure AC_PROG_CC is never called again, or it will override our
-dnl setting of CC.
-m4_define([AC_PROG_CC],
- [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
-])
-
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 6
+# serial 4
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
@@ -872,15 +6813,7 @@ AC_SUBST($1)])
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([missing])dnl
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
@@ -890,45 +6823,78 @@ else
fi
])
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# AM_PROG_MKDIR_P
# ---------------
-# Check for `mkdir -p'.
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake. There are at least two reasons why we must not
+# use `-m 0755':
+# - it causes special bits like SGID to be ignored,
+# - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out. Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
- [[\\/$]]* | ?:[[\\/]]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+AC_SUBST([mkdir_p])])
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
+# serial 3
# _AM_MANGLE_OPTION(NAME)
# -----------------------
@@ -936,16 +6902,16 @@ AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
-# --------------------
+# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
+# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
@@ -953,19 +6919,17 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006
+# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
+# serial 4
AC_DEFUN([AM_C_PROTOTYPES],
[AC_REQUIRE([AC_C_PROTOTYPES])
-AC_DIAGNOSE([obsolete],
- [$0: automatic de-ANSI-fication support is deprecated])
if test "$ac_cv_prog_cc_stdc" != no; then
U= ANSI2KNR=
else
@@ -973,43 +6937,23 @@ else
fi
# Ensure some checks needed by ansi2knr itself.
AC_REQUIRE([AC_HEADER_STDC])
-AC_CHECK_HEADERS([string.h])
-AC_SUBST([U])dnl
-AC_SUBST([ANSI2KNR])dnl
-_AM_SUBST_NOTMAKE([ANSI2KNR])dnl
+AC_CHECK_HEADERS(string.h)
+AC_SUBST(U)dnl
+AC_SUBST(ANSI2KNR)dnl
])
AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_RUN_LOG(COMMAND)
-# -------------------
-# Run COMMAND, save the exit status in ac_status, and log it.
-# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
-AC_DEFUN([AM_RUN_LOG],
-[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
- ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- (exit $ac_status); }])
-
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
+# serial 4
# AM_SANITY_CHECK
# ---------------
@@ -1018,29 +6962,16 @@ AC_DEFUN([AM_SANITY_CHECK],
# Just in case
sleep 1
echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[[\\\"\#\$\&\'\`$am_lf]]*)
- AC_MSG_ERROR([unsafe absolute working directory name]);;
-esac
-case $srcdir in
- *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
-esac
-
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
+ set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
@@ -1065,71 +6996,12 @@ Check your system clock])
fi
AC_MSG_RESULT(yes)])
-# Copyright (C) 2009, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# AM_SILENT_RULES([DEFAULT])
-# --------------------------
-# Enable less verbose build rules; with the default set to DEFAULT
-# (`yes' being less verbose, `no' or empty being verbose).
-AC_DEFUN([AM_SILENT_RULES],
-[AC_ARG_ENABLE([silent-rules],
-[ --enable-silent-rules less verbose build output (undo: `make V=1')
- --disable-silent-rules verbose build output (undo: `make V=0')])
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no) AM_DEFAULT_VERBOSITY=1;;
-*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
-esac
-dnl
-dnl A few `make' implementations (e.g., NonStop OS and NextStep)
-dnl do not support nested variable expansions.
-dnl See automake bug#9928 and bug#10237.
-am_make=${MAKE-make}
-AC_CACHE_CHECK([whether $am_make supports nested variables],
- [am_cv_make_support_nested_variables],
- [if AS_ECHO([['TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
- @$(TRUE)
-.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
- am_cv_make_support_nested_variables=yes
-else
- am_cv_make_support_nested_variables=no
-fi])
-if test $am_cv_make_support_nested_variables = yes; then
- dnl Using `$V' instead of `$(V)' breaks IRIX make.
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AC_SUBST([AM_V])dnl
-AM_SUBST_NOTMAKE([AM_V])dnl
-AC_SUBST([AM_DEFAULT_V])dnl
-AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
-AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
-AM_BACKSLASH='\'
-AC_SUBST([AM_BACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
-])
-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
@@ -1149,31 +7021,12 @@ dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# _AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
-# Public sister of _AM_SUBST_NOTMAKE.
-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1195,11 +7048,10 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AC_SUBST([AMTAR], ['$${TAR-tar}'])
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
@@ -1268,8 +7120,3 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
-m4_include([m4/libtool.m4])
-m4_include([m4/ltoptions.m4])
-m4_include([m4/ltsugar.m4])
-m4_include([m4/ltversion.m4])
-m4_include([m4/lt~obsolete.m4])
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index 3bdb6b2..0000000
--- a/autogen.sh
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-
-LIBTOOLIZE_FLAGS="--copy --force"
-AUTOMAKE_FLAGS="--add-missing --copy --foreign"
-
-ARGV0=$0
-ARGS="$@"
-
-
-run() {
- echo "$ARGV0: running \`$@' $ARGS"
- $@ $ARGS
-}
-
-## jump out if one of the programs returns 'false'
-set -e
-
-## on macosx glibtoolize, others have libtool
-if test x$LIBTOOLIZE = x; then
- if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
- LIBTOOLIZE=glibtoolize
- elif test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
- LIBTOOLIZE=libtoolize-1.5
- elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
- LIBTOOLIZE=libtoolize
- else
- echo "libtoolize 1.5.x wasn't found, exiting"; exit 0
- fi
-fi
-
-## suse has aclocal and aclocal-1.9
-if test x$ACLOCAL = x; then
- if test \! "x`which aclocal-1.9 2> /dev/null | grep -v '^no'`" = x; then
- ACLOCAL=aclocal-1.9
- elif test \! "x`which aclocal19 2> /dev/null | grep -v '^no'`" = x; then
- ACLOCAL=aclocal19
- elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then
- ACLOCAL=aclocal
- else
- echo "automake 1.9.x (aclocal) wasn't found, exiting"; exit 0
- fi
-fi
-
-if test x$AUTOMAKE = x; then
- if test \! "x`which automake-1.9 2> /dev/null | grep -v '^no'`" = x; then
- AUTOMAKE=automake-1.9
- elif test \! "x`which automake19 2> /dev/null | grep -v '^no'`" = x; then
- AUTOMAKE=automake19
- elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then
- AUTOMAKE=automake
- else
- echo "automake 1.9.x wasn't found, exiting"; exit 0
- fi
-fi
-
-
-## macosx has autoconf-2.59 and autoconf-2.60
-if test x$AUTOCONF = x; then
- if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then
- AUTOCONF=autoconf-2.59
- elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then
- AUTOCONF=autoconf259
- elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then
- AUTOCONF=autoconf
- else
- echo "autoconf 2.59+ wasn't found, exiting"; exit 0
- fi
-fi
-
-if test x$AUTOHEADER = x; then
- if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then
- AUTOHEADER=autoheader-2.59
- elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then
- AUTOHEADER=autoheader259
- elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then
- AUTOHEADER=autoheader
- else
- echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 0
- fi
-fi
-
-mkdir -p m4
-run $LIBTOOLIZE $LIBTOOLIZE_FLAGS
-run $ACLOCAL $ACLOCAL_FLAGS -I m4
-run $AUTOHEADER
-run $AUTOMAKE $AUTOMAKE_FLAGS
-run $AUTOCONF
-
-if test "$ARGS" = "" ; then
- echo "Now type './configure ...' and 'make' to compile."
-fi
diff --git a/compile b/compile
index ec64c62..9bb997a 100755
--- a/compile
+++ b/compile
@@ -1,10 +1,8 @@
#! /bin/sh
-# Wrapper for compilers which do not understand `-c -o'.
-scriptversion=2009-04-28.21; # UTC
+# Wrapper for compilers which do not understand `-c -o'.
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
-# Foundation, Inc.
+# Copyright 1999, 2000 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -18,126 +16,84 @@ scriptversion=2009-04-28.21; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-case $1 in
- '')
- echo "$0: No command. Try \`$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: compile [--help] [--version] PROGRAM [ARGS]
-
-Wrapper for compilers which do not understand `-c -o'.
-Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
-arguments, and rename the output as expected.
+# Usage:
+# compile PROGRAM [ARGS]...
+# `-o FOO.o' is removed from the args passed to the actual compile.
-If you are trying to build a whole package this is not the
-right script to run: please start by reading the file `INSTALL'.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "compile $scriptversion"
- exit $?
- ;;
-esac
+prog=$1
+shift
ofile=
cfile=
-eat=
-
-for arg
-do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as `compile cc -o foo foo.c'.
- # So we strip `-o arg' only if arg is an object.
- eat=1
- case $2 in
- *.o | *.obj)
- ofile=$2
- ;;
- *)
- set x "$@" -o "$2"
- shift
- ;;
- esac
- ;;
- *.c)
- cfile=$1
- set x "$@" "$1"
- shift
- ;;
- *)
- set x "$@" "$1"
- shift
- ;;
- esac
- fi
- shift
+args=
+while test $# -gt 0; do
+ case "$1" in
+ -o)
+ # configure might choose to run compile as `compile cc -o foo foo.c'.
+ # So we do something ugly here.
+ ofile=$2
+ shift
+ case "$ofile" in
+ *.o | *.obj)
+ ;;
+ *)
+ args="$args -o $ofile"
+ ofile=
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ args="$args $1"
+ ;;
+ *)
+ args="$args $1"
+ ;;
+ esac
+ shift
done
if test -z "$ofile" || test -z "$cfile"; then
- # If no `-o' option was seen then we might have been invoked from a
- # pattern rule where we don't need one. That is ok -- this is a
- # normal compilation that the losing compiler can handle. If no
- # `.c' file was seen then we are probably linking. That is also
- # ok.
- exec "$@"
+ # If no `-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # `.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$prog" $args
fi
# Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
# Create the lock directory.
-# Note: use `[/\\:.-]' here to ensure that we don't use the same name
+# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d
while true; do
- if mkdir "$lockdir" >/dev/null 2>&1; then
- break
- fi
- sleep 1
+ if mkdir $lockdir > /dev/null 2>&1; then
+ break
+ fi
+ sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
-trap "rmdir '$lockdir'; exit 1" 1 2 15
+trap "rmdir $lockdir; exit 1" 1 2 15
# Run the compile.
-"$@"
-ret=$?
+"$prog" $args
+status=$?
if test -f "$cofile"; then
- mv "$cofile" "$ofile"
-elif test -f "${cofile}bj"; then
- mv "${cofile}bj" "$ofile"
+ mv "$cofile" "$ofile"
fi
-rmdir "$lockdir"
-exit $ret
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
+rmdir $lockdir
+exit $status
diff --git a/config.guess b/config.guess
index e3a2116..ad5281e 100755
--- a/config.guess
+++ b/config.guess
@@ -1,10 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-# Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-timestamp='2009-06-10'
+timestamp='2005-08-03'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -56,8 +55,8 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -107,7 +106,7 @@ set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -161,7 +160,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
@@ -170,7 +168,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ELF__
+ | grep __ELF__ >/dev/null
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
@@ -208,11 +206,8 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ echo powerppc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
@@ -324,30 +319,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
- s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
- i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
- # If there is a compiler, see if it is configured for 64-bit objects.
- # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
- # This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- SUN_ARCH="x86_64"
- fi
- fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
@@ -548,7 +527,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
- *:AIX:*:[456])
+ *:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@@ -656,7 +635,7 @@ EOF
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep -q __LP64__
+ grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
@@ -785,19 +764,12 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
- *:MINGW*:*)
+ i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
@@ -807,24 +779,12 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
- *:Interix*:[3456]*)
- case ${UNAME_MACHINE} in
- x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- EM64T | authenticamd | genuineintel)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
- esac ;;
+ x86:Interix*:[34]*)
+ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+ exit ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -855,16 +815,6 @@ EOF
echo ${UNAME_MACHINE}-pc-minix
exit ;;
arm*:Linux:*:*)
- eval $set_cc_for_build
- if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_EABI__
- then
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
- fi
- exit ;;
- avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
@@ -885,27 +835,42 @@ EOF
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
- mips:Linux:*:* | mips64:Linux:*:*)
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
+ #undef mips64
+ #undef mips64el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
+ CPU=mips64el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
+ CPU=mips64
#else
CPU=
#endif
#endif
EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
@@ -927,13 +892,10 @@ EOF
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
- objdump --private-headers /bin/sh | grep -q ld.so.1
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
- padre:Linux:*:*)
- echo sparc-unknown-linux-gnu
- exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -957,15 +919,9 @@ EOF
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
- exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
- xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
@@ -981,6 +937,17 @@ EOF
elf32-i386)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
@@ -997,7 +964,7 @@ EOF
LIBC=gnulibc1
# endif
#else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ #ifdef __INTEL_COMPILER
LIBC=gnu
#else
LIBC=gnuaout
@@ -1007,11 +974,7 @@ EOF
LIBC=dietlibc
#endif
EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
test x"${LIBC}" != x && {
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit
@@ -1046,7 +1009,7 @@ EOF
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
@@ -1090,11 +1053,8 @@ EOF
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
- # Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
- # this is a cross-build.
- echo i586-pc-msdosdjgpp
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
@@ -1132,16 +1092,6 @@ EOF
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
- NCR*:*:4.2:* | MPRAS*:*:4.2:*)
- OS_REL='.3'
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
@@ -1154,7 +1104,7 @@ EOF
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
@@ -1217,9 +1167,6 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
- BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1229,15 +1176,6 @@ EOF
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
@@ -1247,6 +1185,7 @@ EOF
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
+ *86) UNAME_PROCESSOR=i686 ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1325,12 +1264,6 @@ EOF
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
- exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1491,9 +1424,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
diff --git a/config.h.in b/config.h.in
index 7501d85..4c4f7d8 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,7 +1,4 @@
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* Use mmap if available */
-#undef ENABLE_MMAP
+/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
@@ -30,18 +27,12 @@
/* Define to 1 if you have the <errmsg.h> header file. */
#undef HAVE_ERRMSG_H
-/* Define to 1 if you have the <ev.h> header file. */
-#undef HAVE_EV_H
-
/* Define to 1 if you have the `FAMNoExists' function. */
#undef HAVE_FAMNOEXISTS
/* fam.h */
#undef HAVE_FAM_H
-/* Define to 1 if you have the <fastcgi/fastcgi.h> header file. */
-#undef HAVE_FASTCGI_FASTCGI_H
-
/* Define to 1 if you have the <fastcgi.h> header file. */
#undef HAVE_FASTCGI_H
@@ -75,27 +66,18 @@
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
-/* Define to 1 if you have the `gmtime_r' function. */
-#undef HAVE_GMTIME_R
-
/* Define to 1 if you have the `inet_ntoa' function. */
#undef HAVE_INET_NTOA
/* Define to 1 if you have the `inet_ntop' function. */
#undef HAVE_INET_NTOP
-/* Define to 1 if you have the `inet_pton' function. */
-#undef HAVE_INET_PTON
-
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Whether to enable IPv6 support */
#undef HAVE_IPV6
-/* Define to 1 if you have the `issetugid' function. */
-#undef HAVE_ISSETUGID
-
/* Define to 1 if you have the `kqueue' function. */
#undef HAVE_KQUEUE
@@ -114,9 +96,6 @@
/* libdl */
#undef HAVE_LIBDL
-/* libev support */
-#undef HAVE_LIBEV
-
/* libfam */
#undef HAVE_LIBFAM
@@ -144,9 +123,6 @@
/* Define to 1 if you have the `localtime_r' function. */
#undef HAVE_LOCALTIME_R
-/* Define to 1 if you have the `lstat' function. */
-#undef HAVE_LSTAT
-
/* liblua */
#undef HAVE_LUA
@@ -189,7 +165,7 @@
/* Define to 1 if you have the `pathconf' function. */
#undef HAVE_PATHCONF
-/* pcre.h */
+/* Define to 1 if you have the <pcre.h> header file. */
#undef HAVE_PCRE_H
/* Define to 1 if you have the `poll' function. */
@@ -201,15 +177,6 @@
/* Define to 1 if you have the `port_create' function. */
#undef HAVE_PORT_CREATE
-/* Define to 1 if you have the <port.h> header file. */
-#undef HAVE_PORT_H
-
-/* Define to 1 if you have the `posix_fadvise' function. */
-#undef HAVE_POSIX_FADVISE
-
-/* Define to 1 if you have the `posix_madvise' function. */
-#undef HAVE_POSIX_MADVISE
-
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
@@ -237,6 +204,9 @@
/* Define to 1 if you have the `signal' function. */
#undef HAVE_SIGNAL
+/* Define to 1 if you have the `sigtimedwait' function. */
+#undef HAVE_SIGTIMEDWAIT
+
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
@@ -310,8 +280,8 @@
/* Define to 1 if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H
-/* Define to 1 if you have the <sys/prctl.h> header file. */
-#undef HAVE_SYS_PRCTL_H
+/* Define to 1 if you have the <sys/port.h> header file. */
+#undef HAVE_SYS_PORT_H
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
@@ -349,15 +319,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* libuuid */
-#undef HAVE_UUID
-
-/* uuid/uuid.h is available */
-#undef HAVE_UUID_H
-
-/* Define to 1 if you have the <uuid/uuid.h> header file. */
-#undef HAVE_UUID_UUID_H
-
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
#undef HAVE_VALGRIND_VALGRIND_H
@@ -382,9 +343,6 @@
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
-/* Using deprecated ldap api */
-#undef LDAP_DEPRECATED
-
/* lighttpd-version-id */
#undef LIGHTTPD_VERSION_ID
@@ -392,13 +350,6 @@
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#undef LT_OBJDIR
-
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
/* Name of package */
#undef PACKAGE
@@ -414,9 +365,6 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
/* Define to the version of this package. */
#undef PACKAGE_VERSION
@@ -426,39 +374,24 @@
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
-/* The size of `long', as computed by sizeof. */
+/* The size of a `long', as computed by sizeof. */
#undef SIZEOF_LONG
-/* The size of `off_t', as computed by sizeof. */
+/* The size of a `off_t', as computed by sizeof. */
#undef SIZEOF_OFF_T
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Enable extensions on AIX 3, Interix. */
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris. */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop. */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
-/* Version number of package */
-#undef VERSION
/* Define to 1 if on MINIX. */
#undef _MINIX
@@ -487,13 +420,13 @@
#undef inline
#endif
-/* Define to `long int' if <sys/types.h> does not define. */
+/* Define to `long' if <sys/types.h> does not define. */
#undef off_t
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
-/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
/* Define as `fork' if `vfork' does not work. */
diff --git a/config.sub b/config.sub
index eb0389a..1c366df 100755
--- a/config.sub
+++ b/config.sub
@@ -1,10 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-# Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-timestamp='2009-06-11'
+timestamp='2005-07-08'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -72,8 +71,8 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -120,10 +119,8 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -153,9 +150,6 @@ case $os in
os=
basic_machine=$1
;;
- -bluegene*)
- os=-cnk
- ;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
@@ -177,10 +171,6 @@ case $os in
-hiux*)
os=-hiuxwe2
;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -197,10 +187,6 @@ case $os in
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -245,24 +231,20 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
- | fido | fr30 | frv \
+ | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \
+ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
@@ -275,26 +257,26 @@ case $basic_machine in
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
- | moxie \
- | mt \
+ | ms1 \
| msp430 \
- | nios | nios2 \
| ns16k | ns32k \
| or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
+ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b \
+ | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k | z80)
+ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m32c)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
@@ -304,9 +286,6 @@ case $basic_machine in
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
- ms1)
- basic_machine=mt-unknown
- ;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
@@ -326,28 +305,25 @@ case $basic_machine in
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
+ | avr-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
+ | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
@@ -360,33 +336,30 @@ case $basic_machine in
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
- | mt-* \
+ | ms1-* \
| msp430-* \
- | nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
| sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa*-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa-* \
| ymp-* \
- | z8k-* | z80-*)
+ | z8k-*)
;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
+ m32c-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -450,10 +423,6 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-bsd
;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -462,26 +431,10 @@ case $basic_machine in
basic_machine=ns32k-sequent
os=-dynix
;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
c90)
basic_machine=c90-cray
os=-unicos
;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
convex-c1)
basic_machine=c1-convex
os=-bsd
@@ -510,8 +463,8 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
- cr16)
- basic_machine=cr16-unknown
+ cr16c)
+ basic_machine=cr16c-unknown
os=-elf
;;
crds | unos)
@@ -549,10 +502,6 @@ case $basic_machine in
basic_machine=m88k-motorola
os=-sysv3
;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
@@ -707,14 +656,6 @@ case $basic_machine in
basic_machine=m68k-isi
os=-sysv
;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
m88k-omron*)
basic_machine=m88k-omron
;;
@@ -730,10 +671,6 @@ case $basic_machine in
basic_machine=i386-pc
os=-mingw32
;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
miniframe)
basic_machine=m68000-convergent
;;
@@ -759,9 +696,6 @@ case $basic_machine in
basic_machine=i386-pc
os=-msdos
;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
mvs)
basic_machine=i370-ibm
os=-mvs
@@ -860,14 +794,6 @@ case $basic_machine in
basic_machine=i860-intel
os=-osf
;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
pbd)
basic_machine=sparc-tti
;;
@@ -877,12 +803,6 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
@@ -939,10 +859,6 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
- rdos)
- basic_machine=i386-pc
- os=-rdos
- ;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@@ -969,10 +885,6 @@ case $basic_machine in
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
sei)
basic_machine=mips-sei
os=-seiux
@@ -984,9 +896,6 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
sh64)
basic_machine=sh64-unknown
;;
@@ -1076,10 +985,6 @@ case $basic_machine in
basic_machine=tic6x-unknown
os=-coff
;;
- tile*)
- basic_machine=tile-unknown
- os=-linux-gnu
- ;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -1155,10 +1060,6 @@ case $basic_machine in
basic_machine=z8k-unknown
os=-sim
;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
- ;;
none)
basic_machine=none-none
os=-none
@@ -1197,10 +1098,10 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ sparc | sparcv8 | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
@@ -1267,30 +1168,27 @@ case $os in
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
+ | -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ | -skyos* | -haiku*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1420,9 +1318,6 @@ case $os in
-zvmoe)
os=-zvmoe
;;
- -dicos*)
- os=-dicos
- ;;
-none)
;;
*)
@@ -1445,12 +1340,6 @@ else
# system, and we'll never get to this point.
case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
*-acorn)
os=-riscix1.2
;;
@@ -1460,9 +1349,9 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
@@ -1488,9 +1377,6 @@ case $basic_machine in
m68*-cisco)
os=-aout
;;
- mep-*)
- os=-elf
- ;;
mips*-cisco)
os=-elf
;;
@@ -1620,7 +1506,7 @@ case $basic_machine in
-sunos*)
vendor=sun
;;
- -cnk*|-aix*)
+ -aix*)
vendor=ibm
;;
-beos*)
diff --git a/configure b/configure
index 85d1b79..b80e6f5 100755
--- a/configure
+++ b/configure
@@ -1,470 +1,83 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for lighttpd 1.4.31.
-#
-# Report bugs to <contact@lighttpd.net>.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+# Generated by GNU Autoconf 2.59 for lighttpd 1.4.8.
#
+# Report bugs to <jan@kneschke.de>.
#
+# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
- # into an infinite loop, continuously re-executing ourselves.
- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
- _as_can_reexec=no; export _as_can_reexec;
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
- fi
- # We don't want this to propagate to other subprocesses.
- { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1
-
- test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
- ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
- ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
- ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
- PATH=/empty FPATH=/empty; export PATH FPATH
- test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
- || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- export CONFIG_SHELL
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
else
- $as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: contact@lighttpd.net about your system, including any
-$0: error possibly output before this message. Then install
-$0: a modern shell, or manually run the script under such a
-$0: shell if you do have one."
+ $as_unset $as_var
fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
+done
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
else
as_expr=false
fi
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-as_me=`$as_basename -- "$0" ||
+# Name of the executable.
+as_me=`$as_basename "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -472,91 +85,146 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
t loop
- s/-\n.*//
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
- # already done that, so ensure we don't try to do so again and fall
- # in an infinite loop. This has already happened in practice.
- _as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
# Exit status is that of the last command.
exit
}
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
+ as_expr=false
fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
else
- as_ln_s='cp -pR'
+ as_ln_s='ln -s'
fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
else
- as_ln_s='cp -pR'
+ as_ln_s='cp -p'
fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
+rm -f conf$$ conf$$.exe conf$$.file
if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
+ as_mkdir_p=:
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
+as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -564,296 +232,245 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+# Check that we are running under the correct shell.
SHELL=${CONFIG_SHELL-/bin/sh}
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+ ;;
+esac
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
+echo=${ECHO-echo}
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+ echo_test_string="`eval $cmd`" &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+exec 6>&1
+
#
# Initializations.
#
ac_default_prefix=/usr/local
-ac_clean_files=
ac_config_libobj_dir=.
-LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
# Identity of this package.
PACKAGE_NAME='lighttpd'
PACKAGE_TARNAME='lighttpd'
-PACKAGE_VERSION='1.4.31'
-PACKAGE_STRING='lighttpd 1.4.31'
-PACKAGE_BUGREPORT='contact@lighttpd.net'
-PACKAGE_URL=''
+PACKAGE_VERSION='1.4.8'
+PACKAGE_STRING='lighttpd 1.4.8'
+PACKAGE_BUGREPORT='jan@kneschke.de'
ac_unique_file="src/server.c"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
+#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
-#ifdef HAVE_SYS_STAT_H
+#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
-#ifdef STDC_HEADERS
+#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
-# ifdef HAVE_STDLIB_H
+# if HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#endif
-#ifdef HAVE_STRINGS_H
+#if HAVE_STRINGS_H
# include <strings.h>
#endif
-#ifdef HAVE_INTTYPES_H
+#if HAVE_INTTYPES_H
# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
+#if HAVE_UNISTD_H
# include <unistd.h>
#endif"
-ac_subst_vars='am__EXEEXT_FALSE
-am__EXEEXT_TRUE
-LTLIBOBJS
-CHECK_WITH_FASTCGI_FALSE
-CHECK_WITH_FASTCGI_TRUE
-CROSS_COMPILING_FALSE
-CROSS_COMPILING_TRUE
-SENDFILE_LIB
-CRYPT_LIB
-LUA_LIBS
-LUA_CFLAGS
-MEMCACHE_LIB
-GDBM_LIB
-UUID_LIBS
-SQLITE_LIBS
-SQLITE_CFLAGS
-XML_LIBS
-XML_CFLAGS
-FAM_LIBS
-FAM_CFLAGS
-BZ_LIB
-Z_LIB
-PCRE_LIB
-PCRECONFIG
-SSL_LIB
-DL_LIB
-ATTR_LIB
-LBER_LIB
-LDAP_LIB
-MYSQL_INCLUDE
-MYSQL_LIBS
-MYSQL_CONFIG
-LIBEV_LIBS
-LIBEV_CFLAGS
-PKG_CONFIG_LIBDIR
-PKG_CONFIG_PATH
-PKG_CONFIG
-LIBOBJS
-OTOOL64
-OTOOL
-LIPO
-NMEDIT
-DSYMUTIL
-MANIFEST_TOOL
-RANLIB
-ac_ct_AR
-AR
-DLLTOOL
-OBJDUMP
-NM
-ac_ct_DUMPBIN
-DUMPBIN
-LIBTOOL
-ANSI2KNR
-U
-NO_RDYNAMIC_FALSE
-NO_RDYNAMIC_TRUE
-LN_S
-CPP
-LD
-FGREP
-EGREP
-GREP
-SED
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-AM_BACKSLASH
-AM_DEFAULT_VERBOSITY
-AM_DEFAULT_V
-AM_V
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-target_os
-target_vendor
-target_cpu
-target
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP CPP LN_S NO_RDYNAMIC_TRUE NO_RDYNAMIC_FALSE U ANSI2KNR ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS MYSQL_CONFIG MYSQL_LIBS MYSQL_INCLUDE LDAP_LIB LBER_LIB ATTR_LIB DL_LIB SSL_LIB PCRECONFIG PCRE_LIB Z_LIB BZ_LIB PKG_CONFIG FAM_CFLAGS FAM_LIBS XML_CFLAGS XML_LIBS SQLITE_CFLAGS SQLITE_LIBS GDBM_LIB MEMCACHE_LIB LUACONFIG LUA_CFLAGS LUA_LIBS CRYPT_LIB SENDFILE_LIB CROSS_COMPILING_TRUE CROSS_COMPILING_FALSE CHECK_WITH_FASTCGI_TRUE CHECK_WITH_FASTCGI_FALSE LTLIBOBJS'
ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_silent_rules
-enable_dependency_tracking
-with_gnu_ld
-enable_static
-enable_shared
-with_pic
-enable_fast_install
-with_sysroot
-enable_libtool_lock
-with_libev
-with_mysql
-with_ldap
-with_attr
-with_valgrind
-with_openssl
-with_openssl_includes
-with_openssl_libs
-with_kerberos5
-with_pcre
-with_zlib
-with_bzip2
-with_fam
-with_webdav_props
-with_webdav_locks
-with_gdbm
-with_memcache
-with_lua
-enable_lfs
-enable_ipv6
-enable_mmap
-enable_extra_warnings
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP
-PKG_CONFIG
-PKG_CONFIG_PATH
-PKG_CONFIG_LIBDIR
-LIBEV_CFLAGS
-LIBEV_LIBS
-FAM_CFLAGS
-FAM_LIBS
-XML_CFLAGS
-XML_LIBS
-SQLITE_CFLAGS
-SQLITE_LIBS
-LUA_CFLAGS
-LUA_LIBS'
-
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
@@ -876,49 +493,34 @@ x_libraries=NONE
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
+datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
ac_prev=
-ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
+ eval "$ac_prev=\$ac_option"
ac_prev=
continue
fi
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
# Accept the important Cygnus configure options, so we can diagnose typos.
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
+ case $ac_option in
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
@@ -940,59 +542,33 @@ do
--config-cache | -C)
cache_file=config.cache ;;
- -datadir | --datadir | --datadi | --datad)
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
datadir=$ac_optarg ;;
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
-disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
-enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
esac
- eval enable_$ac_useropt=\$ac_optarg ;;
+ eval "enable_$ac_feature='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -1019,12 +595,6 @@ do
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
@@ -1049,16 +619,13 @@ do
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
-localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -1123,16 +690,6 @@ do
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
@@ -1183,36 +740,26 @@ do
ac_init_version=: ;;
-with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
esac
- eval with_$ac_useropt=\$ac_optarg ;;
+ eval "with_$ac_package='$ac_optarg'" ;;
-without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
--x)
# Obsolete; use --with-x.
@@ -1232,26 +779,27 @@ do
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
esac
@@ -1259,36 +807,31 @@ done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
fi
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
+ eval ac_val=$`echo $ac_var`
case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
esac
- # Be sure to have absolute directory names.
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
@@ -1302,6 +845,8 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1313,72 +858,94 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
+ if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+ac_env_CXX_set=${CXX+set}
+ac_env_CXX_value=$CXX
+ac_cv_env_CXX_set=${CXX+set}
+ac_cv_env_CXX_value=$CXX
+ac_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_env_CXXFLAGS_value=$CXXFLAGS
+ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_cv_env_CXXFLAGS_value=$CXXFLAGS
+ac_env_CXXCPP_set=${CXXCPP+set}
+ac_env_CXXCPP_value=$CXXCPP
+ac_cv_env_CXXCPP_set=${CXXCPP+set}
+ac_cv_env_CXXCPP_value=$CXXCPP
+ac_env_F77_set=${F77+set}
+ac_env_F77_value=$F77
+ac_cv_env_F77_set=${F77+set}
+ac_cv_env_F77_value=$F77
+ac_env_FFLAGS_set=${FFLAGS+set}
+ac_env_FFLAGS_value=$FFLAGS
+ac_cv_env_FFLAGS_set=${FFLAGS+set}
+ac_cv_env_FFLAGS_value=$FFLAGS
#
# Report the --help message.
@@ -1387,7 +954,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures lighttpd 1.4.31 to adapt to many kinds of systems.
+\`configure' configures lighttpd 1.4.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1401,17 +968,20 @@ Configuration:
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
+ -q, --quiet, --silent do not print \`checking...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
+_ACEOF
+
+ cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
@@ -1421,25 +991,18 @@ for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/lighttpd]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
_ACEOF
cat <<\_ACEOF
@@ -1458,55 +1021,51 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of lighttpd 1.4.31:";;
+ short | recursive ) echo "Configuration of lighttpd 1.4.8:";;
esac
cat <<\_ACEOF
Optional Features:
- --disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-silent-rules less verbose build output (undo: `make V=1')
- --disable-silent-rules verbose build output (undo: `make V=0')
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
- --enable-static[=PKGS] build static libraries [default=no]
- --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-static[=PKGS]
+ build static libraries [default=no]
+ --enable-shared[=PKGS]
+ build shared libraries [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-lfs Turn on Large File System (default)
--disable-ipv6 disable IPv6 support
- --enable-mmap use mmap if available (DANGEROUS, allows local users
- to trigger SIGBUS crashes)
- --enable-extra-warnings enable extra warnings (gcc specific)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
- --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
+ --with-pic try to use only PIC/non-PIC objects [default=use
both]
- --with-sysroot=DIR Search for dependent libraries within DIR
- (or the compiler's sysroot if not specified).
- --with-libev[=PATH] Include libev support for fdevent handlers in
- PATH/include and PATH/lib
- --with-mysql[=PATH] Include MySQL support. PATH is the path to
+ --with-tags[=TAGS]
+ include additional configurations [automatic]
+ --with-mysql[=PATH]
+ Include MySQL support. PATH is the path to
'mysql_config'
--with-ldap enable LDAP support
--with-attr enable extended attribute support
--with-valgrind enable internal support for valgrind
- --with-openssl[=DIR] Include openssl support (default no)
+ --with-openssl[=DIR]
+ Include openssl support (default no)
--with-openssl-includes=DIR
OpenSSL includes
--with-openssl-libs=DIR OpenSSL libraries
--with-kerberos5 use Kerberos5 support with OpenSSL
--with-pcre Enable pcre support (default yes)
- --with-zlib Enable zlib support for mod_compress
--with-bzip2 Enable bzip2 support for mod_compress
--with-fam fam/gamin for reducing number of stat() calls
--with-webdav-props properties in mod_webdav
- --with-webdav-locks locks in mod_webdav
--with-gdbm gdbm storage for mod_trigger_b4_dl
--with-memcache memcached storage for mod_trigger_b4_dl
--with-lua lua engine for mod_cml
@@ -1516,764 +1075,134 @@ Some influential environment variables:
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
CPP C preprocessor
- PKG_CONFIG path to pkg-config utility
- PKG_CONFIG_PATH
- directories to add to pkg-config's search path
- PKG_CONFIG_LIBDIR
- path overriding pkg-config's built-in search path
- LIBEV_CFLAGS
- C compiler flags for LIBEV, overriding pkg-config
- LIBEV_LIBS linker flags for LIBEV, overriding pkg-config
- FAM_CFLAGS C compiler flags for FAM, overriding pkg-config
- FAM_LIBS linker flags for FAM, overriding pkg-config
- XML_CFLAGS C compiler flags for XML, overriding pkg-config
- XML_LIBS linker flags for XML, overriding pkg-config
- SQLITE_CFLAGS
- C compiler flags for SQLITE, overriding pkg-config
- SQLITE_LIBS linker flags for SQLITE, overriding pkg-config
- LUA_CFLAGS C compiler flags for LUA, overriding pkg-config
- LUA_LIBS linker flags for LUA, overriding pkg-config
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ CXXCPP C++ preprocessor
+ F77 Fortran 77 compiler command
+ FFLAGS Fortran 77 compiler flags
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
-Report bugs to <contact@lighttpd.net>.
+Report bugs to <jan@kneschke.de>.
_ACEOF
-ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
+ test -d $ac_dir || continue
ac_builddir=.
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
case $srcdir in
- .) # We are building in place.
+ .) # No --srcdir option. We are building in place.
ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-lighttpd configure 1.4.31
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## ----------------------------------- ##
-## Report this to contact@lighttpd.net ##
-## ----------------------------------- ##"
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=no"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-if (sizeof ($2))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_type
-
-# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
-# ----------------------------------------------------
-# Tries to find if the field MEMBER exists in type AGGR, after including
-# INCLUDES, setting cache variable VAR accordingly.
-ac_fn_c_check_member ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
-$as_echo_n "checking for $2.$3... " >&6; }
-if eval \${$4+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$5
-int
-main ()
-{
-static $2 ac_aggr;
-if (ac_aggr.$3)
-return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$4=yes"
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$5
-int
-main ()
-{
-static $2 ac_aggr;
-if (sizeof ac_aggr.$3)
-return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$4=yes"
-else
- eval "$4=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$4
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_member
-
-# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
-# --------------------------------------------
-# Tries to find the compile-time value of EXPR in a program that includes
-# INCLUDES, setting VAR accordingly. Returns whether the value could be
-# computed
-ac_fn_c_compute_int ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_lo=0 ac_mid=0
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_hi=$ac_mid; break
-else
- as_fn_arith $ac_mid + 1 && ac_lo=$as_val
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_hi=-1 ac_mid=-1
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_lo=$ac_mid; break
-else
- as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
done
-else
- ac_lo= ac_hi=
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_hi=$ac_mid
-else
- as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in #((
-?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
-'') ac_retval=1 ;;
-esac
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-static long int longval () { return $2; }
-static unsigned long int ulongval () { return $2; }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (($2) < 0)
- {
- long int i = longval ();
- if (i != ($2))
- return 1;
- fprintf (f, "%ld", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ($2))
- return 1;
- fprintf (f, "%lu", i);
- }
- /* Do not output a trailing newline, as this causes \r\n confusion
- on some platforms. */
- return ferror (f) || fclose (f) != 0;
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+lighttpd configure 1.4.8
+generated by GNU Autoconf 2.59
- ;
- return 0;
-}
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- echo >>conftest.val; read $3 <conftest.val; ac_retval=0
-else
- ac_retval=1
+ exit 0
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-rm -f conftest.val
-
- fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_compute_int
-cat >config.log <<_ACEOF
+exec 5>config.log
+cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by lighttpd $as_me 1.4.31, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+It was created by lighttpd $as_me 1.4.8, which was
+generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
_ACEOF
-exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
@@ -2292,7 +1221,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
@@ -2304,9 +1233,8 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
+ echo "PATH: $as_dir"
+done
} >&5
@@ -2328,6 +1256,7 @@ _ACEOF
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
+ac_sep=
ac_must_keep_next=false
for ac_pass in 1 2
do
@@ -2338,13 +1267,13 @@ do
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
@@ -2360,115 +1289,104 @@ do
-* ) ac_must_keep_next=true ;;
esac
fi
- as_fn_append ac_configure_args " '$ac_arg'"
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
;;
esac
done
done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
{
echo
- $as_echo "## ---------------- ##
+ cat <<\_ASBOX
+## ---------------- ##
## Cache variables. ##
-## ---------------- ##"
+## ---------------- ##
+_ASBOX
echo
# The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
+{
(set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
*)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
- esac |
- sort
-)
+ esac;
+}
echo
- $as_echo "## ----------------- ##
+ cat <<\_ASBOX
+## ----------------- ##
## Output variables. ##
-## ----------------- ##"
+## ----------------- ##
+_ASBOX
echo
for ac_var in $ac_subst_vars
do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
done | sort
echo
if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
echo
for ac_var in $ac_subst_files
do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
done | sort
echo
fi
if test -s confdefs.h; then
- $as_echo "## ----------- ##
+ cat <<\_ASBOX
+## ----------- ##
## confdefs.h. ##
-## ----------- ##"
+## ----------- ##
+_ASBOX
echo
- cat confdefs.h
+ sed "/^$/d" confdefs.h | sort
echo
fi
test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
} >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
-' 0
+ ' 0
for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
# Predefined preprocessor variables.
@@ -2476,137 +1394,112 @@ cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF
+
cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF
+
cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF
+
cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF
# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
+ . "$ac_site_file"
fi
done
if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
esac
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
case $ac_old_set,$ac_new_set in
set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -2616,141 +1509,131 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-ac_config_headers="$ac_config_headers config.h"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
- elif test -f "$ac_dir/install.sh"; then
+ elif test -f $ac_dir/install.sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
- elif test -f "$ac_dir/shtool"; then
+ elif test -f $ac_dir/shtool; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
-$as_echo_n "checking target system type... " >&6; }
-if ${ac_cv_target+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "x$target_alias" = x; then
- ac_cv_target=$ac_cv_host
-else
- ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
-fi
+ ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+ ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
-$as_echo "$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
-esac
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
target=$ac_cv_target
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_target
-shift
-target_cpu=$1
-target_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-target_os=$*
-IFS=$ac_save_IFS
-case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# The aliases save the names the user supplied, while $host etc.
@@ -2760,8 +1643,7 @@ test -n "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
-am__api_version='1.11'
-
+am__api_version="1.9"
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
@@ -2775,23 +1657,22 @@ am__api_version='1.11'
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
@@ -2799,7 +1680,7 @@ case $as_dir/ in #((
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
@@ -2809,43 +1690,30 @@ case $as_dir/ in #((
# program-specific install script used by HP pwplus--don't use.
:
else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
fi
fi
done
done
;;
esac
+done
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
+ # removed, or if the path is relative.
INSTALL=$ac_install_sh
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -2855,34 +1723,21 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
# Just in case
sleep 1
echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
- *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
-esac
-
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$*" = "X"; then
# -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
+ set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$*" != "X $srcdir/configure conftest.file" \
@@ -2892,8 +1747,11 @@ if (
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
-alias in your environment" "$LINENO" 5
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
fi
test "$2" = conftest.file
@@ -2902,206 +1760,81 @@ then
# Ok.
:
else
- as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
+ program_transform_name="s,^,$program_prefix,;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
done
-IFS=$as_save_IFS
-
-fi
-
- test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- MKDIR_P="$ac_install_sh -d"
+ mkdir_p='$(install_sh) -d'
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
- [\\/$]* | ?:[\\/]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
@@ -3111,59 +1844,55 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
test -n "$AWK" && break
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
+ @echo 'ac_maketemp="$(MAKE)"'
_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
rm -f conftest.make
fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
SET_MAKE=
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -3176,14 +1905,12 @@ else
fi
rmdir .tst 2>/dev/null
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- am__isrc=' -I$(srcdir)'
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
- fi
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
fi
# test whether we have cygpath
@@ -3198,7 +1925,7 @@ fi
# Define the identity of the package.
PACKAGE='lighttpd'
- VERSION='1.4.31'
+ VERSION='1.4.8'
cat >>confdefs.h <<_ACEOF
@@ -3226,140 +1953,138 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
-$as_echo_n "checking how to create a ustar tar archive... " >&6; }
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar plaintar pax cpio none'
-_am_tools=${am_cv_prog_tar_ustar-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- { echo "$as_me:$LINENO: $_am_tar --version" >&5
- ($_am_tar --version) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && break
- done
- am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x ustar -w "$$tardir"'
- am__tar_='pax -L -x ustar -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
- am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
- am__untar='cpio -i -H ustar -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_ustar}" && break
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
- (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- rm -rf conftest.dir
- if test -s conftest.tar; then
- { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
- ($am__untar <conftest.tar) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
done
-rm -rf conftest.dir
+done
-if ${am_cv_prog_tar_ustar+:} false; then :
- $as_echo_n "(cached) " >&6
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
else
- am_cv_prog_tar_ustar=$_am_tool
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
-$as_echo "$am_cv_prog_tar_ustar" >&6; }
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
- enableval=$enable_silent_rules;
-fi
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no) AM_DEFAULT_VERBOSITY=1;;
-*) AM_DEFAULT_VERBOSITY=1;;
-esac
-am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if $as_echo 'TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
- @$(TRUE)
-.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
- am_cv_make_support_nested_variables=yes
+
+ ac_config_headers="$ac_config_headers config.h"
+
+
+echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
else
- am_cv_make_support_nested_variables=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
-if test $am_cv_make_support_nested_variables = yes; then
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+ USE_MAINTAINER_MODE=no
+fi;
+ echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
fi
-AM_BACKSLASH='\'
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+# Checks for programs.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3368,10 +2093,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3381,37 +2106,35 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -3421,50 +2144,39 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
+ CC=$ac_ct_CC
else
CC="$ac_cv_prog_CC"
fi
if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3474,37 +2186,77 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3515,19 +2267,18 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
@@ -3545,25 +2296,24 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
+ for ac_prog in cl
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3573,41 +2323,39 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
- for ac_prog in cl.exe
+ for ac_prog in cl
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -3617,78 +2365,66 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
test -n "$ac_ct_CC" && break
done
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
+ CC=$ac_ct_CC
fi
fi
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
@@ -3700,108 +2436,112 @@ main ()
}
_ACEOF
ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
break;;
* )
break;;
esac
done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
else
- ac_file=''
-fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
+ echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
+
ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -3809,90 +2549,38 @@ $as_echo "$ac_try_echo"; } >&5
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
break;;
* ) break;;
esac
done
else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
- { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if { ac_try='./conftest$ac_cv_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
@@ -3904,46 +2592,45 @@ main ()
}
_ACEOF
rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
- $as_echo "$as_me: failed program was:" >&5
+ echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
+
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
@@ -3957,49 +2644,55 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_compiler_gnu=yes
else
- ac_compiler_gnu=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
-fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
@@ -4010,34 +2703,39 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
+ac_cv_prog_cc_g=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
@@ -4053,18 +2751,23 @@ else
CFLAGS=
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_prog_cc_c89=no
+ ac_cv_prog_cc_stdc=no
ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
-struct stat;
+#include <sys/types.h>
+#include <sys/stat.h>
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4087,17 +2790,12 @@ static char *f (char * (*g) (char **, int), char **p, ...)
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
function prototypes and stuff, but not '\xHH' hex character constants.
These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
+ as 'x'. The following induces an error, until -std1 is added to get
proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
+ that's true only with -std1. */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
@@ -4112,37 +2810,205 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
return 0;
}
_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
+rm -f conftest.err conftest.$ac_objext
done
-rm -f conftest.$ac_ext
+rm -f conftest.$ac_ext conftest.$ac_objext
CC=$ac_save_CC
fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
*)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4150,59 +3016,60 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
DEPDIR="${am__leading_dot}deps"
-ac_config_commands="$ac_config_commands depfiles"
+ ac_config_commands="$ac_config_commands depfiles"
am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
- @echo this is the am__doit target
+ @echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
rm -f confinc confmf
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+fi;
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
- am__nodep='_no'
fi
- if test "x$enable_dependency_tracking" != xno; then
+
+
+if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE=
AMDEP_FALSE='#'
else
@@ -4212,12 +3079,13 @@ fi
+
depcc="$CC" am_compiler_list=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
@@ -4225,7 +3093,6 @@ else
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
- rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
@@ -4243,11 +3110,6 @@ else
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
@@ -4265,17 +3127,7 @@ else
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
@@ -4285,23 +3137,18 @@ else
break
fi
;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
none) break ;;
esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
@@ -4325,11 +3172,13 @@ else
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
- if
+
+
+if
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
am__fastdepCC_TRUE=
@@ -4340,495 +3189,91 @@ else
fi
-if test "x$CC" != xcc; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
-$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
-$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
-fi
-set dummy $CC; ac_cc=`$as_echo "$2" |
- sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+if test "${lt_cv_path_SED+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-rm -f conftest2.*
-if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
-then
- eval ac_cv_prog_cc_${ac_cc}_c_o=yes
- if test "x$CC" != xcc; then
- # Test first that cc exists at all.
- if { ac_try='cc -c conftest.$ac_ext >&5'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
- rm -f conftest2.*
- if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
- then
- # cc works too.
- :
- else
- # cc exists but doesn't like -o.
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
- fi
- fi
- fi
-else
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f core conftest*
-
-fi
-if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
-
-fi
-
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
- for ac_i in 1 2 3 4 5 6 7; do
- ac_script="$ac_script$as_nl$ac_script"
- done
- echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
- { ac_script=; unset ac_script;}
- if test -z "$SED"; then
- ac_path_SED_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_SED" || continue
-# Check for GNU ac_path_SED and select it if it is found.
- # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
- ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo '' >> "conftest.nl"
- "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_SED_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_SED="$ac_path_SED"
- ac_path_SED_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_SED_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_SED"; then
- as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
- fi
-else
- ac_cv_path_SED=$SED
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
- rm -f conftest.sed
-
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
+ for lt_ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
done
done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
+done
- fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
+SED=$lt_cv_path_SED
+echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if ${ac_cv_path_FGREP+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
- then ac_cv_path_FGREP="$GREP -F"
- else
- if test -z "$FGREP"; then
- ac_path_FGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in fgrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_FGREP" || continue
-# Check for GNU ac_path_FGREP and select it if it is found.
- # Check for GNU $ac_path_FGREP
-case `"$ac_path_FGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'FGREP' >> "conftest.nl"
- "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_FGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_FGREP="$ac_path_FGREP"
- ac_path_FGREP_max=$ac_count
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_FGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_FGREP"; then
- as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_FGREP=$FGREP
fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
- FGREP="$ac_cv_path_FGREP"
-
-
-test -z "$GREP" && GREP=grep
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
-$as_echo_n "checking how to print strings... " >&6; }
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
- test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='printf %s\n'
-else
- # Use this function as a fallback that always works.
- func_fallback_echo ()
- {
- eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
- }
- ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO ""
-}
-
-case "$ECHO" in
- printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
-$as_echo "printf" >&6; } ;;
- print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
-$as_echo "print -r" >&6; } ;;
- *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
-$as_echo "cat" >&6; } ;;
-esac
-
-
-
-
-
-
-
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
-
-
-
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
else
with_gnu_ld=no
-fi
-
+fi;
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
+ echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -4841,9 +3286,9 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
[\\/]* | ?:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
# Canonicalize the pathname of ld
- ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
- while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
@@ -4857,14 +3302,14 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
;;
esac
elif test "$with_gnu_ld" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
+ echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
fi
-if ${lt_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
+if test "${lt_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -z "$LD"; then
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
@@ -4874,7 +3319,7 @@ else
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
+ # but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
@@ -4894,19 +3339,21 @@ fi
LD="$lt_cv_path_LD"
if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
lt_cv_prog_gnu_ld=yes
@@ -4916,27 +3363,98 @@ case `$LD -v 2>&1 </dev/null` in
;;
esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
with_gnu_ld=$lt_cv_prog_gnu_ld
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
@@ -4946,28 +3464,26 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
test -n "$AWK" && break
done
@@ -4976,15 +3492,15 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
# Double quotes because CPP needs to be expanded
for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -4998,7 +3514,11 @@ do
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
@@ -5007,34 +3527,78 @@ do
#endif
Syntax error
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
# Broken: fails on valid input.
continue
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether nonexistent headers
+ # OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
# Broken: success on invalid input.
continue
else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
# Passes both tests.
ac_preproc_ok=:
break
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
break
fi
@@ -5046,8 +3610,8 @@ fi
else
ac_cv_prog_CPP=$CPP
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
@@ -5057,7 +3621,11 @@ do
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
@@ -5066,40 +3634,85 @@ do
#endif
Syntax error
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
# Broken: fails on valid input.
continue
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether nonexistent headers
+ # OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
# Broken: success on invalid input.
continue
else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
# Passes both tests.
ac_preproc_ok=:
break
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
ac_ext=c
@@ -5108,57 +3721,214 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
+ @echo 'ac_maketemp="$(MAKE)"'
_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
rm -f conftest.make
fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
SET_MAKE=
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
+
+echo "$as_me:$LINENO: checking for AIX" >&5
+echo $ECHO_N "checking for AIX... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef _AIX
+ yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+cat >>confdefs.h <<\_ACEOF
+#define _ALL_SOURCE 1
+_ACEOF
+
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest*
+
+
+echo "$as_me:$LINENO: checking for library containing strerror" >&5
+echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
+if test "${ac_cv_search_strerror+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_strerror=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strerror ();
+int
+main ()
+{
+strerror ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_strerror="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_strerror" = no; then
+ for ac_lib in cposix; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strerror ();
+int
+main ()
+{
+strerror ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_strerror="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
+echo "${ECHO_T}$ac_cv_search_strerror" >&6
+if test "$ac_cv_search_strerror" != no; then
+ test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
+
+fi
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
@@ -5173,23 +3943,51 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_header_stdc=yes
else
- ac_cv_header_stdc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <string.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
else
ac_cv_header_stdc=no
fi
@@ -5199,14 +3997,18 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdlib.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
+ $EGREP "free" >/dev/null 2>&1; then
+ :
else
ac_cv_header_stdc=no
fi
@@ -5216,13 +4018,16 @@ fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then
:
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ctype.h>
-#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -5242,171 +4047,286 @@ main ()
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
- return 2;
- return 0;
+ exit(2);
+ exit (0);
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
else
- ac_cv_header_stdc=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
fi
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-fi
-done
- ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-if test "x$ac_cv_header_minix_config_h" = xyes; then :
- MINIX=yes
-else
- MINIX=
-fi
- if test "$MINIX" = yes; then
-$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
-$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-$as_echo "#define _MINIX 1" >>confdefs.h
+fi
- fi
+done
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
-$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if ${ac_cv_safe_to_define___extensions__+:} false; then :
- $as_echo_n "(cached) " >&6
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for minix/config.h" >&5
+echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking minix/config.h usability" >&5
+echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+$ac_includes_default
+#include <minix/config.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-# define __EXTENSIONS__ 1
- $ac_includes_default
-int
-main ()
-{
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
- ;
- return 0;
-}
+# Is the header present?
+echo "$as_me:$LINENO: checking minix/config.h presence" >&5
+echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <minix/config.h>
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_safe_to_define___extensions__=yes
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- ac_cv_safe_to_define___extensions__=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cpp_err=yes
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
-$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
- test $ac_cv_safe_to_define___extensions__ = yes &&
- $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
- $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for minix/config.h" >&5
+echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_minix_config_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6
- $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+fi
+if test $ac_cv_header_minix_config_h = yes; then
+ MINIX=yes
+else
+ MINIX=
+fi
- $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+if test "$MINIX" = yes; then
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_SOURCE 1
+_ACEOF
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
-$as_echo_n "checking for library containing strerror... " >&6; }
-if ${ac_cv_search_strerror+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char strerror ();
-int
-main ()
-{
-return strerror ();
- ;
- return 0;
-}
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_1_SOURCE 2
_ACEOF
-for ac_lib in '' cposix; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_strerror=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_strerror+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_strerror+:} false; then :
-else
- ac_cv_search_strerror=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
-$as_echo "$ac_cv_search_strerror" >&6; }
-ac_res=$ac_cv_search_strerror
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-fi
+cat >>confdefs.h <<\_ACEOF
+#define _MINIX 1
+_ACEOF
+fi
case $host_os in
*darwin*|*cygwin*|*aix*|*mingw* ) NO_RDYNAMIC=yes;;
- * ) NO_RDYNAMIC=no;;
+ * ) NO_RDYNAMIC=no;;
esac
- if test x$NO_RDYNAMIC = xyes; then
+
+
+if test x$NO_RDYNAMIC = xyes; then
NO_RDYNAMIC_TRUE=
NO_RDYNAMIC_FALSE='#'
else
@@ -5417,24 +4337,27 @@ fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5
-$as_echo_n "checking for function prototypes... " >&6; }
-if test "$ac_cv_prog_cc_c89" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+echo "$as_me:$LINENO: checking for function prototypes" >&5
+echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6
+if test "$ac_cv_prog_cc_stdc" != no; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
-$as_echo "#define PROTOTYPES 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define PROTOTYPES 1
+_ACEOF
-$as_echo "#define __PROTOTYPES 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define __PROTOTYPES 1
+_ACEOF
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
if test "$ac_cv_prog_cc_stdc" != no; then
U= ANSI2KNR=
else
@@ -5442,12 +4365,150 @@ else
fi
# Ensure some checks needed by ansi2knr itself.
+
for ac_header in string.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
-if test "x$ac_cv_header_string_h" = xyes; then :
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_STRING_H 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -5456,9 +4517,10 @@ done
-# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
- enableval=$enable_static; p=${PACKAGE-default}
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
@@ -5477,19 +4539,13 @@ if test "${enable_static+set}" = set; then :
esac
else
enable_static=no
-fi
-
-
-
-
-
-
-
+fi;
-# Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
- enableval=$enable_shared; p=${PACKAGE-default}
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
@@ -5508,551 +4564,44 @@ if test "${enable_shared+set}" = set; then :
esac
else
enable_shared=yes
-fi
-
-
-
-
-
-
-
-
-
-
-enable_dlopen=yes
-
-
-
-case `pwd` in
- *\ * | *\ *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
-esac
-
-
-
-macro_version='2.4.2'
-macro_revision='1.3337'
-
-
-
-
-
-
-
-
-
-
-
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
-# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if ${lt_cv_path_NM+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- : ${lt_cv_path_NM=no}
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
- NM="$lt_cv_path_NM"
-else
- # Didn't find any BSD compatible name lister, look for dumpbin.
- if test -n "$DUMPBIN"; then :
- # Let the user override the test.
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in dumpbin "link -dump"
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DUMPBIN"; then
- ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DUMPBIN=$ac_cv_prog_DUMPBIN
-if test -n "$DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$DUMPBIN" && break
- done
-fi
-if test -z "$DUMPBIN"; then
- ac_ct_DUMPBIN=$DUMPBIN
- for ac_prog in dumpbin "link -dump"
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DUMPBIN"; then
- ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
-if test -n "$ac_ct_DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+fi;
- test -n "$ac_ct_DUMPBIN" && break
-done
- if test "x$ac_ct_DUMPBIN" = x; then
- DUMPBIN=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DUMPBIN=$ac_ct_DUMPBIN
- fi
-fi
- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
- *COFF*)
- DUMPBIN="$DUMPBIN -symbols"
- ;;
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
*)
- DUMPBIN=:
- ;;
- esac
- fi
-
- if test "$DUMPBIN" != ":"; then
- NM="$DUMPBIN"
- fi
-fi
-test -z "$NM" && NM=nm
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if ${lt_cv_nm_interface+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_nm_interface="BSD nm"
- echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
- (eval "$ac_compile" 2>conftest.err)
- cat conftest.err >&5
- (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
- (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
- cat conftest.err >&5
- (eval echo "\"\$as_me:$LINENO: output\"" >&5)
- cat conftest.out >&5
- if $GREP 'External.*some_variable' conftest.out > /dev/null; then
- lt_cv_nm_interface="MS dumpbin"
- fi
- rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
-
-# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if ${lt_cv_sys_max_cmd_len+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw* | cegcc*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- mint*)
- # On MiNT this can take a long time and run out of memory.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- os2*)
- # The test takes a long time on OS/2.
- lt_cv_sys_max_cmd_len=8192
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- # Make teststring a little bigger before we do anything with it.
- # a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8 ; do
- teststring=$teststring$teststring
- done
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
- = "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
done
- # Only check the string length outside the loop.
- lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
- teststring=
- # Add a significant safety factor because C++ compilers can tack on
- # massive amounts of additional arguments before passing them to the
- # linker. It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-
-fi
-
-if test -n $lt_cv_sys_max_cmd_len ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-
-
-
-
-
-: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,b/c, \
- && eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
- && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
- >/dev/null 2>&1 \
- && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- lt_unset=unset
-else
- lt_unset=false
-fi
-
-
-
-
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- lt_SP2NL='tr \040 \012'
- lt_NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- lt_SP2NL='tr \100 \n'
- lt_NL2SP='tr \r\n \100\100'
- ;;
-esac
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-if ${lt_cv_to_host_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
- ;;
- esac
- ;;
- *-*-cygwin* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
- ;;
+ IFS="$lt_save_ifs"
+ ;;
esac
- ;;
- * ) # unhandled hosts (and "normal" native builds)
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
-esac
-
-fi
-
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-if ${lt_cv_to_tool_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
else
- #assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
- ;;
- esac
- ;;
-esac
-
-fi
-
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-
-
-
-
+ enable_fast_install=yes
+fi;
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if ${lt_cv_ld_reload_flag+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
lt_cv_ld_reload_flag='-r'
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
reload_flag=$lt_cv_ld_reload_flag
case $reload_flag in
"" | " "*) ;;
@@ -6060,134 +4609,65 @@ case $reload_flag in
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- if test "$GCC" != yes; then
- reload_cmds=false
- fi
- ;;
darwin*)
if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
else
reload_cmds='$LD$reload_flag -o $output$reload_objs'
fi
;;
esac
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OBJDUMP"; then
- ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
- ac_ct_OBJDUMP=$OBJDUMP
- # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OBJDUMP"; then
- ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OBJDUMP="objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ esac
+ fi
done
-IFS=$as_save_IFS
-
-fi
+ IFS="$lt_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
fi
+echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6
+NM="$lt_cv_path_NM"
- if test "x$ac_ct_OBJDUMP" = x; then
- OBJDUMP="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OBJDUMP=$ac_ct_OBJDUMP
- fi
-else
- OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if ${lt_cv_deplibs_check_method+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
@@ -6204,7 +4684,7 @@ lt_cv_deplibs_check_method='unknown'
# whether `pass_all' will *always* work, you probably want this one.
case $host_os in
-aix[4-9]*)
+aix4* | aix5*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -6226,22 +4706,8 @@ cygwin*)
mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- # Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-cegcc*)
- # use the weaker test based on 'objdump'. See mingw*.
- lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
@@ -6249,8 +4715,8 @@ darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+freebsd* | kfreebsd*-gnu | dragonfly*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
@@ -6269,33 +4735,24 @@ gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-haiku*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
hpux10.20* | hpux11*)
lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
+ case "$host_cpu" in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
;;
hppa*64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
;;
*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
esac
;;
-interix[3-9]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
- ;;
-
irix5* | irix6* | nonstopux*)
case $LD in
*-32|*"-32 ") libmagic=32-bit;;
@@ -6306,13 +4763,13 @@ irix5* | irix6* | nonstopux*)
lt_cv_deplibs_check_method=pass_all
;;
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+# This must be Linux ELF.
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
@@ -6325,12 +4782,12 @@ newos6*)
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
-*nto* | *qnx*)
- lt_cv_deplibs_check_method=pass_all
+nto-qnx*)
+ lt_cv_deplibs_check_method=unknown
;;
openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
@@ -6341,7 +4798,7 @@ osf3* | osf4* | osf5*)
lt_cv_deplibs_check_method=pass_all
;;
-rdos*)
+sco3.2v5*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -6349,11 +4806,7 @@ solaris*)
lt_cv_deplibs_check_method=pass_all
;;
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
case $host_vendor in
motorola)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
@@ -6374,647 +4827,1422 @@ sysv4 | sysv4.3*)
siemens)
lt_cv_deplibs_check_method=pass_all
;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
esac
;;
-tpf*)
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
lt_cv_deplibs_check_method=pass_all
;;
esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
- case $host_os in
- mingw* | pw32*)
- if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
- want_nocaseglob=yes
- else
- file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
- fi
- ;;
- esac
-fi
-
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+# Allow CC to be a program name with arguments.
+compiler=$CC
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 4884 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int
+main ()
+{
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ lt_cv_cc_needs_belf=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+esac
+need_locks="$enable_libtool_lock"
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DLLTOOL"; then
- ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+for ac_header in dlfcn.h
do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
- ac_ct_DLLTOOL=$DLLTOOL
- # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DLLTOOL"; then
- ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DLLTOOL="dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_header_compiler=no
fi
-fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
- if test "x$ac_ct_DLLTOOL" = x; then
- DLLTOOL="false"
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DLLTOOL=$ac_ct_DLLTOOL
+ ac_cpp_err=
fi
else
- DLLTOOL="$ac_cv_prog_DLLTOOL"
+ ac_cpp_err=yes
fi
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
else
- lt_cv_sharedlib_from_linklib_cmd='unknown'
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
- # two different shell functions defined in ltmain.sh
- # decide which to use based on capabilities of $DLLTOOL
- case `$DLLTOOL --help 2>&1` in
- *--identify-strict*)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- *)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
;;
- esac
- ;;
-*)
- # fallback: assume linklib IS sharedlib
- lt_cv_sharedlib_from_linklib_cmd="$ECHO"
- ;;
esac
-
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-
-
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+fi
+done
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test -n "$ac_tool_prefix"; then
- for ac_prog in ar
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
fi
fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
- test -n "$AR" && break
+ test -n "$CXX" && break
done
fi
-if test -z "$AR"; then
- ac_ct_AR=$AR
- for ac_prog in ar
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AR="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
fi
fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
- test -n "$ac_ct_AR" && break
+ test -n "$ac_ct_CXX" && break
done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
- if test "x$ac_ct_AR" = x; then
- AR="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
+ CXX=$ac_ct_CXX
fi
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-
-
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int
+main ()
+{
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cxx_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-$as_echo_n "checking for archiver @FILE support... " >&6; }
-if ${lt_cv_ar_at_file+:} false; then :
- $as_echo_n "(cached) " >&6
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
else
- lt_cv_ar_at_file=no
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-
+$ac_declaration
+#include <stdlib.h>
int
main ()
{
-
+exit (42);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- echo conftest.$ac_objext > conftest.lst
- lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
- (eval $lt_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test "$ac_status" -eq 0; then
- # Ensure the archiver fails upon bogus file names.
- rm -f conftest.$ac_objext libconftest.a
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
- (eval $lt_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test "$ac_status" -ne 0; then
- lt_cv_ar_at_file=@
- fi
- fi
- rm -f conftest.* libconftest.a
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+continue
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-$as_echo "$lt_cv_ar_at_file" >&6; }
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
-if test "x$lt_cv_ar_at_file" = xno; then
- archiver_list_spec=
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+depcc="$CXX" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- archiver_list_spec=$lt_cv_ar_at_file
-fi
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+fi
+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+
+
+
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+if test -z "$CXXCPP"; then
+ if test "${ac_cv_prog_CXXCPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
fi
-done
- done
-IFS=$as_save_IFS
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ # Broken: fails on valid input.
+continue
fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
fi
+rm -f conftest.err conftest.$ac_ext
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CXXCPP=$CXXCPP
fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+ CXXCPP=$ac_cv_prog_CXXCPP
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+ ac_cv_prog_CXXCPP=$CXXCPP
+fi
+echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
fi
-done
- done
-IFS=$as_save_IFS
-
-fi
+else
+ ac_cpp_err=yes
fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
+if test -z "$ac_cpp_err"; then
+ :
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
fi
+rm -f conftest.err conftest.$ac_ext
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
+ ac_cpp_err=
fi
else
- STRIP="$ac_cv_prog_STRIP"
+ ac_cpp_err=yes
fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-test -z "$STRIP" && STRIP=:
-
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+fi
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
+ for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+ if test -n "$F77"; then
+ ac_cv_prog_F77="$F77" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
fi
fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+ echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
+ test -n "$F77" && break
+ done
fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
+if test -z "$F77"; then
+ ac_ct_F77=$F77
+ for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+ if test -n "$ac_ct_F77"; then
+ ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_F77="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
fi
fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+ echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-test -z "$RANLIB" && RANLIB=:
-
-
-
-
-
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
+ test -n "$ac_ct_F77" && break
+done
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+ F77=$ac_ct_F77
fi
-case $host_os in
- darwin*)
- lock_old_archive_extraction=yes ;;
- *)
- lock_old_archive_extraction=no ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+# Provide some information about the compiler.
+echo "$as_me:5990:" \
+ "checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file. (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+#ifndef __GNUC__
+ choke me
+#endif
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_f77_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+fi
+echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_f77_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+ program main
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_f77_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_f77_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_prog_f77_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
+if test "$ac_test_FFLAGS" = set; then
+ FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+ FFLAGS="-g -O2"
+ else
+ FFLAGS="-g"
+ fi
+else
+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+ FFLAGS="-O2"
+ else
+ FFLAGS=
+ fi
+fi
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ i=0
+ teststring="ABCD"
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ *)
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+ = "XX$teststring") >/dev/null 2>&1 &&
+ new_result=`expr "X$teststring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ ;;
+ esac
+fi
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
+if test -n $lt_cv_sys_max_cmd_len ; then
+ echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+else
+ echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+fi
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-# Allow CC to be a program name with arguments.
-compiler=$CC
# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if ${lt_cv_sys_global_symbol_pipe+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
# These are sane defaults that work on at least a few old systems.
@@ -7026,18 +6254,33 @@ symcode='[BCDEGRST]'
# Regexp to match symbols that can be accessed directly from C.
sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
# Define system-specific variables.
case $host_os in
aix*)
symcode='[BCDT]'
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | pw32*)
symcode='[ABCDGISTW]'
;;
-hpux*)
+hpux*) # Its linker distinguishes data from code symbols
if test "$host_cpu" = ia64; then
symcode='[ABCDEGRST]'
fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+linux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDGIRSTW]'
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ fi
;;
irix* | nonstopux*)
symcode='[BCDEGRST]'
@@ -7045,104 +6288,65 @@ irix* | nonstopux*)
osf*)
symcode='[BCDEGQRST]'
;;
-solaris*)
+solaris* | sysv5*)
symcode='[BDRT]'
;;
-sco3.2v5*)
- symcode='[DT]'
- ;;
-sysv4.2uw2*)
- symcode='[DT]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[ABDT]'
- ;;
sysv4)
symcode='[DFNSTU]'
;;
esac
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
-
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
mingw*)
- opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
-# Try without a prefix underscore, then with it.
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
for ac_symprfx in "" "_"; do
# Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
symxfrm="\\1 $ac_symprfx\\2 \\2"
# Write the raw and C identifiers.
- if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function
- # and D for any global variable.
- # Also find C++ and __fastcall symbols from MSVC++,
- # which start with @ or ?.
- lt_cv_sys_global_symbol_pipe="$AWK '"\
-" {last_section=section; section=\$ 3};"\
-" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-" \$ 0!~/External *\|/{next};"\
-" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-" {if(hide[section]) next};"\
-" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-" s[1]~/^[@?]/{print s[1], s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-" ' prfx=^$ac_symprfx"
- else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
- fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
# Check to see that the pipe works correctly.
pipe_works=no
rm -f conftest*
- cat > conftest.$ac_ext <<_LT_EOF
+ cat > conftest.$ac_ext <<EOF
#ifdef __cplusplus
extern "C" {
#endif
char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
+void nm_test_func(){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
+EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
# Now try to grab the symbols.
nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+ (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "$nlist"; then
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
@@ -7151,71 +6355,57 @@ _LT_EOF
fi
# Make sure that we snagged all the symbols we need.
- if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data. */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
#ifdef __cplusplus
extern "C" {
#endif
-_LT_EOF
+EOF
# Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
- cat <<_LT_EOF >> conftest.$ac_ext
+ cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
-/* The mapping between symbol names and symbols. */
-LT_DLSYM_CONST struct {
+/* The mapping between symbol names and symbols. */
+const struct {
const char *name;
- void *address;
+ lt_ptr_t address;
}
-lt__PROGRAM__LTX_preloaded_symbols[] =
+lt_preloaded_symbols[] =
{
- { "@PROGRAM@", (void *) 0 },
-_LT_EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
- cat <<\_LT_EOF >> conftest.$ac_ext
- {0, (void *) 0}
+EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr_t) 0}
};
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
#ifdef __cplusplus
}
#endif
-_LT_EOF
+EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
- lt_globsym_save_LIBS=$LIBS
- lt_globsym_save_CFLAGS=$CFLAGS
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
- LIBS=$lt_globsym_save_LIBS
- CFLAGS=$lt_globsym_save_CFLAGS
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
else
echo "cannot find nm_test_func in $nlist" >&5
fi
@@ -7229,7 +6419,7 @@ _LT_EOF
echo "$progname: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
- rm -rf conftest* conftst*
+ rm -f conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
@@ -7245,1241 +6435,355 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then
lt_cv_sys_global_symbol_to_cdecl=
fi
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
+ echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
+ echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
fi
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
- nm_file_list_spec='@'
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-$as_echo_n "checking for sysroot... " >&6; }
-
-# Check whether --with-sysroot was given.
-if test "${with_sysroot+set}" = set; then :
- withval=$with_sysroot;
+echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+if test "${lt_cv_objdir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- with_sysroot=no
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
fi
-
-
-lt_sysroot=
-case ${with_sysroot} in #(
- yes)
- if test "$GCC" = yes; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
- fi
- ;; #(
- /*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
- ;; #(
- no|'')
- ;; #(
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
-$as_echo "${with_sysroot}" >&6; }
- as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
- ;;
-esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-$as_echo "${lt_sysroot:-no}" >&6; }
-
+rmdir .libs 2>/dev/null
+fi
+echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6
+objdir=$lt_cv_objdir
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
- enableval=$enable_libtool_lock;
-fi
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '#line '$LINENO' "configure"' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
fi
- rm -rf conftest*
;;
+esac
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*|s390*-*tpf*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if ${lt_cv_cc_needs_belf+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-int
-main ()
-{
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_cc_needs_belf=yes
-else
- lt_cv_cc_needs_belf=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+# Constants:
+rm="rm -f"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*)
- case $host in
- i?86-*-solaris*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- sparc*-*-solaris*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
- if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD="${LD-ld}_sol2"
- fi
- ;;
- *)
- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
- LD="${LD-ld} -64"
- fi
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-esac
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
-need_locks="$enable_libtool_lock"
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-set dummy ${ac_tool_prefix}mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$MANIFEST_TOOL"; then
- ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-if test -n "$MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-$as_echo "$MANIFEST_TOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
- ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
- # Extract the first word of "mt", so it can be a program name with args.
-set dummy mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_MANIFEST_TOOL"; then
- ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
done
- done
-IFS=$as_save_IFS
fi
fi
-ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-if test -n "$ac_ct_MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- if test "x$ac_ct_MANIFEST_TOOL" = x; then
- MANIFEST_TOOL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
- fi
-else
- MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
fi
-
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-if ${lt_cv_path_mainfest_tool+:} false; then :
- $as_echo_n "(cached) " >&6
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_cv_path_mainfest_tool=no
- echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
- $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
- cat conftest.err >&5
- if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
- fi
- rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
- MANIFEST_TOOL=:
-fi
-
-
-
-
-
-
- case $host_os in
- rhapsody* | darwin*)
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DSYMUTIL"; then
- ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="ar"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
- ac_ct_DSYMUTIL=$DSYMUTIL
- # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DSYMUTIL"; then
- ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
done
- done
-IFS=$as_save_IFS
+ test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
fi
fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- if test "x$ac_ct_DSYMUTIL" = x; then
- DSYMUTIL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DSYMUTIL=$ac_ct_DSYMUTIL
- fi
+ AR=$ac_ct_AR
else
- DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+ AR="$ac_cv_prog_AR"
fi
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$NMEDIT"; then
- ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
-$as_echo "$NMEDIT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_NMEDIT"; then
- ac_ct_NMEDIT=$NMEDIT
- # Extract the first word of "nmedit", so it can be a program name with args.
-set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_NMEDIT"; then
- ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_NMEDIT="nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
done
- done
-IFS=$as_save_IFS
fi
fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
-$as_echo "$ac_ct_NMEDIT" >&6; }
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- if test "x$ac_ct_NMEDIT" = x; then
- NMEDIT=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- NMEDIT=$ac_ct_NMEDIT
- fi
-else
- NMEDIT="$ac_cv_prog_NMEDIT"
fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
-set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$LIPO"; then
- ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-LIPO=$ac_cv_prog_LIPO
-if test -n "$LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
-$as_echo "$LIPO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_LIPO"; then
- ac_ct_LIPO=$LIPO
- # Extract the first word of "lipo", so it can be a program name with args.
-set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_LIPO"; then
- ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_LIPO="lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
done
- done
-IFS=$as_save_IFS
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
fi
fi
-ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
-if test -n "$ac_ct_LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
-$as_echo "$ac_ct_LIPO" >&6; }
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- if test "x$ac_ct_LIPO" = x; then
- LIPO=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- LIPO=$ac_ct_LIPO
- fi
+ RANLIB=$ac_ct_RANLIB
else
- LIPO="$ac_cv_prog_LIPO"
+ RANLIB="$ac_cv_prog_RANLIB"
fi
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$OTOOL"; then
- ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL=$ac_cv_prog_OTOOL
-if test -n "$OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
-$as_echo "$OTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL"; then
- ac_ct_OTOOL=$OTOOL
- # Extract the first word of "otool", so it can be a program name with args.
-set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OTOOL"; then
- ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OTOOL="otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
done
- done
-IFS=$as_save_IFS
fi
fi
-ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
-if test -n "$ac_ct_OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
-$as_echo "$ac_ct_OTOOL" >&6; }
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- if test "x$ac_ct_OTOOL" = x; then
- OTOOL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OTOOL=$ac_ct_OTOOL
- fi
-else
- OTOOL="$ac_cv_prog_OTOOL"
fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$OTOOL64"; then
- ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL64=$ac_cv_prog_OTOOL64
-if test -n "$OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
-$as_echo "$OTOOL64" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL64"; then
- ac_ct_OTOOL64=$OTOOL64
- # Extract the first word of "otool64", so it can be a program name with args.
-set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OTOOL64"; then
- ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OTOOL64="otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
-if test -n "$ac_ct_OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
-$as_echo "$ac_ct_OTOOL64" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OTOOL64" = x; then
- OTOOL64=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OTOOL64=$ac_ct_OTOOL64
- fi
-else
- OTOOL64="$ac_cv_prog_OTOOL64"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
-$as_echo_n "checking for -single_module linker flag... " >&6; }
-if ${lt_cv_apple_cc_single_mod+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_apple_cc_single_mod=no
- if test -z "${LT_MULTI_MODULE}"; then
- # By default we will add the -single_module flag. You can override
- # by either setting the environment variable LT_MULTI_MODULE
- # non-empty at configure time, or by adding -multi_module to the
- # link flags.
- rm -rf libconftest.dylib*
- echo "int foo(void){return 1;}" > conftest.c
- echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&5
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
- _lt_result=$?
- # If there is a non-empty error log, and "single_module"
- # appears in it, assume the flag caused a linker warning
- if test -s conftest.err && $GREP single_module conftest.err; then
- cat conftest.err >&5
- # Otherwise, if the output was created with a 0 exit code from
- # the compiler, it worked.
- elif test -f libconftest.dylib && test $_lt_result -eq 0; then
- lt_cv_apple_cc_single_mod=yes
- else
- cat conftest.err >&5
- fi
- rm -rf libconftest.dylib*
- rm -f conftest.*
- fi
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
-$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
-$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if ${lt_cv_ld_exported_symbols_list+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_exported_symbols_list=no
- save_LDFLAGS=$LDFLAGS
- echo "_main" > conftest.sym
- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_ld_exported_symbols_list=yes
-else
- lt_cv_ld_exported_symbols_list=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
-$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
-$as_echo_n "checking for -force_load linker flag... " >&6; }
-if ${lt_cv_ld_force_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_force_load=no
- cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
- $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
- echo "$AR cru libconftest.a conftest.o" >&5
- $AR cru libconftest.a conftest.o 2>&5
- echo "$RANLIB libconftest.a" >&5
- $RANLIB libconftest.a 2>&5
- cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
- $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
- _lt_result=$?
- if test -s conftest.err && $GREP force_load conftest.err; then
- cat conftest.err >&5
- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
- lt_cv_ld_force_load=yes
- else
- cat conftest.err >&5
- fi
- rm -f conftest.err libconftest.a conftest conftest.c
- rm -rf conftest.dSYM
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
-$as_echo "$lt_cv_ld_force_load" >&6; }
- case $host_os in
- rhapsody* | darwin1.[012])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- 10.[012]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- esac
- ;;
- esac
- if test "$lt_cv_apple_cc_single_mod" = "yes"; then
- _lt_dar_single_mod='$single_module'
- fi
- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
- else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
- _lt_dsymutil='~$DSYMUTIL $lib || :'
- else
- _lt_dsymutil=
- fi
- ;;
- esac
-
-for ac_header in dlfcn.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-# Set options
-
-
-
-
- enable_win32_dll=no
-
-
-
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
- withval=$with_pic; lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for lt_pkg in $withval; do
- IFS="$lt_save_ifs"
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- pic_mode=default
fi
-
-
-test -z "$pic_mode" && pic_mode=default
-
-
-
-
-
-
-
- # Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
- enableval=$enable_fast_install; p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
else
- enable_fast_install=yes
-fi
-
-
-
-
-
-
-
-
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-test -z "$LN_S" && LN_S="ln -s"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if ${lt_cv_objdir+:} false; then :
- $as_echo_n "(cached) " >&6
+ STRIP=$ac_ct_STRIP
else
- rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
+ STRIP="$ac_cv_prog_STRIP"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
-_ACEOF
-
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
old_CC="$CC"
old_CFLAGS="$CFLAGS"
# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
test -z "$CC" && CC=cc
test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$DLLTOOL" && DLLTOOL=dlltool
test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
test -z "$ac_objext" && ac_objext=o
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
for cc_temp in $compiler""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
@@ -8488,18 +6792,17 @@ for cc_temp in $compiler""; do
*) break;;
esac
done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
@@ -8517,13 +6820,13 @@ else
if test -n "$file_magic_test_file"; then
case $deplibs_check_method in
"file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
$EGREP "$file_magic_regex" > /dev/null; then
:
else
- cat <<_LT_EOF 1>&2
+ cat <<EOF 1>&2
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
@@ -8534,7 +6837,7 @@ else
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
-_LT_EOF
+EOF
fi ;;
esac
fi
@@ -8549,23 +6852,19 @@ fi
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
-
-
-
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
@@ -8583,13 +6882,13 @@ else
if test -n "$file_magic_test_file"; then
case $deplibs_check_method in
"file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
$EGREP "$file_magic_regex" > /dev/null; then
:
else
- cat <<_LT_EOF 1>&2
+ cat <<EOF 1>&2
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
@@ -8600,7 +6899,7 @@ else
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
-_LT_EOF
+EOF
fi ;;
esac
fi
@@ -8615,14 +6914,13 @@ fi
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
else
MAGIC_CMD=:
fi
@@ -8632,8 +6930,28 @@ fi
;;
esac
-# Use C for the default configuration in the libtool script
+enable_dlopen=yes
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+ withval="$with_pic"
+ pic_mode="$withval"
+else
+ pic_mode=default
+fi;
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
lt_save_CC="$CC"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -8650,68 +6968,113 @@ objext=o
objext=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
+lt_simple_compile_test_code="int some_variable = 0;\n"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-
-
-
-
+lt_simple_link_test_code='int main(){return(0);}\n'
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
# Allow CC to be a program name with arguments.
compiler=$CC
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
+$rm conftest*
ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
+$rm conftest*
+
+
+#
+# Check for any special shared library compilation flags.
+#
+lt_prog_cc_shlib=
+if test "$GCC" = no; then
+ case $host_os in
+ sco3.2v5*)
+ lt_prog_cc_shlib='-belf'
+ ;;
+ esac
+fi
+if test -n "$lt_prog_cc_shlib"; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
+echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
+ if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then :
+ else
+ { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+ lt_cv_prog_cc_can_build_shared=no
+ fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
+ $SED '/^$/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_static_works=yes
+ fi
+ else
+ lt_prog_compiler_static_works=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
lt_prog_compiler_no_builtin_flag=
if test "$GCC" = yes; then
- case $cc_basename in
- nvcc*)
- lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
- *)
- lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
- esac
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin'
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
- $as_echo_n "(cached) " >&6
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-fno-rtti -fno-exceptions"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -8719,28 +7082,28 @@ else
# with a dollar sign (not a hyphen), so the echo should work correctly.
# The option is referenced via a variable to avoid confusing sed.
lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7088: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ echo "$as_me:7092: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+ $SED '/^$/d' conftest.err >conftest.er2
+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_rtti_exceptions=yes
fi
fi
- $RM conftest*
+ $rm conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
@@ -8750,15 +7113,12 @@ fi
fi
-
-
-
-
-
- lt_prog_compiler_wl=
+lt_prog_compiler_wl=
lt_prog_compiler_pic=
lt_prog_compiler_static=
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
if test "$GCC" = yes; then
lt_prog_compiler_wl='-Wl,'
@@ -8774,29 +7134,19 @@ lt_prog_compiler_static=
;;
amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- lt_prog_compiler_pic='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
lt_prog_compiler_pic='-DDLL_EXPORT'
;;
@@ -8806,31 +7156,6 @@ lt_prog_compiler_static=
lt_prog_compiler_pic='-fno-common'
;;
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- lt_prog_compiler_static=
- ;;
-
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- ;;
-
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
msdosdjgpp*)
# Just because we use GCC doesn't mean we suddenly get shared libraries
# on systems that don't support them.
@@ -8838,29 +7163,27 @@ lt_prog_compiler_static=
enable_shared=no
;;
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic='-fPIC -shared'
- ;;
-
sysv4*MP*)
if test -d /usr/nec; then
lt_prog_compiler_pic=-Kconform_pic
fi
;;
- *)
- lt_prog_compiler_pic='-fPIC'
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
;;
- esac
- case $cc_basename in
- nvcc*) # Cuda Compiler Driver 2.2
- lt_prog_compiler_wl='-Xlinker '
- if test -n "$lt_prog_compiler_pic"; then
- lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
- fi
+ *)
+ lt_prog_compiler_pic='-fPIC'
;;
esac
else
@@ -8875,8 +7198,18 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
fi
;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ lt_prog_compiler_pic='-qnocommon'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ esac
+ ;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
@@ -8886,7 +7219,7 @@ lt_prog_compiler_static=
lt_prog_compiler_wl='-Wl,'
# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
# not for PA HP-UX.
- case $host_cpu in
+ case "$host_cpu" in
hppa*64*|ia64*)
# +Z the default
;;
@@ -8904,111 +7237,49 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-non_shared'
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ linux*)
case $cc_basename in
- # old Intel for x86_64 which still supported -KPIC.
- ecc*)
+ icc* | ecc*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-static'
;;
- # icc used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- icc* | ifort*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- # Lahey Fortran 8.1.
- lf95*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='--shared'
- lt_prog_compiler_static='--static'
- ;;
- nagfor*)
- # NAG Fortran compiler
- lt_prog_compiler_wl='-Wl,-Wl,,'
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ pgcc* | pgf77* | pgf90*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_static='-static'
;;
ccc*)
lt_prog_compiler_wl='-Wl,'
# All Alpha code is PIC.
lt_prog_compiler_static='-non_shared'
;;
- xl* | bgxl* | bgf* | mpixl*)
- # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-qpic'
- lt_prog_compiler_static='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl=''
- ;;
- *Sun\ F* | *Sun*Fortran*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Qoption ld '
- ;;
- *Sun\ C*)
- # Sun C 5.9
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Wl,'
- ;;
- *Intel*\ [CF]*Compiler*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- *Portland\ Group*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
- esac
- ;;
esac
;;
- newsos6)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic='-fPIC -shared'
- ;;
-
osf3* | osf4* | osf5*)
lt_prog_compiler_wl='-Wl,'
# All OSF/1 code is PIC.
lt_prog_compiler_static='-non_shared'
;;
- rdos*)
- lt_prog_compiler_static='-non_shared'
+ sco3.2v5*)
+ lt_prog_compiler_pic='-Kpic'
+ lt_prog_compiler_static='-dn'
;;
solaris*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
case $cc_basename in
- f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ f77* | f90* | f95*)
lt_prog_compiler_wl='-Qoption ld ';;
*)
lt_prog_compiler_wl='-Wl,';;
@@ -9021,7 +7292,7 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-Bstatic'
;;
- sysv4 | sysv4.2uw2* | sysv4.3*)
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
@@ -9034,12 +7305,6 @@ lt_prog_compiler_static=
fi
;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
unicos*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_can_build_shared=no
@@ -9056,39 +7321,22 @@ lt_prog_compiler_static=
esac
fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic=
- ;;
- *)
- lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6
#
# Check to make sure the PIC flag actually works.
#
if test -n "$lt_prog_compiler_pic"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic_works=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -9096,30 +7344,30 @@ else
# with a dollar sign (not a hyphen), so the echo should work correctly.
# The option is referenced via a variable to avoid confusing sed.
lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7350: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ echo "$as_me:7354: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_pic_works=yes
+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+ $SED '/^$/d' conftest.err >conftest.er2
+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_pic_works=yes
fi
fi
- $RM conftest*
+ $rm conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+if test x"$lt_prog_compiler_pic_works" = xyes; then
case $lt_prog_compiler_pic in
"" | " "*) ;;
*) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -9130,130 +7378,27 @@ else
fi
fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
-
-
-
-
-
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_static_works=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_static_works=yes
- fi
- else
- lt_cv_prog_compiler_static_works=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
-$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
- :
-else
- lt_prog_compiler_static=
-fi
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
lt_cv_prog_compiler_c_o=no
- $RM -r conftest 2>/dev/null
+ $rm -r conftest 2>/dev/null
mkdir conftest
cd conftest
mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -9261,95 +7406,86 @@ else
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7412: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ echo "$as_me:7416: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+ $SED '/^$/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o=yes
fi
fi
- chmod u+w . 2>&5
- $RM conftest*
+ chmod u+w .
+ $rm conftest*
# SGI C++ compiler will create directory out/ii_files/ for
# template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
cd ..
- $RM -r conftest
- $RM conftest*
+ rmdir conftest
+ $rm conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
hard_links="nottested"
if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
# do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
hard_links=yes
- $RM conftest*
+ $rm conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
touch conftest.a
ln conftest.a conftest.b 2>&5 || hard_links=no
ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
if test "$hard_links" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
need_locks=warn
fi
else
need_locks=no
fi
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
runpath_var=
allow_undefined_flag=
- always_export_symbols=no
+ enable_shared_with_static_runtimes=no
archive_cmds=
archive_expsym_cmds=
- compiler_needs_object=no
- enable_shared_with_static_runtimes=no
+ old_archive_From_new_cmds=
+ old_archive_from_expsyms_cmds=
export_dynamic_flag_spec=
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- hardcode_automatic=no
- hardcode_direct=no
- hardcode_direct_absolute=no
+ whole_archive_flag_spec=
+ thread_safe_flag_spec=
hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
hardcode_libdir_separator=
+ hardcode_direct=no
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
- inherit_rpath=no
link_all_deplibs=unknown
+ hardcode_automatic=no
module_cmds=
module_expsym_cmds=
- old_archive_from_new_cmds=
- old_archive_from_expsyms_cmds=
- thread_safe_flag_spec=
- whole_archive_flag_spec=
+ always_export_symbols=no
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
include_expsyms=
@@ -9357,17 +7493,26 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
- # Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
+ # Just being paranoid about ensuring that cc_basename is set.
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | pw32*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
@@ -9375,46 +7520,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
with_gnu_ld=no
fi
;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
openbsd*)
with_gnu_ld=no
;;
- linux* | k*bsd*-gnu | gnu*)
- link_all_deplibs=no
- ;;
esac
ld_shlibs=yes
-
- # On some targets, GNU ld is compatible enough with the native linker
- # that we're better off using the native interface for both.
- lt_use_gnu_ld_interface=no
if test "$with_gnu_ld" = yes; then
- case $host_os in
- aix*)
- # The AIX port of GNU ld has always aspired to compatibility
- # with the native linker. However, as the warning in the GNU ld
- # block says, versions before 2.19.5* couldn't really create working
- # shared libraries, regardless of the interface used.
- case `$LD -v 2>&1` in
- *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
- *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
- *\ \(GNU\ Binutils\)\ [3-9]*) ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- fi
-
- if test "$lt_use_gnu_ld_interface" = yes; then
# If archive_cmds runs LD, not CC, wlarc should be empty
wlarc='${wl}'
@@ -9422,17 +7534,16 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
export_dynamic_flag_spec='${wl}--export-dynamic'
# ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec=
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
fi
supports_anon_versioning=no
- case `$LD -v 2>&1` in
- *GNU\ gold*) supports_anon_versioning=yes ;;
+ case `$LD -v 2>/dev/null` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@@ -9442,40 +7553,38 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
# See if GNU ld supports shared libraries.
case $host_os in
- aix[3-9]*)
+ aix3* | aix4* | aix5*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
- cat <<_LT_EOF 1>&2
+ cat <<EOF 1>&2
-*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
*** to be unable to reliably create shared libraries on AIX.
*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
-_LT_EOF
+EOF
fi
;;
amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds=''
- ;;
- m68k)
- archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- ;;
- esac
+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs=no
;;
beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
allow_undefined_flag=unsupported
# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
@@ -9485,19 +7594,17 @@ _LT_EOF
fi
;;
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
# as there is no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
- export_dynamic_flag_spec='${wl}--export-all-symbols'
allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
- exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -9506,120 +7613,56 @@ _LT_EOF
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
else
ld_shlibs=no
fi
;;
- haiku*)
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- link_all_deplibs=yes
- ;;
-
- interix[3-9]*)
- hardcode_direct=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
- tmp_diet=no
- if test "$host_os" = linux-dietlibc; then
- case $cc_basename in
- diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
- esac
- fi
- if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test "$tmp_diet" = no
- then
- tmp_addflag=' $pic_flag'
- tmp_sharedflag='-shared'
+ linux*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ tmp_addflag=
case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec=
;;
- pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group f77 and f90 compilers
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ pgf77* | pgf90* ) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec=
+ tmp_addflag=' -fpic -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
tmp_addflag=' -i_dynamic -nofor_main' ;;
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
- lf95*) # Lahey Fortran 8.1
- whole_archive_flag_spec=
- tmp_sharedflag='--shared' ;;
- xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
- tmp_sharedflag='-qmkshrobj'
- tmp_addflag= ;;
- nvcc*) # Cuda Compiler Driver 2.2
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- compiler_needs_object=yes
- ;;
esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- compiler_needs_object=yes
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- esac
- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test "x$supports_anon_versioning" = xyes; then
- archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
+ archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- case $cc_basename in
- xlf* | bgf* | bgxlf* | mpixlf*)
- # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
- whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- fi
- ;;
- esac
+ if test $supports_anon_versioning = yes; then
+ archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ $echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
else
- ld_shlibs=no
+ ld_shlibs=no
fi
;;
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
- solaris*)
- if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
- cat <<_LT_EOF 1>&2
+ cat <<EOF 1>&2
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
*** create shared libraries on Solaris systems. Therefore, libtool
@@ -9628,46 +7671,15 @@ _LT_EOF
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
-_LT_EOF
- elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
;;
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
- ;;
-
sunos4*)
archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
wlarc=
@@ -9676,9 +7688,9 @@ _LT_EOF
;;
*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
@@ -9701,14 +7713,14 @@ _LT_EOF
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
- aix[4-9]*)
+ aix4* | aix5*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -9718,26 +7730,23 @@ _LT_EOF
else
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
done
- ;;
esac
exp_sym_flag='-bexport'
@@ -9752,54 +7761,49 @@ _LT_EOF
archive_cmds=''
hardcode_direct=yes
- hardcode_direct_absolute=yes
hardcode_libdir_separator=':'
link_all_deplibs=yes
- file_list_spec='${wl}-f,'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
then
- # We have reworked collect2
- :
+ # We have reworked collect2
+ hardcode_direct=yes
else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
fi
- ;;
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
- link_all_deplibs=no
else
# not using gcc
if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
- if test "$aix_use_runtimelinking" = yes; then
+ if test "$aix_use_runtimelinking" = yes; then
shared_flag='${wl}-G'
else
shared_flag='${wl}-bM:SRE'
- fi
+ fi
fi
fi
- export_dynamic_flag_spec='${wl}-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
always_export_symbols=yes
@@ -9807,15 +7811,12 @@ _LT_EOF
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
allow_undefined_flag='-berok'
- # Determine the default libpath from the value encoded in an
- # empty executable.
- if test "${lt_cv_aix_libpath+set}" = set; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
@@ -9826,49 +7827,57 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_="/usr/lib:/lib"
- fi
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
-fi
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- aix_libpath=$lt_cv_aix_libpath_
fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
allow_undefined_flag="-z nodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- if test "${lt_cv_aix_libpath+set}" = set; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
@@ -9879,165 +7888,140 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_="/usr/lib:/lib"
- fi
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
-fi
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- aix_libpath=$lt_cv_aix_libpath_
fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
no_undefined_flag=' ${wl}-bernotok'
allow_undefined_flag=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
- # We only use this code for GNU lds that support --whole-archive.
- whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec='$convenience'
- fi
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec=' '
archive_cmds_need_lc=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds=''
- ;;
- m68k)
- archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- ;;
- esac
+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
;;
bsdi[45]*)
export_dynamic_flag_spec=-rdynamic
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | pw32*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
- case $cc_basename in
- cl*)
- # Native MSVC
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- file_list_spec='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
- enable_shared_with_static_runtimes=yes
- exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
- # Don't use ranlib
- old_postinstall_cmds='chmod 644 $oldlib'
- postlink_cmds='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # Assume MSVC wrapper
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_from_new_cmds='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
- enable_shared_with_static_runtimes=yes
- ;;
- esac
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes=yes
;;
darwin* | rhapsody*)
-
-
- archive_cmds_need_lc=no
- hardcode_direct=no
- hardcode_automatic=yes
- hardcode_shlibpath_var=unsupported
- if test "$lt_cv_ld_force_load" = "yes"; then
- whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-
- else
- whole_archive_flag_spec=''
- fi
- link_all_deplibs=yes
- allow_undefined_flag="$_lt_dar_allow_undefined"
- case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test "$_lt_dar_can_shared" = "yes"; then
- output_verbose_link_cmd=func_echo_all
- archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-
- else
- ld_shlibs=no
- fi
-
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec=''
+ link_all_deplibs=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
;;
dgux*)
@@ -10046,6 +8030,10 @@ fi
hardcode_shlibpath_var=no
;;
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
@@ -10058,7 +8046,7 @@ fi
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2.*)
+ freebsd2*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
hardcode_minus_L=yes
@@ -10066,8 +8054,8 @@ fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
@@ -10075,9 +8063,9 @@ fi
hpux9*)
if test "$GCC" = yes; then
- archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
- archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
@@ -10089,101 +8077,48 @@ fi
export_dynamic_flag_spec='${wl}-E'
;;
- hpux10*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- export_dynamic_flag_spec='${wl}-E'
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
- ia64*)
- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
*)
- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
;;
*)
-
- # Older versions of the 11.00 compiler do not understand -b yet
- # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
-$as_echo_n "checking if $CC understands -b... " >&6; }
-if ${lt_cv_prog_compiler__b+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler__b=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -b"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler__b=yes
- fi
- else
- lt_cv_prog_compiler__b=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
-$as_echo "$lt_cv_prog_compiler__b" >&6; }
-
-if test x"$lt_cv_prog_compiler__b" = xyes; then
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-fi
-
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
;;
esac
fi
if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
-
- case $host_cpu in
- hppa*64*|ia64*)
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_libdir_separator=:
hardcode_direct=no
hardcode_shlibpath_var=no
;;
+ ia64*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
hardcode_direct=yes
- hardcode_direct_absolute=yes
export_dynamic_flag_spec='${wl}-E'
# hardcode_minus_L: Not really in the search PATH,
@@ -10196,49 +8131,18 @@ fi
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- # Try to use the -exported_symbol ld option, if it does not
- # work, assume that -exports_file does not work either and
- # implicitly export all symbols.
- # This should be the same for all languages, so no per-tag cache variable.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-if ${lt_cv_irix_exported_symbol+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int foo (void) { return 0; }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_irix_exported_symbol=yes
-else
- lt_cv_irix_exported_symbol=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-$as_echo "$lt_cv_irix_exported_symbol" >&6; }
- if test "$lt_cv_irix_exported_symbol" = yes; then
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
- fi
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
fi
- archive_cmds_need_lc='no'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
- inherit_rpath=yes
link_all_deplibs=yes
;;
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
@@ -10256,33 +8160,25 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
hardcode_shlibpath_var=no
;;
- *nto* | *qnx*)
- ;;
-
openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- hardcode_direct_absolute=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- esac
- fi
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
else
- ld_shlibs=no
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
fi
;;
@@ -10290,19 +8186,18 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
allow_undefined_flag=unsupported
- archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
;;
osf3*)
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
fi
- archive_cmds_need_lc='no'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
@@ -10310,59 +8205,57 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
# Both c and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
- archive_cmds_need_lc='no'
hardcode_libdir_separator=:
;;
+ sco3.2v5*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
solaris*)
- no_undefined_flag=' -z defs'
+ no_undefined_flag=' -z text'
if test "$GCC" = yes; then
wlarc='${wl}'
- archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
else
- case `$CC -V 2>&1` in
- *"Compilers 5.0"*)
- wlarc=''
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
- ;;
- *)
- wlarc='${wl}'
- archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- ;;
- esac
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
fi
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
- fi
- ;;
+ # The compiler driver will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl, iff we do not link with $LD.
+ # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ case $wlarc in
+ '')
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ *)
+ whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ esac ;;
esac
link_all_deplibs=yes
;;
@@ -10419,45 +8312,36 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag='${wl}-z,text'
- archive_cmds_need_lc=no
+ sysv4.2uw2*)
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=no
hardcode_shlibpath_var=no
- runpath_var='LD_RUN_PATH'
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ no_undefined_flag='${wl}-z ${wl}text'
if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
;;
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag='${wl}-z,text'
- allow_undefined_flag='${wl}-z,nodefs'
- archive_cmds_need_lc=no
+ sysv5*)
+ no_undefined_flag=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ hardcode_libdir_flag_spec=
hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-R,$libdir'
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- export_dynamic_flag_spec='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
;;
uts4*)
@@ -10470,35 +8354,16 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
ld_shlibs=no
;;
esac
-
- if test x$host_vendor = xsni; then
- case $host in
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- ;;
- esac
- fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
+echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6
test "$ld_shlibs" = no && can_build_shared=no
-with_gnu_ld=$with_gnu_ld
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
#
# Do we need to explicitly link libc?
@@ -10517,276 +8382,3847 @@ x|xyes)
# Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- $RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl
- pic_flag=$lt_prog_compiler_pic
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag
- allow_undefined_flag=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- then
- lt_cv_archive_cmds_need_lc=no
- else
- lt_cv_archive_cmds_need_lc=yes
- fi
- allow_undefined_flag=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc=no
+ else
+ archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
- archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
;;
esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # find out which ABI we are using
+ libsuff=
+ case "$host_cpu" in
+ x86_64*|s390x*|powerpc64*)
+ echo '#line 8797 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *64-bit*)
+ libsuff=64
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
;;
esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+ test -n "$runpath_var" || \
+ test "X$hardcode_automatic" = "Xyes" ; then
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6
+if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
+fi
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+ darwin*)
+ # if libdl is installed we need to link against it
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define shl_load innocuous_shl_load
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+#undef shl_load
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+int
+main ()
+{
+return f != shl_load;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+ lt_cv_dlopen="shl_load"
+else
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+ echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define dlopen innocuous_dlopen
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+#undef dlopen
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+int
+main ()
+{
+return f != dlopen;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+ lt_cv_dlopen="dlopen"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_svld_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_dld_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 9668 "configure"
+#include "confdefs.h"
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+#include <stdio.h>
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 9766 "configure"
+#include "confdefs.h"
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+#include <stdio.h>
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+ fi
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+# Report which librarie types wil actually be built
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+test "$can_build_shared" = "no" && enable_shared=no
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+aix4* | aix5*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler \
+ CC \
+ LD \
+ lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
+ lt_prog_compiler_static \
+ lt_prog_compiler_no_builtin_flag \
+ export_dynamic_flag_spec \
+ thread_safe_flag_spec \
+ whole_archive_flag_spec \
+ enable_shared_with_static_runtimes \
+ old_archive_cmds \
+ old_archive_from_new_cmds \
+ predep_objects \
+ postdep_objects \
+ predeps \
+ postdeps \
+ compiler_lib_search_path \
+ archive_cmds \
+ archive_expsym_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ old_archive_from_expsyms_cmds \
+ allow_undefined_flag \
+ no_undefined_flag \
+ export_symbols_cmds \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+ hardcode_automatic \
+ module_cmds \
+ module_expsym_cmds \
+ lt_cv_prog_compiler_c_o \
+ exclude_expsyms \
+ include_expsyms; do
+
+ case $var in
+ old_archive_cmds | \
+ old_archive_from_new_cmds | \
+ archive_cmds | \
+ archive_expsym_cmds | \
+ module_cmds | \
+ module_expsym_cmds | \
+ old_archive_from_expsyms_cmds | \
+ export_symbols_cmds | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+ cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+# A sed program that does not truncate output.
+SED=$lt_SED
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# The names of the tagged configurations supported by this script.
+available_tags=
+# ### BEGIN LIBTOOL CONFIG
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+# A C compiler.
+LTCC=$lt_LTCC
+# A language-specific compiler.
+CC=$lt_compiler
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+# An ERE matcher.
+EGREP=$lt_EGREP
+# The linker used to build libraries.
+LD=$lt_LD
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+# A BSD-compatible nm program.
+NM=$lt_NM
+# A symbol stripping program
+STRIP=$lt_STRIP
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+# Used on cygwin: assembler.
+AS="$AS"
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+# Object file suffix (normally "o").
+objext="$ac_objext"
+# Old archive suffix (normally "a").
+libext="$libext"
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+# Executable file suffix (normally "").
+exeext="$exeext"
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+# Do we need a version for libraries?
+need_version=$need_version
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+# Library versioning type.
+version_type=$version_type
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-if test "$GCC" = yes; then
case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
esac
- case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
- *) lt_sed_strip_eq="s,=/,/,g" ;;
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags or --without-tags was given.
+if test "${with_tags+set}" = set; then
+ withval="$with_tags"
+ tagnames="$withval"
+fi;
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+ else
+ { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+ fi
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+ "") ;;
+ *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
- case $lt_search_path_spec in
- *\;*)
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+ lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
;;
*)
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
;;
esac
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+elif test "$with_gnu_ld" = yes; then
+ echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
fi
done
- lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[lt_foo]++; }
- if (lt_freq[lt_foo] == 1) { print lt_foo; }
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_CXX=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+ld_shlibs_CXX=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_CXX=''
+ hardcode_direct_CXX=yes
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct_CXX=yes
+ else
+ # We have old collect2
+ hardcode_direct_CXX=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_CXX=yes
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ hardcode_libdir_separator_CXX=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_CXX=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_CXX='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_CXX="-z nodefs"
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
- # AWK program above erroneously prepends '/' to C:/dos/paths
- # for these hosts.
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_CXX=' ${wl}-bernotok'
+ allow_undefined_flag_CXX=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols_CXX=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_CXX=' '
+ archive_cmds_need_lc_CXX=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=no
+ enable_shared_with_static_runtimes_CXX=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ archive_cmds_need_lc_CXX=no
+ hardcode_direct_CXX=no
+ hardcode_automatic_CXX=yes
+ hardcode_shlibpath_var_CXX=unsupported
+ whole_archive_flag_spec_CXX=''
+ link_all_deplibs_CXX=yes
+
+ if test "$GXX" = yes ; then
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ freebsd[12]*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ ld_shlibs_CXX=no
+ ;;
+ freebsd-elf*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ ld_shlibs_CXX=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+ hardcode_libdir_separator_CXX=:
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ ;;
+ esac
+ fi
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ ;;
+ ia64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ *)
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ ia64*|hppa*64*)
+ archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ link_all_deplibs_CXX=yes
+ ;;
+ esac
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc*)
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ archive_cmds_need_lc_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC*)
+ # Portland Group C++ compiler
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX=''
+ ;;
+ cxx*)
+ # Compaq C++
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ esac
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ ld_shlibs_CXX=no
+ ;;
+ openbsd*)
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd='echo'
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx*)
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx*)
+ allow_undefined_flag_CXX=' -expect_unresolved \*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+ $rm $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ sco*)
+ archive_cmds_need_lc_CXX=no
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_shlibpath_var_CXX=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The C++ compiler is used as linker so we must use $wl
+ # flag to pass the commands to the underlying system
+ # linker. We must also pass each convience library through
+ # to the system linker between allextract/defaultextract.
+ # The C++ compiler will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ link_all_deplibs_CXX=yes
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ fi
+ ;;
+ esac
+ ;;
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_path_CXX="${prev}${p}"
+ else
+ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$postdeps_CXX"; then
+ postdeps_CXX="${prev}${p}"
+ else
+ postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$predep_objects_CXX"; then
+ predep_objects_CXX="$p"
+ else
+ predep_objects_CXX="$predep_objects_CXX $p"
+ fi
+ else
+ if test -z "$postdep_objects_CXX"; then
+ postdep_objects_CXX="$p"
+ else
+ postdep_objects_CXX="$postdep_objects_CXX $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ fi
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | os2* | pw32*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_CXX=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix4* | aix5*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ lt_prog_compiler_pic_CXX='-qnocommon'
+ lt_prog_compiler_wl_CXX='-Wl,'
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ if test "$host_cpu" != ia64; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ icpc* | ecpc*)
+ # Intel C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ pgCC*)
+ # Portland Group C++ compiler.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fpic'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ sco*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ unixware*)
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:12014: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:12018: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+ $SED '/^$/d' conftest.err >conftest.er2
+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
+else
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:12076: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:12080: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+ $SED '/^$/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ aix4* | aix5*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ export_symbols_cmds_CXX="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
esac
- sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_CXX=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_CXX in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_CXX
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+ allow_undefined_flag_CXX=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_CXX=no
+ else
+ archive_cmds_need_lc_CXX=yes
+ fi
+ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
library_names_spec=
libname_spec='lib$name'
soname_spec=
@@ -10800,6 +12236,20 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -10809,7 +12259,7 @@ need_version=unknown
case $host_os in
aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
shlibpath_var=LIBPATH
@@ -10817,8 +12267,8 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix[4-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
+aix4* | aix5*)
+ version_type=linux
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
@@ -10836,7 +12286,7 @@ aix[4-9]*)
aix4 | aix4.[01] | aix4.[01].*)
if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
echo ' yes '
- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
:
else
can_build_shared=no
@@ -10862,18 +12312,9 @@ aix[4-9]*)
;;
amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
;;
beos*)
@@ -10883,7 +12324,7 @@ beos*)
;;
bsdi[45]*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
@@ -10896,112 +12337,60 @@ bsdi[45]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | pw32*)
version_type=windows
shrext_cmds=".dll"
need_version=no
need_lib_prefix=no
- case $GCC,$cc_basename in
- yes,*)
- # gcc
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
+ $install_prog $dir/$dlname \$dldir/$dlname'
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
- $RM \$dlpath'
+ $rm \$dlpath'
shlibpath_overrides_runpath=yes
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
;;
- mingw* | cegcc*)
+ mingw*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
;;
esac
- dynamic_linker='Win32 ld.exe'
- ;;
-
- *,cl*)
- # Native MSVC
- libname_spec='$name'
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- library_names_spec='${libname}.dll.lib'
-
- case $build_os in
- mingw*)
- sys_lib_search_path_spec=
- lt_save_ifs=$IFS
- IFS=';'
- for lt_path in $LIB
- do
- IFS=$lt_save_ifs
- # Let DOS variable expansion print the short 8.3 style file name.
- lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
- sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
- done
- IFS=$lt_save_ifs
- # Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
- ;;
- cygwin*)
- # Convert to unix form, then to dos form, then back to unix form
- # but this time dos style (no spaces!) so that the unix form looks
- # like /cygdrive/c/PROGRA~1:/cygdr...
- sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
- sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
- sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- ;;
- *)
- sys_lib_search_path_spec="$LIB"
- if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # FIXME: find the short name or the path components, as spaces are
- # common. (e.g. "Program Files" -> "PROGRA~1")
- ;;
- esac
-
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
- dynamic_linker='Win32 link.exe'
;;
*)
- # Assume MSVC wrapper
library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- dynamic_linker='Win32 ld.exe'
;;
esac
+ dynamic_linker='Win32 ld.exe'
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
@@ -11011,18 +12400,22 @@ darwin* | rhapsody*)
version_type=darwin
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -11030,17 +12423,26 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[23].*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
version_type=freebsd-$objformat
case $version_type in
freebsd-elf*)
@@ -11055,46 +12457,27 @@ freebsd* | dragonfly*)
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
- freebsd2.*)
+ freebsd2*)
shlibpath_overrides_runpath=yes
;;
freebsd3.[01]* | freebsdelf3.[01]*)
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ *) # from 3.2 on
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
esac
;;
gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- dynamic_linker="$host_os runtime_loader"
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
@@ -11104,7 +12487,7 @@ hpux9* | hpux10* | hpux11*)
version_type=sunos
need_lib_prefix=no
need_version=no
- case $host_cpu in
+ case "$host_cpu" in
ia64*)
shrext_cmds='.so'
hardcode_into_libs=yes
@@ -11120,18 +12503,18 @@ hpux9* | hpux10* | hpux11*)
fi
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
shrext_cmds='.sl'
dynamic_linker="$host_os dld.sl"
shlibpath_var=SHLIB_PATH
@@ -11140,22 +12523,8 @@ hpux9* | hpux10* | hpux11*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
postinstall_cmds='chmod 555 $lib'
- # or fails outright, so override atomically:
- install_override_mode=555
- ;;
-
-interix[3-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
;;
irix5* | irix6* | nonstopux*)
@@ -11163,7 +12532,7 @@ irix5* | irix6* | nonstopux*)
nonstopux*) version_type=nonstopux ;;
*)
if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
else
version_type=irix
fi ;;
@@ -11200,9 +12569,9 @@ linux*oldld* | linux*aout* | linux*coff*)
dynamic_linker=no
;;
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
- version_type=linux # correct to gnu/linux during the next big refactor
+# This must be Linux ELF.
+linux*)
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -11210,50 +12579,36 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
-
- # Some binutils ld are patched to set DT_RUNPATH
- if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_shlibpath_overrides_runpath=no
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
- LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
- lt_cv_shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
-
-fi
-
- shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
hardcode_into_libs=yes
+ # find out which ABI we are using
+ libsuff=
+ case "$host_cpu" in
+ x86_64*|s390x*|powerpc64*)
+ echo '#line 12591 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *64-bit*)
+ libsuff=64
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -11265,7 +12620,7 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
-netbsdelf*-gnu)
+knetbsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -11274,14 +12629,14 @@ netbsdelf*-gnu)
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
+ dynamic_linker='GNU ld.so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
@@ -11296,37 +12651,30 @@ netbsd*)
;;
newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
;;
-*nto* | *qnx*)
- version_type=qnx
+nto-qnx*)
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
+ shlibpath_overrides_runpath=yes
;;
openbsd*)
version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
+ need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
openbsd2.[89] | openbsd2.[89].*)
shlibpath_overrides_runpath=no
@@ -11360,12 +12708,15 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
-rdos*)
- dynamic_linker=no
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
;;
solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -11389,8 +12740,8 @@ sunos4*)
need_version=yes
;;
-sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -11398,6 +12749,7 @@ sysv4 | sysv4.3*)
sni)
shlibpath_overrides_runpath=no
need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
runpath_var=LD_RUN_PATH
;;
siemens)
@@ -11414,48 +12766,3296 @@ sysv4 | sysv4.3*)
sysv4*MP*)
if test -d /usr/nec ;then
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
soname_spec='$libname${shared_ext}.$major'
shlibpath_var=LD_LIBRARY_PATH
fi
;;
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+ test -n "$runpath_var_CXX" || \
+ test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_CXX" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+ test "$hardcode_minus_L_CXX" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_CXX=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_CXX=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_CXX=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6
+
+if test "$hardcode_action_CXX" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+ lt_cv_dlopen="shl_load"
+else
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+ echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+ lt_cv_dlopen="dlopen"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_svld_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_dld_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 13462 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 13560 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_CXX \
+ CC_CXX \
+ LD_CXX \
+ lt_prog_compiler_wl_CXX \
+ lt_prog_compiler_pic_CXX \
+ lt_prog_compiler_static_CXX \
+ lt_prog_compiler_no_builtin_flag_CXX \
+ export_dynamic_flag_spec_CXX \
+ thread_safe_flag_spec_CXX \
+ whole_archive_flag_spec_CXX \
+ enable_shared_with_static_runtimes_CXX \
+ old_archive_cmds_CXX \
+ old_archive_from_new_cmds_CXX \
+ predep_objects_CXX \
+ postdep_objects_CXX \
+ predeps_CXX \
+ postdeps_CXX \
+ compiler_lib_search_path_CXX \
+ archive_cmds_CXX \
+ archive_expsym_cmds_CXX \
+ postinstall_cmds_CXX \
+ postuninstall_cmds_CXX \
+ old_archive_from_expsyms_cmds_CXX \
+ allow_undefined_flag_CXX \
+ no_undefined_flag_CXX \
+ export_symbols_cmds_CXX \
+ hardcode_libdir_flag_spec_CXX \
+ hardcode_libdir_flag_spec_ld_CXX \
+ hardcode_libdir_separator_CXX \
+ hardcode_automatic_CXX \
+ module_cmds_CXX \
+ module_expsym_cmds_CXX \
+ lt_cv_prog_compiler_c_o_CXX \
+ exclude_expsyms_CXX \
+ include_expsyms_CXX; do
+
+ case $var in
+ old_archive_cmds_CXX | \
+ old_archive_from_new_cmds_CXX | \
+ archive_cmds_CXX | \
+ archive_expsym_cmds_CXX | \
+ module_cmds_CXX | \
+ module_expsym_cmds_CXX | \
+ old_archive_from_expsyms_cmds_CXX | \
+ export_symbols_cmds_CXX | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=" program t\n end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+aix4* | aix5*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_static_F77='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_F77='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared_F77=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_F77=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ else
+ lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ lt_prog_compiler_pic_F77='-qnocommon'
+ lt_prog_compiler_wl_F77='-Wl,'
+ ;;
+ esac
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_F77='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ linux*)
+ case $cc_basename in
+ icc* | ecc*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-static'
+ ;;
+ pgcc* | pgf77* | pgf90*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-fpic'
+ lt_prog_compiler_static_F77='-static'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ lt_prog_compiler_pic_F77='-Kpic'
+ lt_prog_compiler_static_F77='-dn'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl_F77='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl_F77='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl_F77='-Qoption ld '
+ lt_prog_compiler_pic_F77='-PIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic_F77='-Kconform_pic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_can_build_shared_F77=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic_F77='-pic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared_F77=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works_F77=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_F77"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:14445: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:14449: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+ $SED '/^$/d' conftest.err >conftest.er2
+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_pic_works_F77=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+ case $lt_prog_compiler_pic_F77 in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+ esac
+else
+ lt_prog_compiler_pic_F77=
+ lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_F77=
+ ;;
+ *)
+ lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_c_o_F77=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:14507: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:14511: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+ $SED '/^$/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_F77=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ runpath_var=
+ allow_undefined_flag_F77=
+ enable_shared_with_static_runtimes_F77=no
+ archive_cmds_F77=
+ archive_expsym_cmds_F77=
+ old_archive_From_new_cmds_F77=
+ old_archive_from_expsyms_cmds_F77=
+ export_dynamic_flag_spec_F77=
+ whole_archive_flag_spec_F77=
+ thread_safe_flag_spec_F77=
+ hardcode_libdir_flag_spec_F77=
+ hardcode_libdir_flag_spec_ld_F77=
+ hardcode_libdir_separator_F77=
+ hardcode_direct_F77=no
+ hardcode_minus_L_F77=no
+ hardcode_shlibpath_var_F77=unsupported
+ link_all_deplibs_F77=unknown
+ hardcode_automatic_F77=no
+ module_cmds_F77=
+ module_expsym_cmds_F77=
+ always_export_symbols_F77=no
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms_F77=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+ # Just being paranoid about ensuring that cc_basename is set.
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_F77=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_F77=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_F77=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs_F77=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_F77=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=no
+ enable_shared_with_static_runtimes_F77=yes
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ linux*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ tmp_addflag=
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec_F77=
+ ;;
+ pgf77* | pgf90* ) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec_F77=
+ tmp_addflag=' -fpic -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ esac
+ archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test $supports_anon_versioning = yes; then
+ archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ $echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs_F77=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ sunos4*)
+ archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs_F77" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec_F77=
+ export_dynamic_flag_spec_F77=
+ whole_archive_flag_spec_F77=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=yes
+ archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_F77=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_F77=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_F77=''
+ hardcode_direct_F77=yes
+ hardcode_libdir_separator_F77=':'
+ link_all_deplibs_F77=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct_F77=yes
+ else
+ # We have old collect2
+ hardcode_direct_F77=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_F77=yes
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_libdir_separator_F77=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_F77=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_F77='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_f77_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_F77="-z nodefs"
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_f77_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_F77=' ${wl}-bernotok'
+ allow_undefined_flag_F77=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols_F77=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_F77=' '
+ archive_cmds_need_lc_F77=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs_F77=no
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec_F77=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_F77=' '
+ allow_undefined_flag_F77=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds_F77='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes_F77=yes
+ ;;
+
+ darwin* | rhapsody*)
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ archive_cmds_need_lc_F77=no
+ hardcode_direct_F77=no
+ hardcode_automatic_F77=yes
+ hardcode_shlibpath_var_F77=unsupported
+ whole_archive_flag_spec_F77=''
+ link_all_deplibs_F77=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ ld_shlibs_F77=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs_F77=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ ;;
+ *)
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ link_all_deplibs_F77=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ newsos6)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ openbsd*)
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_F77='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ allow_undefined_flag_F77=unsupported
+ archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag_F77=' -expect_unresolved \*'
+ archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag_F77=' -expect_unresolved \*'
+ archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec_F77='-rpath $libdir'
+ fi
+ hardcode_libdir_separator_F77=:
+ ;;
+
+ sco3.2v5*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ export_dynamic_flag_spec_F77='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ no_undefined_flag_F77=' -z text'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ wlarc=''
+ archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_shlibpath_var_F77=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl, iff we do not link with $LD.
+ # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ case $wlarc in
+ '')
+ whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+ *)
+ whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ esac ;;
+ esac
+ link_all_deplibs_F77=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_F77='$CC -r -o $output$reload_objs'
+ hardcode_direct_F77=no
+ ;;
+ motorola)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ export_dynamic_flag_spec_F77='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_F77=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=no
+ hardcode_shlibpath_var_F77=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ no_undefined_flag_F77='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv5*)
+ no_undefined_flag_F77=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ hardcode_libdir_flag_spec_F77=
+ hardcode_shlibpath_var_F77=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ *)
+ ld_shlibs_F77=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_F77=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_F77 in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_F77
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+ allow_undefined_flag_F77=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_F77=no
+ else
+ archive_cmds_need_lc_F77=yes
+ fi
+ allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # find out which ABI we are using
+ libsuff=
+ case "$host_cpu" in
+ x86_64*|s390x*|powerpc64*)
+ echo '#line 15872 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *64-bit*)
+ libsuff=64
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
;;
- esac
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
fi
- sys_lib_dlsearch_path_spec='/usr/lib'
;;
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
need_lib_prefix=no
need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
;;
uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -11465,143 +16065,2521 @@ uts4*)
dynamic_linker=no
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+ test -n "$runpath_var_F77" || \
+ test "X$hardcode_automatic_F77" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_F77" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+ test "$hardcode_minus_L_F77" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_F77=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_F77=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_F77=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6
+
+if test "$hardcode_action_F77" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
+fi
+
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_F77 \
+ CC_F77 \
+ LD_F77 \
+ lt_prog_compiler_wl_F77 \
+ lt_prog_compiler_pic_F77 \
+ lt_prog_compiler_static_F77 \
+ lt_prog_compiler_no_builtin_flag_F77 \
+ export_dynamic_flag_spec_F77 \
+ thread_safe_flag_spec_F77 \
+ whole_archive_flag_spec_F77 \
+ enable_shared_with_static_runtimes_F77 \
+ old_archive_cmds_F77 \
+ old_archive_from_new_cmds_F77 \
+ predep_objects_F77 \
+ postdep_objects_F77 \
+ predeps_F77 \
+ postdeps_F77 \
+ compiler_lib_search_path_F77 \
+ archive_cmds_F77 \
+ archive_expsym_cmds_F77 \
+ postinstall_cmds_F77 \
+ postuninstall_cmds_F77 \
+ old_archive_from_expsyms_cmds_F77 \
+ allow_undefined_flag_F77 \
+ no_undefined_flag_F77 \
+ export_symbols_cmds_F77 \
+ hardcode_libdir_flag_spec_F77 \
+ hardcode_libdir_flag_spec_ld_F77 \
+ hardcode_libdir_separator_F77 \
+ hardcode_automatic_F77 \
+ module_cmds_F77 \
+ module_expsym_cmds_F77 \
+ lt_cv_prog_compiler_c_o_F77 \
+ exclude_expsyms_F77 \
+ include_expsyms_F77; do
+
+ case $var in
+ old_archive_cmds_F77 | \
+ old_archive_from_new_cmds_F77 | \
+ archive_cmds_F77 | \
+ archive_expsym_cmds_F77 | \
+ module_cmds_F77 | \
+ module_expsym_cmds_F77 | \
+ old_archive_from_expsyms_cmds_F77 | \
+ export_symbols_cmds_F77 | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+old_archive_cmds_GCJ=$old_archive_cmds
+
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+ lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:16645: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:16649: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+ $SED '/^$/d' conftest.err >conftest.er2
+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $rm conftest*
+
fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+ :
fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
fi
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_static_GCJ='-static'
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ fi
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_GCJ='-fno-common'
+ ;;
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared_GCJ=no
+ enable_shared=no
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_GCJ=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ else
+ lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ lt_prog_compiler_pic_GCJ='-qnocommon'
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ ;;
+ esac
+ ;;
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+ newsos6)
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+ linux*)
+ case $cc_basename in
+ icc* | ecc*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-static'
+ ;;
+ pgcc* | pgf77* | pgf90*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-fpic'
+ lt_prog_compiler_static_GCJ='-static'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+ esac
+ ;;
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+ sco3.2v5*)
+ lt_prog_compiler_pic_GCJ='-Kpic'
+ lt_prog_compiler_static_GCJ='-dn'
+ ;;
+ solaris*)
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl_GCJ='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl_GCJ='-Wl,';;
+ esac
+ ;;
+ sunos4*)
+ lt_prog_compiler_wl_GCJ='-Qoption ld '
+ lt_prog_compiler_pic_GCJ='-PIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic_GCJ='-Kconform_pic'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ fi
+ ;;
+ unicos*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_can_build_shared_GCJ=no
+ ;;
+ uts4*)
+ lt_prog_compiler_pic_GCJ='-pic'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_GCJ=no
+ ;;
+ esac
+ fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works_GCJ=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:16907: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:16911: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+ $SED '/^$/d' conftest.err >conftest.er2
+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_pic_works_GCJ=yes
+ fi
+ fi
+ $rm conftest*
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+ case $lt_prog_compiler_pic_GCJ in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+ esac
+else
+ lt_prog_compiler_pic_GCJ=
+ lt_prog_compiler_can_build_shared_GCJ=no
+fi
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_GCJ=
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+ ;;
+esac
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_c_o_GCJ=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:16969: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:16973: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+ $SED '/^$/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_GCJ=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+ runpath_var=
+ allow_undefined_flag_GCJ=
+ enable_shared_with_static_runtimes_GCJ=no
+ archive_cmds_GCJ=
+ archive_expsym_cmds_GCJ=
+ old_archive_From_new_cmds_GCJ=
+ old_archive_from_expsyms_cmds_GCJ=
+ export_dynamic_flag_spec_GCJ=
+ whole_archive_flag_spec_GCJ=
+ thread_safe_flag_spec_GCJ=
+ hardcode_libdir_flag_spec_GCJ=
+ hardcode_libdir_flag_spec_ld_GCJ=
+ hardcode_libdir_separator_GCJ=
+ hardcode_direct_GCJ=no
+ hardcode_minus_L_GCJ=no
+ hardcode_shlibpath_var_GCJ=unsupported
+ link_all_deplibs_GCJ=unknown
+ hardcode_automatic_GCJ=no
+ module_cmds_GCJ=
+ module_expsym_cmds_GCJ=
+ always_export_symbols_GCJ=no
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms_GCJ=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+ # Just being paranoid about ensuring that cc_basename is set.
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+ ld_shlibs_GCJ=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_GCJ=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_GCJ=no
+ cat <<EOF 1>&2
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+EOF
+ fi
+ ;;
+ amigaos*)
+ archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs_GCJ=no
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_GCJ=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ allow_undefined_flag_GCJ=unsupported
+ always_export_symbols_GCJ=no
+ enable_shared_with_static_runtimes_GCJ=yes
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+ linux*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ tmp_addflag=
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec_GCJ=
+ ;;
+ pgf77* | pgf90* ) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec_GCJ=
+ tmp_addflag=' -fpic -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ esac
+ archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test $supports_anon_versioning = yes; then
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ $echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs_GCJ=no
+ cat <<EOF 1>&2
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+ sunos4*)
+ archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs_GCJ" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec_GCJ=
+ export_dynamic_flag_spec_GCJ=
+ whole_archive_flag_spec_GCJ=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_GCJ=unsupported
+ always_export_symbols_GCJ=yes
+ archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_GCJ=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_GCJ=unsupported
+ fi
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+ archive_cmds_GCJ=''
+ hardcode_direct_GCJ=yes
+ hardcode_libdir_separator_GCJ=':'
+ link_all_deplibs_GCJ=yes
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct_GCJ=yes
+ else
+ # We have old collect2
+ hardcode_direct_GCJ=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_GCJ=yes
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_libdir_separator_GCJ=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_GCJ=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_GCJ='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int
+main ()
+{
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_GCJ="-z nodefs"
+ archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int
+main ()
+{
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_GCJ=' ${wl}-bernotok'
+ allow_undefined_flag_GCJ=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols_GCJ=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_GCJ=' '
+ archive_cmds_need_lc_GCJ=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+ amigaos*)
+ archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs_GCJ=no
+ ;;
+ bsdi[45]*)
+ export_dynamic_flag_spec_GCJ=-rdynamic
+ ;;
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_GCJ=' '
+ allow_undefined_flag_GCJ=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds_GCJ='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes_GCJ=yes
+ ;;
+ darwin* | rhapsody*)
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ archive_cmds_need_lc_GCJ=no
+ hardcode_direct_GCJ=no
+ hardcode_automatic_GCJ=yes
+ hardcode_shlibpath_var_GCJ=unsupported
+ whole_archive_flag_spec_GCJ=''
+ link_all_deplibs_GCJ=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ ld_shlibs_GCJ=no
+ ;;
+ esac
+ fi
+ ;;
+ dgux*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+ freebsd1*)
+ ld_shlibs_GCJ=no
+ ;;
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_direct_GCJ=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ ;;
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_direct_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_direct_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ ;;
+ *)
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_direct_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ link_all_deplibs_GCJ=yes
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+ newsos6)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_shlibpath_var_GCJ=no
+ ;;
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
- test -n "$runpath_var" ||
- test "X$hardcode_automatic" = "Xyes" ; then
+ openbsd*)
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ ;;
+ *)
+ archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
- # We can hardcode non-existent directories.
- if test "$hardcode_direct" != no &&
+ os2*)
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+ allow_undefined_flag_GCJ=unsupported
+ archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag_GCJ=' -expect_unresolved \*'
+ archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag_GCJ=' -expect_unresolved \*'
+ archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+ fi
+ hardcode_libdir_separator_GCJ=:
+ ;;
+
+ sco3.2v5*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ no_undefined_flag_GCJ=' -z text'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ wlarc=''
+ archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl, iff we do not link with $LD.
+ # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ case $wlarc in
+ '')
+ whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+ *)
+ whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ esac ;;
+ esac
+ link_all_deplibs_GCJ=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+ hardcode_direct_GCJ=no
+ ;;
+ motorola)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ export_dynamic_flag_spec_GCJ='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_GCJ=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ no_undefined_flag_GCJ='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv5*)
+ no_undefined_flag_GCJ=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ hardcode_libdir_flag_spec_GCJ=
+ hardcode_shlibpath_var_GCJ=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ *)
+ ld_shlibs_GCJ=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6
+test "$ld_shlibs_GCJ" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_GCJ=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_GCJ in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_GCJ
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+ allow_undefined_flag_GCJ=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_GCJ=no
+ else
+ archive_cmds_need_lc_GCJ=yes
+ fi
+ allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # find out which ABI we are using
+ libsuff=
+ case "$host_cpu" in
+ x86_64*|s390x*|powerpc64*)
+ echo '#line 18354 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *64-bit*)
+ libsuff=64
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+ test -n "$runpath_var_GCJ" || \
+ test "X$hardcode_automatic_GCJ" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_GCJ" != no &&
# If the only mechanism to avoid hardcoding is shlibpath_var, we
# have to relink, otherwise we might link with an installed library
# when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
- test "$hardcode_minus_L" != no; then
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+ test "$hardcode_minus_L_GCJ" != no; then
# Linking always hardcodes the temporary library directory.
- hardcode_action=relink
+ hardcode_action_GCJ=relink
else
# We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action=immediate
+ hardcode_action_GCJ=immediate
fi
else
# We cannot hardcode anything, or else we can only hardcode existing
# directories.
- hardcode_action=unsupported
+ hardcode_action_GCJ=unsupported
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
+echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6
-if test "$hardcode_action" = relink ||
- test "$inherit_rpath" = yes; then
+if test "$hardcode_action_GCJ" = relink; then
# Fast installation is not supported
enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes ||
@@ -11610,12 +18588,36 @@ elif test "$shlibpath_overrides_runpath" = yes ||
enable_fast_install=needless
fi
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
+fi
-
-
-
-
- if test "x$enable_dlopen" != xyes; then
+if test "x$enable_dlopen" != xyes; then
enable_dlopen=unknown
enable_dlopen_self=unknown
enable_dlopen_self_static=unknown
@@ -11630,55 +18632,83 @@ else
lt_cv_dlopen_self=yes
;;
- mingw* | pw32* | cegcc*)
+ mingw* | pw32*)
lt_cv_dlopen="LoadLibrary"
lt_cv_dlopen_libs=
- ;;
+ ;;
cygwin*)
lt_cv_dlopen="dlopen"
lt_cv_dlopen_libs=
- ;;
+ ;;
darwin*)
# if libdl is installed we need to link against it
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char dlopen ();
int
main ()
{
-return dlopen ();
+dlopen ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_dl_dlopen=yes
else
- ac_cv_lib_dl_dlopen=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
@@ -11688,172 +18718,462 @@ else
fi
- ;;
+ ;;
*)
- ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = xyes; then :
+ echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
lt_cv_dlopen="shl_load"
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char shl_load ();
int
main ()
{
-return shl_load ();
+shl_load ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_dld_shl_load=yes
else
- ac_cv_lib_dld_shl_load=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
else
- ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = xyes; then :
+ echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
lt_cv_dlopen="dlopen"
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char dlopen ();
int
main ()
{
-return dlopen ();
+dlopen ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_dl_dlopen=yes
else
- ac_cv_lib_dl_dlopen=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if ${ac_cv_lib_svld_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsvld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char dlopen ();
int
main ()
{
-return dlopen ();
+dlopen ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_svld_dlopen=yes
else
- ac_cv_lib_svld_dlopen=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if ${ac_cv_lib_dld_dld_link+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char dld_link ();
int
main ()
{
-return dld_link ();
+dld_link ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_dld_dld_link=yes
else
- ac_cv_lib_dld_dld_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
fi
@@ -11886,23 +19206,23 @@ fi
test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
save_LIBS="$LIBS"
LIBS="$lt_cv_dlopen_libs $LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then :
lt_cv_dlopen_self=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 19225 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11943,13 +19263,11 @@ else
# endif
#endif
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+#ifdef __cplusplus
+extern "C" void exit (int);
#endif
-int fnord () { return 42; }
+void fnord() { int i=42;}
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -11958,30 +19276,24 @@ int main ()
if (self)
{
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
/* dlclose (self); */
}
- else
- puts (dlerror ());
- return status;
+ exit (status);
}
-_LT_EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
lt_status=$?
case x$lt_status in
x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
esac
else :
# compilation failed
@@ -11992,23 +19304,23 @@ rm -fr conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self_static+:} false; then :
- $as_echo_n "(cached) " >&6
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then :
lt_cv_dlopen_self_static=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 19323 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12049,13 +19361,11 @@ else
# endif
#endif
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+#ifdef __cplusplus
+extern "C" void exit (int);
#endif
-int fnord () { return 42; }
+void fnord() { int i=42;}
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -12064,30 +19374,24 @@ int main ()
if (self)
{
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
/* dlclose (self); */
}
- else
- puts (dlerror ());
- return status;
+ exit (status);
}
-_LT_EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
lt_status=$?
case x$lt_status in
x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
esac
else :
# compilation failed
@@ -12098,8 +19402,8 @@ rm -fr conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
fi
CPPFLAGS="$save_CPPFLAGS"
@@ -12120,103 +19424,886 @@ $as_echo "$lt_cv_dlopen_self_static" >&6; }
fi
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_GCJ \
+ CC_GCJ \
+ LD_GCJ \
+ lt_prog_compiler_wl_GCJ \
+ lt_prog_compiler_pic_GCJ \
+ lt_prog_compiler_static_GCJ \
+ lt_prog_compiler_no_builtin_flag_GCJ \
+ export_dynamic_flag_spec_GCJ \
+ thread_safe_flag_spec_GCJ \
+ whole_archive_flag_spec_GCJ \
+ enable_shared_with_static_runtimes_GCJ \
+ old_archive_cmds_GCJ \
+ old_archive_from_new_cmds_GCJ \
+ predep_objects_GCJ \
+ postdep_objects_GCJ \
+ predeps_GCJ \
+ postdeps_GCJ \
+ compiler_lib_search_path_GCJ \
+ archive_cmds_GCJ \
+ archive_expsym_cmds_GCJ \
+ postinstall_cmds_GCJ \
+ postuninstall_cmds_GCJ \
+ old_archive_from_expsyms_cmds_GCJ \
+ allow_undefined_flag_GCJ \
+ no_undefined_flag_GCJ \
+ export_symbols_cmds_GCJ \
+ hardcode_libdir_flag_spec_GCJ \
+ hardcode_libdir_flag_spec_ld_GCJ \
+ hardcode_libdir_separator_GCJ \
+ hardcode_automatic_GCJ \
+ module_cmds_GCJ \
+ module_expsym_cmds_GCJ \
+ lt_cv_prog_compiler_c_o_GCJ \
+ exclude_expsyms_GCJ \
+ include_expsyms_GCJ; do
+
+ case $var in
+ old_archive_cmds_GCJ | \
+ old_archive_from_new_cmds_GCJ | \
+ archive_cmds_GCJ | \
+ archive_expsym_cmds_GCJ | \
+ module_cmds_GCJ | \
+ module_expsym_cmds_GCJ | \
+ old_archive_from_expsyms_cmds_GCJ | \
+ export_symbols_cmds_GCJ | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+cfgfile="$ofile"
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
-striplib=
-old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- ;;
- esac
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+CC="$lt_save_CC"
+ else
+ tagname=""
+ fi
+ ;;
+ RC)
+# Source file extension for RC test sources.
+ac_ext=rc
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
- # Report which library types will actually be built
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
- test "$can_build_shared" = "no" && enable_shared=no
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
+# Allow CC to be a program name with arguments.
+compiler=$CC
- aix[4-9]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_RC \
+ CC_RC \
+ LD_RC \
+ lt_prog_compiler_wl_RC \
+ lt_prog_compiler_pic_RC \
+ lt_prog_compiler_static_RC \
+ lt_prog_compiler_no_builtin_flag_RC \
+ export_dynamic_flag_spec_RC \
+ thread_safe_flag_spec_RC \
+ whole_archive_flag_spec_RC \
+ enable_shared_with_static_runtimes_RC \
+ old_archive_cmds_RC \
+ old_archive_from_new_cmds_RC \
+ predep_objects_RC \
+ postdep_objects_RC \
+ predeps_RC \
+ postdeps_RC \
+ compiler_lib_search_path_RC \
+ archive_cmds_RC \
+ archive_expsym_cmds_RC \
+ postinstall_cmds_RC \
+ postuninstall_cmds_RC \
+ old_archive_from_expsyms_cmds_RC \
+ allow_undefined_flag_RC \
+ no_undefined_flag_RC \
+ export_symbols_cmds_RC \
+ hardcode_libdir_flag_spec_RC \
+ hardcode_libdir_flag_spec_ld_RC \
+ hardcode_libdir_separator_RC \
+ hardcode_automatic_RC \
+ module_cmds_RC \
+ module_expsym_cmds_RC \
+ lt_cv_prog_compiler_c_o_RC \
+ exclude_expsyms_RC \
+ include_expsyms_RC; do
+
+ case $var in
+ old_archive_cmds_RC | \
+ old_archive_from_new_cmds_RC | \
+ archive_cmds_RC | \
+ archive_expsym_cmds_RC | \
+ module_cmds_RC | \
+ module_expsym_cmds_RC | \
+ old_archive_from_expsyms_cmds_RC | \
+ export_symbols_cmds_RC | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+# ### END LIBTOOL TAG CONFIG: $tagname
+__EOF__
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
fi
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -12225,6 +20312,44 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
CC="$lt_save_CC"
+ ;;
+
+ *)
+ { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
+ fi
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+ { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
@@ -12239,23 +20364,26 @@ CC="$lt_save_CC"
- ac_config_commands="$ac_config_commands libtool"
-# Only expand once:
CPPFLAGS="${CPPFLAGS} -D_REENTRANT -D__EXTENSIONS__"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
+# Checks for header files.
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
@@ -12270,23 +20398,51 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_header_stdc=yes
else
- ac_cv_header_stdc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <string.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
else
ac_cv_header_stdc=no
fi
@@ -12296,14 +20452,18 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdlib.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
+ $EGREP "free" >/dev/null 2>&1; then
+ :
else
ac_cv_header_stdc=no
fi
@@ -12313,13 +20473,16 @@ fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then
:
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ctype.h>
-#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -12339,40 +20502,59 @@ main ()
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
- return 2;
- return 0;
+ exit(2);
+ exit (0);
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
else
- ac_cv_header_stdc=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
-$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
-if ${ac_cv_header_sys_wait_h+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6
+if test "${ac_cv_header_sys_wait_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/wait.h>
#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
@@ -12388,32 +20570,219 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_header_sys_wait_h=yes
else
- ac_cv_header_sys_wait_h=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_sys_wait_h=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5
-$as_echo "$ac_cv_header_sys_wait_h" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
if test $ac_cv_header_sys_wait_h = yes; then
-$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYS_WAIT_H 1
+_ACEOF
fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
for ac_header in arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \
sys/socket.h sys/time.h unistd.h sys/sendfile.h sys/uio.h \
getopt.h sys/epoll.h sys/select.h poll.h sys/poll.h sys/devpoll.h sys/filio.h \
-sys/mman.h sys/event.h port.h pwd.h sys/syslimits.h \
-sys/resource.h sys/un.h syslog.h sys/prctl.h uuid/uuid.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+sys/mman.h sys/event.h sys/port.h pwd.h sys/syslimits.h \
+sys/resource.h sys/un.h syslog.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -12421,25 +20790,30 @@ fi
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
+# Checks for typedefs, structures, and compiler characteristics.
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
-
+/* FIXME: Include the comments suggested by Paul. */
#ifndef __cplusplus
- /* Ultrix mips cc rejects this sort of thing. */
+ /* Ultrix mips cc rejects this. */
typedef int charset[2];
- const charset cs = { 0, 0 };
+ const charset x;
/* SunOS 4.1.1 cc rejects this. */
- char const *const *pcpcc;
- char **ppc;
+ char const *const *ccp;
+ char **p;
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
@@ -12448,18 +20822,16 @@ main ()
an arm of an if-expression whose if-part is not a constant
expression */
const char *g = "string";
- pcpcc = &g + (g ? g-g : 0);
+ ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
- ++pcpcc;
- ppc = (char**) pcpcc;
- pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this sort of thing. */
- char tx;
- char *t = &tx;
+ ++ccp;
+ p = (char**) ccp;
+ ccp = (char const *const *) p;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
- if (s) return 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
int x[] = {25, 17};
@@ -12471,45 +20843,73 @@ main ()
iptr p = 0;
++p;
}
- { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+ { /* AIX XL C 1.02.0.0 rejects this saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; } bx;
- struct s *b = &bx; b->j = 5;
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
- if (!foo) return 0;
}
- return !cs[0] && !zero.x;
#endif
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_const=yes
else
- ac_cv_c_const=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_const=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
if test $ac_cv_c_const = no; then
-$as_echo "#define const /**/" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifndef __cplusplus
typedef int foo_t;
@@ -12518,16 +20918,41 @@ $ac_kw foo_t foo () {return 0; }
#endif
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_inline=$ac_kw
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_inline" != no && break
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+
case $ac_cv_c_inline in
inline | yes) ;;
@@ -12544,53 +20969,193 @@ _ACEOF
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5
-$as_echo_n "checking whether char is unsigned... " >&6; }
-if ${ac_cv_c_char_unsigned+:} false; then :
- $as_echo_n "(cached) " >&6
+
+echo "$as_me:$LINENO: checking whether char is unsigned" >&5
+echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6
+if test "${ac_cv_c_char_unsigned+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((char) -1) < 0)];
-test_array [0] = 0;
-return test_array [0];
+test_array [0] = 0
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_char_unsigned=no
else
- ac_cv_c_char_unsigned=yes
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_char_unsigned=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5
-$as_echo "$ac_cv_c_char_unsigned" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5
+echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6
if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
- $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h
+ cat >>confdefs.h <<\_ACEOF
+#define __CHAR_UNSIGNED__ 1
+_ACEOF
fi
-ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = xyes; then :
+echo "$as_me:$LINENO: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6
+if test "${ac_cv_type_off_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((off_t *) 0)
+ return 0;
+if (sizeof (off_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_off_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_off_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6
+if test $ac_cv_type_off_t = yes; then
+ :
else
cat >>confdefs.h <<_ACEOF
-#define off_t long int
+#define off_t long
_ACEOF
fi
-ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
-if test "x$ac_cv_type_pid_t" = xyes; then :
+echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
+if test "${ac_cv_type_pid_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((pid_t *) 0)
+ return 0;
+if (sizeof (pid_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_pid_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_pid_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+if test $ac_cv_type_pid_t = yes; then
+ :
else
cat >>confdefs.h <<_ACEOF
@@ -12599,29 +21164,242 @@ _ACEOF
fi
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+ return 0;
+if (sizeof (size_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_size_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_size_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+ :
else
cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
+#define size_t unsigned
_ACEOF
fi
-ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include <time.h>
-"
-if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes; then :
+echo "$as_me:$LINENO: checking for struct tm.tm_gmtoff" >&5
+echo $ECHO_N "checking for struct tm.tm_gmtoff... $ECHO_C" >&6
+if test "${ac_cv_member_struct_tm_tm_gmtoff+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <time.h>
-$as_echo "#define HAVE_STRUCT_TM_GMTOFF 1" >>confdefs.h
+int
+main ()
+{
+static struct tm ac_aggr;
+if (ac_aggr.tm_gmtoff)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_tm_tm_gmtoff=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <time.h>
+
+int
+main ()
+{
+static struct tm ac_aggr;
+if (sizeof ac_aggr.tm_gmtoff)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_tm_tm_gmtoff=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_struct_tm_tm_gmtoff=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5
+echo "${ECHO_T}$ac_cv_member_struct_tm_tm_gmtoff" >&6
+if test $ac_cv_member_struct_tm_tm_gmtoff = yes; then
-ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include <sys/socket.h>
-"
-if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRUCT_TM_GMTOFF 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5
+echo $ECHO_N "checking for struct sockaddr_storage... $ECHO_C" >&6
+if test "${ac_cv_type_struct_sockaddr_storage+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/socket.h>
+
+int
+main ()
+{
+if ((struct sockaddr_storage *) 0)
+ return 0;
+if (sizeof (struct sockaddr_storage))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_struct_sockaddr_storage=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_struct_sockaddr_storage=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_storage" >&5
+echo "${ECHO_T}$ac_cv_type_struct_sockaddr_storage" >&6
+if test $ac_cv_type_struct_sockaddr_storage = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
@@ -12630,10 +21408,65 @@ _ACEOF
fi
-ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include <sys/types.h>
+echo "$as_me:$LINENO: checking for socklen_t" >&5
+echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6
+if test "${ac_cv_type_socklen_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
#include <sys/socket.h>
-"
-if test "x$ac_cv_type_socklen_t" = xyes; then :
+
+int
+main ()
+{
+if ((socklen_t *) 0)
+ return 0;
+if (sizeof (socklen_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_socklen_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_socklen_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
+echo "${ECHO_T}$ac_cv_type_socklen_t" >&6
+if test $ac_cv_type_socklen_t = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_SOCKLEN_T 1
@@ -12643,65 +21476,309 @@ _ACEOF
fi
-for ac_header in vfork.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
-if test "x$ac_cv_header_vfork_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_VFORK_H 1
+# Checks for library functions.
+
+
+for ac_header in unistd.h vfork.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_header_compiler=no
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
-done
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-for ac_func in fork vfork
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
+
done
-if test "x$ac_cv_func_fork" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
-$as_echo_n "checking for working fork... " >&6; }
-if ${ac_cv_func_fork_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_func_fork_works=cross
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+
+for ac_func in fork vfork
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
int
main ()
{
-
- /* By Ruediger Kuhlmann. */
- return fork () < 0;
-
+return f != $ac_func;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_func_fork_works=yes
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
else
- ac_cv_func_fork_works=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
-$as_echo "$ac_cv_func_fork_works" >&6; }
+done
+
+if test "x$ac_cv_func_fork" = xyes; then
+ echo "$as_me:$LINENO: checking for working fork" >&5
+echo $ECHO_N "checking for working fork... $ECHO_C" >&6
+if test "${ac_cv_func_fork_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_fork_works=cross
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* By Ruediger Kuhlmann. */
+ #include <sys/types.h>
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+ /* Some systems only have a dummy stub for fork() */
+ int main ()
+ {
+ if (fork() < 0)
+ exit (1);
+ exit (0);
+ }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_fork_works=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_fork_works=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
+echo "${ECHO_T}$ac_cv_func_fork_works" >&6
else
ac_cv_func_fork_works=$ac_cv_func_fork
@@ -12716,25 +21793,35 @@ if test "x$ac_cv_func_fork_works" = xcross; then
ac_cv_func_fork_works=yes
;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
-$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
if test "x$ac_cv_func_vfork" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
-$as_echo_n "checking for working vfork... " >&6; }
-if ${ac_cv_func_vfork_works+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for working vfork" >&5
+echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
+if test "${ac_cv_func_vfork_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then
ac_cv_func_vfork_works=cross
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Thanks to Paul Eggert for this test. */
-$ac_includes_default
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <sys/wait.h>
-#ifdef HAVE_VFORK_H
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#if HAVE_VFORK_H
# include <vfork.h>
#endif
/* On some sparc systems, changes by the child to local and incoming
@@ -12805,7 +21892,7 @@ main ()
while (wait(&status) != child)
;
- return (
+ exit(
/* Was there some problem with vforking? */
child < 0
@@ -12821,109 +21908,182 @@ main ()
}
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_func_vfork_works=yes
else
- ac_cv_func_vfork_works=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_vfork_works=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
-$as_echo "$ac_cv_func_vfork_works" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
+echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
fi;
if test "x$ac_cv_func_fork_works" = xcross; then
ac_cv_func_vfork_works=$ac_cv_func_vfork
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
-$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
fi
if test "x$ac_cv_func_vfork_works" = xyes; then
-$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WORKING_VFORK 1
+_ACEOF
else
-$as_echo "#define vfork fork" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define vfork fork
+_ACEOF
fi
if test "x$ac_cv_func_fork_works" = xyes; then
-$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WORKING_FORK 1
+_ACEOF
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
-$as_echo_n "checking return type of signal handlers... " >&6; }
-if ${ac_cv_type_signal+:} false; then :
- $as_echo_n "(cached) " >&6
+#AC_FUNC_MMAP
+echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+if test "${ac_cv_type_signal+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <signal.h>
+#ifdef signal
+# undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
int
main ()
{
-return *(signal (0, 0)) (0) == 1;
+int i;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_type_signal=int
-else
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_type_signal=void
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_signal=int
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
-$as_echo "$ac_cv_type_signal" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6
cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
_ACEOF
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
-$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
-if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5
+echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6
+if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
rm -f conftest.sym conftest.file
echo >conftest.file
if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then
ac_cv_func_lstat_dereferences_slashed_symlink=no
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
struct stat sbuf;
- /* Linux will dereference the symlink and fail, as required by POSIX.
+ /* Linux will dereference the symlink and fail.
That is better in the sense that it means we will not
have to compile and use the lstat wrapper. */
- return lstat ("conftest.sym/", &sbuf) == 0;
+ exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_func_lstat_dereferences_slashed_symlink=yes
else
- ac_cv_func_lstat_dereferences_slashed_symlink=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_lstat_dereferences_slashed_symlink=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
else
# If the `ln -s' command failed, then we probably don't even
# have an lstat function.
@@ -12932,8 +22092,8 @@ fi
rm -f conftest.sym conftest.file
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
-$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
+echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6
test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
@@ -12942,52 +22102,73 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
- case " $LIBOBJS " in
+if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
+ case $LIBOBJS in
+ "lstat.$ac_objext" | \
+ *" lstat.$ac_objext" | \
+ "lstat.$ac_objext "* | \
*" lstat.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
- ;;
+ *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;;
esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5
-$as_echo_n "checking whether stat accepts an empty string... " >&6; }
-if ${ac_cv_func_stat_empty_string_bug+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5
+echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6
+if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then
ac_cv_func_stat_empty_string_bug=yes
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
struct stat sbuf;
- return stat ("", &sbuf) == 0;
+ exit (stat ("", &sbuf) ? 1 : 0);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_func_stat_empty_string_bug=no
-else
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_func_stat_empty_string_bug=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_stat_empty_string_bug=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5
-$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5
+echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6
if test $ac_cv_func_stat_empty_string_bug = yes; then
- case " $LIBOBJS " in
+ case $LIBOBJS in
+ "stat.$ac_objext" | \
+ *" stat.$ac_objext" | \
+ "stat.$ac_objext "* | \
*" stat.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS stat.$ac_objext"
- ;;
+ *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;;
esac
@@ -12997,501 +22178,207 @@ _ACEOF
fi
+
for ac_func in strftime
-do :
- ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
-if test "x$ac_cv_func_strftime" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_STRFTIME 1
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
-
-else
- # strftime is in -lintl on SCO UNIX.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
-$as_echo_n "checking for strftime in -lintl... " >&6; }
-if ${ac_cv_lib_intl_strftime+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char strftime ();
-int
-main ()
-{
-return strftime ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_intl_strftime=yes
-else
- ac_cv_lib_intl_strftime=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
-$as_echo "$ac_cv_lib_intl_strftime" >&6; }
-if test "x$ac_cv_lib_intl_strftime" = xyes; then :
- $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
-
-LIBS="-lintl $LIBS"
-fi
-
-fi
-done
-
-for ac_func in issetugid inet_pton
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-if test -z "$PKG_CONFIG"; then
- # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
- ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libev support" >&5
-$as_echo_n "checking for libev support... " >&6; }
-
-# Check whether --with-libev was given.
-if test "${with_libev+set}" = set; then :
- withval=$with_libev; WITH_LIBEV=$withval
-else
- WITH_LIBEV=no
-fi
-
-
-LIBEV_CFLAGS=""
-LIBEV_LIBS=""
-
-if test "$WITH_LIBEV" != "no"; then
-
-
-
-
-
-
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
- ac_pt_PKG_CONFIG=$PKG_CONFIG
- # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $ac_pt_PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_pt_PKG_CONFIG" = x; then
- PKG_CONFIG=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- PKG_CONFIG=$ac_pt_PKG_CONFIG
- fi
-else
- PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-fi
-if test -n "$PKG_CONFIG"; then
- _pkg_min_version=0.9.0
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- PKG_CONFIG=""
- fi
-fi
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBEV" >&5
-$as_echo_n "checking for LIBEV... " >&6; }
-
-if test -n "$LIBEV_CFLAGS"; then
- pkg_cv_LIBEV_CFLAGS="$LIBEV_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libev\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libev") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LIBEV_CFLAGS=`$PKG_CONFIG --cflags "libev" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$LIBEV_LIBS"; then
- pkg_cv_LIBEV_LIBS="$LIBEV_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libev\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libev") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LIBEV_LIBS=`$PKG_CONFIG --libs "libev" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- LIBEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libev" 2>&1`
- else
- LIBEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libev" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$LIBEV_PKG_ERRORS" >&5
-
-
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
- if test "$WITH_LIBEV" != "yes"; then
- LIBEV_CFLAGS="-I$WITH_LIBEV/include"
- LIBEV_LIBS="-L$WITH_LIBEV/lib -lev"
- else
- for ac_header in ev.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "ev.h" "ac_cv_header_ev_h" "$ac_includes_default"
-if test "x$ac_cv_header_ev_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_EV_H 1
-_ACEOF
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ev_time in -lev" >&5
-$as_echo_n "checking for ev_time in -lev... " >&6; }
-if ${ac_cv_lib_ev_ev_time+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lev $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+#undef $ac_func
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-char ev_time ();
+
int
main ()
{
-return ev_time ();
+return f != $ac_func;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ev_ev_time=yes
-else
- ac_cv_lib_ev_ev_time=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ev_ev_time" >&5
-$as_echo "$ac_cv_lib_ev_ev_time" >&6; }
-if test "x$ac_cv_lib_ev_ev_time" = xyes; then :
-
- LIBEV_CFLAGS=""
- LIBEV_LIBS="-lev"
-
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- as_fn_error $? "libev not found" "$LINENO" 5
-
-
+eval "$as_ac_var=no"
fi
-
-else
-
- as_fn_error $? "libev not found" "$LINENO" 5
-
-
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-
-done
-
- fi
-
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-
- if test "$WITH_LIBEV" != "yes"; then
- LIBEV_CFLAGS="-I$WITH_LIBEV/include"
- LIBEV_LIBS="-L$WITH_LIBEV/lib -lev"
- else
- for ac_header in ev.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "ev.h" "ac_cv_header_ev_h" "$ac_includes_default"
-if test "x$ac_cv_header_ev_h" = xyes; then :
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_EV_H 1
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ev_time in -lev" >&5
-$as_echo_n "checking for ev_time in -lev... " >&6; }
-if ${ac_cv_lib_ev_ev_time+:} false; then :
- $as_echo_n "(cached) " >&6
+else
+ # strftime is in -lintl on SCO UNIX.
+echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
+echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6
+if test "${ac_cv_lib_intl_strftime+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lev $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+LIBS="-lintl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
-char ev_time ();
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strftime ();
int
main ()
{
-return ev_time ();
+strftime ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ev_ev_time=yes
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_intl_strftime=yes
else
- ac_cv_lib_ev_ev_time=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_intl_strftime=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ev_ev_time" >&5
-$as_echo "$ac_cv_lib_ev_ev_time" >&6; }
-if test "x$ac_cv_lib_ev_ev_time" = xyes; then :
-
- LIBEV_CFLAGS=""
- LIBEV_LIBS="-lev"
-
-else
-
- as_fn_error $? "libev not found" "$LINENO" 5
-
+echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6
+if test $ac_cv_lib_intl_strftime = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRFTIME 1
+_ACEOF
+LIBS="-lintl $LIBS"
fi
-else
-
- as_fn_error $? "libev not found" "$LINENO" 5
-
-
fi
-
done
- fi
-
-else
- LIBEV_CFLAGS=$pkg_cv_LIBEV_CFLAGS
- LIBEV_LIBS=$pkg_cv_LIBEV_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-fi
-
-
-$as_echo "#define HAVE_LIBEV 1" >>confdefs.h
-
-fi
-
-
-
MYSQL_INCLUDE=""
MYSQL_LIBS=""
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MySQL support" >&5
-$as_echo_n "checking for MySQL support... " >&6; }
+echo "$as_me:$LINENO: checking for MySQL support" >&5
+echo $ECHO_N "checking for MySQL support... $ECHO_C" >&6
-# Check whether --with-mysql was given.
-if test "${with_mysql+set}" = set; then :
- withval=$with_mysql; WITH_MYSQL=$withval
+# Check whether --with-mysql or --without-mysql was given.
+if test "${with_mysql+set}" = set; then
+ withval="$with_mysql"
+ WITH_MYSQL=$withval
else
WITH_MYSQL=no
-fi
-
+fi;
if test "$WITH_MYSQL" != "no"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
if test "$WITH_MYSQL" = "yes"; then
# Extract the first word of "mysql_config", so it can be a program name with args.
set dummy mysql_config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MYSQL_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MYSQL_CONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
case $MYSQL_CONFIG in
[\\/]* | ?:[\\/]*)
@@ -13503,38 +22390,41 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_MYSQL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
;;
esac
fi
MYSQL_CONFIG=$ac_cv_path_MYSQL_CONFIG
+
if test -n "$MYSQL_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_CONFIG" >&5
-$as_echo "$MYSQL_CONFIG" >&6; }
+ echo "$as_me:$LINENO: result: $MYSQL_CONFIG" >&5
+echo "${ECHO_T}$MYSQL_CONFIG" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
else
MYSQL_CONFIG=$WITH_MYSQL
fi
if test "$MYSQL_CONFIG" = ""; then
- as_fn_error $? "mysql_config is not found" "$LINENO" 5
+ { { echo "$as_me:$LINENO: error: mysql_config is not found" >&5
+echo "$as_me: error: mysql_config is not found" >&2;}
+ { (exit 1); exit 1; }; }
fi
if test \! -x $MYSQL_CONFIG; then
- as_fn_error use --with-mysql=path-to-mysql_config "mysql_config not exists or not executable" "$LINENO" 5
+ { { echo "$as_me:$LINENO: error: mysql_config not exists or not executable" >&5
+echo "$as_me: error: mysql_config not exists or not executable" >&2;}
+ { (exit use --with-mysql=path-to-mysql_config); exit use --with-mysql=path-to-mysql_config; }; }
fi
if $MYSQL_CONFIG | grep -- '--include' > /dev/null ; then
@@ -13544,24 +22434,162 @@ fi
fi
MYSQL_LIBS="`$MYSQL_CONFIG --libs | sed s/\'//g`"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MySQL includes at" >&5
-$as_echo_n "checking for MySQL includes at... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_INCLUDE" >&5
-$as_echo "$MYSQL_INCLUDE" >&6; }
+ echo "$as_me:$LINENO: checking for MySQL includes at" >&5
+echo $ECHO_N "checking for MySQL includes at... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $MYSQL_INCLUDE" >&5
+echo "${ECHO_T}$MYSQL_INCLUDE" >&6
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MySQL libraries at" >&5
-$as_echo_n "checking for MySQL libraries at... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_LIBS" >&5
-$as_echo "$MYSQL_LIBS" >&6; }
+ echo "$as_me:$LINENO: checking for MySQL libraries at" >&5
+echo $ECHO_N "checking for MySQL libraries at... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $MYSQL_LIBS" >&5
+echo "${ECHO_T}$MYSQL_LIBS" >&6
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE"
- for ac_header in errmsg.h mysql.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+
+
+for ac_header in errmsg.h mysql.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -13571,83 +22599,252 @@ done
CPPFLAGS="$old_CPPFLAGS"
-$as_echo "#define HAVE_MYSQL 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MYSQL 1
+_ACEOF
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDAP support" >&5
-$as_echo_n "checking for LDAP support... " >&6; }
+echo "$as_me:$LINENO: checking for LDAP support" >&5
+echo $ECHO_N "checking for LDAP support... $ECHO_C" >&6
-# Check whether --with-ldap was given.
-if test "${with_ldap+set}" = set; then :
- withval=$with_ldap; WITH_LDAP=$withval
+# Check whether --with-ldap or --without-ldap was given.
+if test "${with_ldap+set}" = set; then
+ withval="$with_ldap"
+ WITH_LDAP=$withval
else
WITH_LDAP=no
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
-$as_echo "$withval" >&6; }
+fi;
+echo "$as_me:$LINENO: result: $withval" >&5
+echo "${ECHO_T}$withval" >&6
if test "$WITH_LDAP" != "no"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
-$as_echo_n "checking for ldap_bind in -lldap... " >&6; }
-if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for ldap_bind in -lldap" >&5
+echo $ECHO_N "checking for ldap_bind in -lldap... $ECHO_C" >&6
+if test "${ac_cv_lib_ldap_ldap_bind+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lldap $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char ldap_bind ();
int
main ()
{
-return ldap_bind ();
+ldap_bind ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_ldap_ldap_bind=yes
else
- ac_cv_lib_ldap_ldap_bind=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ldap_ldap_bind=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
-$as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
-if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_bind" >&5
+echo "${ECHO_T}$ac_cv_lib_ldap_ldap_bind" >&6
+if test $ac_cv_lib_ldap_ldap_bind = yes; then
- for ac_header in ldap.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
-if test "x$ac_cv_header_ldap_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LDAP_H 1
+
+for ac_header in ldap.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- LDAP_LIB=-lldap
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-$as_echo "#define HAVE_LIBLDAP 1" >>confdefs.h
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
- $as_echo "#define HAVE_LDAP_H 1" >>confdefs.h
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+ LDAP_LIB=-lldap
-$as_echo "#define LDAP_DEPRECATED 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBLDAP 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LDAP_H 1
+_ACEOF
fi
@@ -13658,57 +22855,227 @@ done
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ber_printf in -llber" >&5
-$as_echo_n "checking for ber_printf in -llber... " >&6; }
-if ${ac_cv_lib_lber_ber_printf+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for ber_printf in -llber" >&5
+echo $ECHO_N "checking for ber_printf in -llber... $ECHO_C" >&6
+if test "${ac_cv_lib_lber_ber_printf+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-llber $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char ber_printf ();
int
main ()
{
-return ber_printf ();
+ber_printf ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_lber_ber_printf=yes
else
- ac_cv_lib_lber_ber_printf=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_lber_ber_printf=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lber_ber_printf" >&5
-$as_echo "$ac_cv_lib_lber_ber_printf" >&6; }
-if test "x$ac_cv_lib_lber_ber_printf" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_lber_ber_printf" >&5
+echo "${ECHO_T}$ac_cv_lib_lber_ber_printf" >&6
+if test $ac_cv_lib_lber_ber_printf = yes; then
+
+
+for ac_header in lber.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
- for ac_header in lber.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "lber.h" "ac_cv_header_lber_h" "$ac_includes_default"
-if test "x$ac_cv_header_lber_h" = xyes; then :
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_LBER_H 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
LBER_LIB=-llber
-$as_echo "#define HAVE_LIBLBER 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBLBER 1
+_ACEOF
- $as_echo "#define HAVE_LBER_H 1" >>confdefs.h
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LBER_H 1
+_ACEOF
fi
@@ -13721,70 +23088,240 @@ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for extended attributes support" >&5
-$as_echo_n "checking for extended attributes support... " >&6; }
+echo "$as_me:$LINENO: checking for extended attributes support" >&5
+echo $ECHO_N "checking for extended attributes support... $ECHO_C" >&6
-# Check whether --with-attr was given.
-if test "${with_attr+set}" = set; then :
- withval=$with_attr; WITH_ATTR=$withval
+# Check whether --with-attr or --without-attr was given.
+if test "${with_attr+set}" = set; then
+ withval="$with_attr"
+ WITH_ATTR=$withval
else
WITH_ATTR=no
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
-$as_echo "$withval" >&6; }
+fi;
+echo "$as_me:$LINENO: result: $withval" >&5
+echo "${ECHO_T}$withval" >&6
if test "$WITH_ATTR" != "no"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for attr_get in -lattr" >&5
-$as_echo_n "checking for attr_get in -lattr... " >&6; }
-if ${ac_cv_lib_attr_attr_get+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for attr_get in -lattr" >&5
+echo $ECHO_N "checking for attr_get in -lattr... $ECHO_C" >&6
+if test "${ac_cv_lib_attr_attr_get+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lattr $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char attr_get ();
int
main ()
{
-return attr_get ();
+attr_get ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_attr_attr_get=yes
else
- ac_cv_lib_attr_attr_get=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_attr_attr_get=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_attr_get" >&5
-$as_echo "$ac_cv_lib_attr_attr_get" >&6; }
-if test "x$ac_cv_lib_attr_attr_get" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_attr_attr_get" >&5
+echo "${ECHO_T}$ac_cv_lib_attr_attr_get" >&6
+if test $ac_cv_lib_attr_attr_get = yes; then
+
+
+for ac_header in attr/attributes.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
- for ac_header in attr/attributes.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "attr/attributes.h" "ac_cv_header_attr_attributes_h" "$ac_includes_default"
-if test "x$ac_cv_header_attr_attributes_h" = xyes; then :
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTR_ATTRIBUTES_H 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
ATTR_LIB=-lattr
-$as_echo "#define HAVE_XATTR 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XATTR 1
+_ACEOF
- $as_echo "#define HAVE_ATTR_ATTRIBUTES_H 1" >>confdefs.h
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ATTR_ATTRIBUTES_H 1
+_ACEOF
fi
@@ -13797,236 +23334,655 @@ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
-$as_echo_n "checking for library containing socket... " >&6; }
-if ${ac_cv_search_socket+:} false; then :
- $as_echo_n "(cached) " >&6
+## openssl on solaris needs -lsocket -lnsl
+echo "$as_me:$LINENO: checking for library containing socket" >&5
+echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6
+if test "${ac_cv_search_socket+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ac_cv_search_socket=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char socket ();
int
main ()
{
-return socket ();
+socket ();
;
return 0;
}
_ACEOF
-for ac_lib in '' socket; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_socket=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_socket+:} false; then :
- break
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_socket="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-done
-if ${ac_cv_search_socket+:} false; then :
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_socket" = no; then
+ for ac_lib in socket; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char socket ();
+int
+main ()
+{
+socket ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_socket="-l$ac_lib"
+break
else
- ac_cv_search_socket=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
fi
-rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
-$as_echo "$ac_cv_search_socket" >&6; }
-ac_res=$ac_cv_search_socket
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5
+echo "${ECHO_T}$ac_cv_search_socket" >&6
+if test "$ac_cv_search_socket" != no; then
+ test "$ac_cv_search_socket" = "none required" || LIBS="$ac_cv_search_socket $LIBS"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
-$as_echo_n "checking for library containing gethostbyname... " >&6; }
-if ${ac_cv_search_gethostbyname+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
+echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6
+if test "${ac_cv_search_gethostbyname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ac_cv_search_gethostbyname=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char gethostbyname ();
int
main ()
{
-return gethostbyname ();
+gethostbyname ();
;
return 0;
}
_ACEOF
-for ac_lib in '' nsl socket; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_gethostbyname=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_gethostbyname+:} false; then :
- break
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_gethostbyname="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-done
-if ${ac_cv_search_gethostbyname+:} false; then :
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_gethostbyname" = no; then
+ for ac_lib in nsl socket; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_gethostbyname="-l$ac_lib"
+break
else
- ac_cv_search_gethostbyname=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
fi
-rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
-$as_echo "$ac_cv_search_gethostbyname" >&6; }
-ac_res=$ac_cv_search_gethostbyname
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6
+if test "$ac_cv_search_gethostbyname" != no; then
+ test "$ac_cv_search_gethostbyname" = "none required" || LIBS="$ac_cv_search_gethostbyname $LIBS"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing hstrerror" >&5
-$as_echo_n "checking for library containing hstrerror... " >&6; }
-if ${ac_cv_search_hstrerror+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for library containing hstrerror" >&5
+echo $ECHO_N "checking for library containing hstrerror... $ECHO_C" >&6
+if test "${ac_cv_search_hstrerror+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ac_cv_search_hstrerror=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char hstrerror ();
int
main ()
{
-return hstrerror ();
+hstrerror ();
;
return 0;
}
_ACEOF
-for ac_lib in '' resolv; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_hstrerror=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_hstrerror+:} false; then :
- break
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_hstrerror="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-done
-if ${ac_cv_search_hstrerror+:} false; then :
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_hstrerror" = no; then
+ for ac_lib in resolv; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char hstrerror ();
+int
+main ()
+{
+hstrerror ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_hstrerror="-l$ac_lib"
+break
else
- ac_cv_search_hstrerror=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
fi
-rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_hstrerror" >&5
-$as_echo "$ac_cv_search_hstrerror" >&6; }
-ac_res=$ac_cv_search_hstrerror
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_hstrerror" >&5
+echo "${ECHO_T}$ac_cv_search_hstrerror" >&6
+if test "$ac_cv_search_hstrerror" != no; then
+ test "$ac_cv_search_hstrerror" = "none required" || LIBS="$ac_cv_search_hstrerror $LIBS"
fi
save_LIBS=$LIBS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
-$as_echo_n "checking for library containing dlopen... " >&6; }
-if ${ac_cv_search_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for library containing dlopen" >&5
+echo $ECHO_N "checking for library containing dlopen... $ECHO_C" >&6
+if test "${ac_cv_search_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ac_cv_search_dlopen=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_dlopen="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_dlopen" = no; then
+ for ac_lib in dl; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char dlopen ();
int
main ()
{
-return dlopen ();
+dlopen ();
;
return 0;
}
_ACEOF
-for ac_lib in '' dl; do
- if test -z "$ac_lib"; then
- ac_res="none required"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_dlopen="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_dlopen" >&5
+echo "${ECHO_T}$ac_cv_search_dlopen" >&6
+if test "$ac_cv_search_dlopen" != no; then
+ test "$ac_cv_search_dlopen" = "none required" || LIBS="$ac_cv_search_dlopen $LIBS"
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ ac_cpp_err=
fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_dlopen=$ac_res
+else
+ ac_cpp_err=yes
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_dlopen+:} false; then :
- break
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
-done
-if ${ac_cv_search_dlopen+:} false; then :
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_search_dlopen=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
-$as_echo "$ac_cv_search_dlopen" >&6; }
-ac_res=$ac_cv_search_dlopen
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
- for ac_header in dlfcn.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
if test "$ac_cv_search_dlopen" != no; then
@@ -14034,9 +23990,13 @@ _ACEOF
fi
-$as_echo "#define HAVE_LIBDL 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBDL 1
+_ACEOF
- $as_echo "#define HAVE_DLFCN_H 1" >>confdefs.h
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
fi
@@ -14049,25 +24009,163 @@ fi
LIBS=$save_LIBS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for valgrind" >&5
-$as_echo_n "checking for valgrind... " >&6; }
+echo "$as_me:$LINENO: checking for valgrind" >&5
+echo $ECHO_N "checking for valgrind... $ECHO_C" >&6
-# Check whether --with-valgrind was given.
-if test "${with_valgrind+set}" = set; then :
- withval=$with_valgrind; WITH_VALGRIND=$withval
+# Check whether --with-valgrind or --without-valgrind was given.
+if test "${with_valgrind+set}" = set; then
+ withval="$with_valgrind"
+ WITH_VALGRIND=$withval
else
WITH_VALGRIND=no
+fi;
+echo "$as_me:$LINENO: result: $WITH_VALGRIND" >&5
+echo "${ECHO_T}$WITH_VALGRIND" >&6
+if test "$WITH_VALGRIND" != "no"; then
+
+for ac_header in valgrind/valgrind.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_VALGRIND" >&5
-$as_echo "$WITH_VALGRIND" >&6; }
-if test "$WITH_VALGRIND" != "no"; then
- for ac_header in valgrind/valgrind.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h" "ac_cv_header_valgrind_valgrind_h" "$ac_includes_default"
-if test "x$ac_cv_header_valgrind_valgrind_h" = xyes; then :
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_VALGRIND_VALGRIND_H 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -14076,16 +24174,16 @@ done
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL" >&5
-$as_echo_n "checking for OpenSSL... " >&6; }
+echo "$as_me:$LINENO: checking for OpenSSL" >&5
+echo $ECHO_N "checking for OpenSSL... $ECHO_C" >&6
-# Check whether --with-openssl was given.
-if test "${with_openssl+set}" = set; then :
- withval=$with_openssl; WITH_OPENSSL=$withval
+# Check whether --with-openssl or --without-openssl was given.
+if test "${with_openssl+set}" = set; then
+ withval="$with_openssl"
+ WITH_OPENSSL=$withval
else
WITH_OPENSSL=no
-fi
-
+fi;
if test "$WITH_OPENSSL" != "no"; then
use_openssl=yes
@@ -14096,46 +24194,184 @@ if test "$WITH_OPENSSL" != "no"; then
else
use_openssl=no
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_openssl" >&5
-$as_echo "$use_openssl" >&6; }
+echo "$as_me:$LINENO: result: $use_openssl" >&5
+echo "${ECHO_T}$use_openssl" >&6
-# Check whether --with-openssl-includes was given.
-if test "${with_openssl_includes+set}" = set; then :
- withval=$with_openssl_includes; use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval"
-
-fi
-
+# Check whether --with-openssl-includes or --without-openssl-includes was given.
+if test "${with_openssl_includes+set}" = set; then
+ withval="$with_openssl_includes"
+ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval"
+fi;
-# Check whether --with-openssl-libs was given.
-if test "${with_openssl_libs+set}" = set; then :
- withval=$with_openssl_libs; use_openssl=yes LDFLAGS="$LDFLAGS -L$withval"
-fi
+# Check whether --with-openssl-libs or --without-openssl-libs was given.
+if test "${with_openssl_libs+set}" = set; then
+ withval="$with_openssl_libs"
+ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval"
+fi;
-# Check whether --with-kerberos5 was given.
-if test "${with_kerberos5+set}" = set; then :
- withval=$with_kerberos5; use_kerberos=yes
+# Check whether --with-kerberos5 or --without-kerberos5 was given.
+if test "${with_kerberos5+set}" = set; then
+ withval="$with_kerberos5"
+ use_kerberos=yes
else
use_kerberos=no
-fi
-
+fi;
if test "x$use_openssl" = "xyes"; then
if test "x$use_kerberos" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
fi
- for ac_header in openssl/ssl.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_ssl_h" = xyes; then :
+
+for ac_header in openssl/ssl.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_OPENSSL_SSL_H 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -14143,84 +24379,142 @@ fi
done
OLDLIBS="$LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BIO_f_base64 in -lcrypto" >&5
-$as_echo_n "checking for BIO_f_base64 in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_BIO_f_base64+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for BIO_f_base64 in -lcrypto" >&5
+echo $ECHO_N "checking for BIO_f_base64 in -lcrypto... $ECHO_C" >&6
+if test "${ac_cv_lib_crypto_BIO_f_base64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypto $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char BIO_f_base64 ();
int
main ()
{
-return BIO_f_base64 ();
+BIO_f_base64 ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_crypto_BIO_f_base64=yes
else
- ac_cv_lib_crypto_BIO_f_base64=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_crypto_BIO_f_base64=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_BIO_f_base64" >&5
-$as_echo "$ac_cv_lib_crypto_BIO_f_base64" >&6; }
-if test "x$ac_cv_lib_crypto_BIO_f_base64" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_BIO_f_base64" >&5
+echo "${ECHO_T}$ac_cv_lib_crypto_BIO_f_base64" >&6
+if test $ac_cv_lib_crypto_BIO_f_base64 = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5
-$as_echo_n "checking for SSL_new in -lssl... " >&6; }
-if ${ac_cv_lib_ssl_SSL_new+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for SSL_new in -lssl" >&5
+echo $ECHO_N "checking for SSL_new in -lssl... $ECHO_C" >&6
+if test "${ac_cv_lib_ssl_SSL_new+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lssl -lcrypto "$DL_LIB" $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char SSL_new ();
int
main ()
{
-return SSL_new ();
+SSL_new ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_ssl_SSL_new=yes
else
- ac_cv_lib_ssl_SSL_new=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ssl_SSL_new=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_new" >&5
-$as_echo "$ac_cv_lib_ssl_SSL_new" >&6; }
-if test "x$ac_cv_lib_ssl_SSL_new" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_new" >&5
+echo "${ECHO_T}$ac_cv_lib_ssl_SSL_new" >&6
+if test $ac_cv_lib_ssl_SSL_new = yes; then
SSL_LIB="-lssl -lcrypto"
-$as_echo "#define HAVE_LIBSSL /**/" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBSSL
+_ACEOF
fi
@@ -14231,26 +24525,26 @@ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl regular expressions support" >&5
-$as_echo_n "checking for perl regular expressions support... " >&6; }
+echo "$as_me:$LINENO: checking for perl regular expressions support" >&5
+echo $ECHO_N "checking for perl regular expressions support... $ECHO_C" >&6
-# Check whether --with-pcre was given.
-if test "${with_pcre+set}" = set; then :
- withval=$with_pcre; WITH_PCRE=$withval
+# Check whether --with-pcre or --without-pcre was given.
+if test "${with_pcre+set}" = set; then
+ withval="$with_pcre"
+ WITH_PCRE=$withval
else
WITH_PCRE=yes
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_PCRE" >&5
-$as_echo "$WITH_PCRE" >&6; }
+fi;
+echo "$as_me:$LINENO: result: $WITH_PCRE" >&5
+echo "${ECHO_T}$WITH_PCRE" >&6
-if test "$WITH_PCRE" != "no"; then
+if test "x$cross_compiling" = xno -a "$WITH_PCRE" != "no"; then
# Extract the first word of "pcre-config", so it can be a program name with args.
set dummy pcre-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PCRECONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PCRECONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
case $PCRECONFIG in
[\\/]* | ?:[\\/]*)
@@ -14262,111 +24556,490 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PCRECONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
;;
esac
fi
PCRECONFIG=$ac_cv_path_PCRECONFIG
+
if test -n "$PCRECONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCRECONFIG" >&5
-$as_echo "$PCRECONFIG" >&6; }
+ echo "$as_me:$LINENO: result: $PCRECONFIG" >&5
+echo "${ECHO_T}$PCRECONFIG" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
if test x"$PCRECONFIG" != x; then
PCRE_LIB=`$PCRECONFIG --libs`
CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`"
+ OLDLIBS="$LIBS"
+ LIBS="$LIBS $PCRE_LIB"
+ echo "$as_me:$LINENO: checking for pcre_compile in -lpcre" >&5
+echo $ECHO_N "checking for pcre_compile in -lpcre... $ECHO_C" >&6
+if test "${ac_cv_lib_pcre_pcre_compile+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpcre $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pcre_compile ();
+int
+main ()
+{
+pcre_compile ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_pcre_pcre_compile=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pcre_pcre_compile=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pcre_pcre_compile" >&5
+echo "${ECHO_T}$ac_cv_lib_pcre_pcre_compile" >&6
+if test $ac_cv_lib_pcre_pcre_compile = yes; then
-$as_echo "#define HAVE_LIBPCRE 1" >>confdefs.h
+for ac_header in pcre.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-$as_echo "#define HAVE_PCRE_H 1" >>confdefs.h
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
- as_fn_error $? "pcre-config not found, install the pcre-devel package or build with --without-pcre" "$LINENO" 5
+ ac_cpp_err=
fi
+else
+ ac_cpp_err=yes
fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBPCRE 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PCRE_H 1
+_ACEOF
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib support" >&5
-$as_echo_n "checking for zlib support... " >&6; }
-# Check whether --with-zlib was given.
-if test "${with_zlib+set}" = set; then :
- withval=$with_zlib; WITH_ZLIB=$withval
-else
- WITH_ZLIB=yes
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_ZLIB" >&5
-$as_echo "$WITH_ZLIB" >&6; }
+done
+
-if test "$WITH_ZLIB" != "no"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5
-$as_echo_n "checking for deflate in -lz... " >&6; }
-if ${ac_cv_lib_z_deflate+:} false; then :
- $as_echo_n "(cached) " >&6
+fi
+
+ LIBS="$OLDLIBS"
+ fi
+fi
+
+
+
+echo "$as_me:$LINENO: checking for deflate in -lz" >&5
+echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6
+if test "${ac_cv_lib_z_deflate+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char deflate ();
int
main ()
{
-return deflate ();
+deflate ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_z_deflate=yes
else
- ac_cv_lib_z_deflate=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_z_deflate=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5
-$as_echo "$ac_cv_lib_z_deflate" >&6; }
-if test "x$ac_cv_lib_z_deflate" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5
+echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6
+if test $ac_cv_lib_z_deflate = yes; then
+
+
+for ac_header in zlib.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
- for ac_header in zlib.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_zlib_h" = xyes; then :
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_ZLIB_H 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
- Z_LIB=-lz
+ Z_LIB=-lz
-$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
- $as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZLIB_H 1
+_ACEOF
fi
@@ -14376,77 +25049,243 @@ done
fi
- if test x$Z_LIB = x; then
- as_fn_error $? "zlib-headers and/or libs where not found, install them or build with --without-zlib" "$LINENO" 5
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bzip2 support" >&5
-$as_echo_n "checking for bzip2 support... " >&6; }
+echo "$as_me:$LINENO: checking for bzip2 support" >&5
+echo $ECHO_N "checking for bzip2 support... $ECHO_C" >&6
-# Check whether --with-bzip2 was given.
-if test "${with_bzip2+set}" = set; then :
- withval=$with_bzip2; WITH_BZIP2=$withval
+# Check whether --with-bzip2 or --without-bzip2 was given.
+if test "${with_bzip2+set}" = set; then
+ withval="$with_bzip2"
+ WITH_BZIP2=$withval
else
WITH_BZIP2=yes
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_BZIP2" >&5
-$as_echo "$WITH_BZIP2" >&6; }
+fi;
+echo "$as_me:$LINENO: result: $WITH_BZIP2" >&5
+echo "${ECHO_T}$WITH_BZIP2" >&6
if test "$WITH_BZIP2" != "no"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzCompress in -lbz2" >&5
-$as_echo_n "checking for BZ2_bzCompress in -lbz2... " >&6; }
-if ${ac_cv_lib_bz2_BZ2_bzCompress+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for BZ2_bzCompress in -lbz2" >&5
+echo $ECHO_N "checking for BZ2_bzCompress in -lbz2... $ECHO_C" >&6
+if test "${ac_cv_lib_bz2_BZ2_bzCompress+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lbz2 $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char BZ2_bzCompress ();
int
main ()
{
-return BZ2_bzCompress ();
+BZ2_bzCompress ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_bz2_BZ2_bzCompress=yes
else
- ac_cv_lib_bz2_BZ2_bzCompress=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_bz2_BZ2_bzCompress=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzCompress" >&5
-$as_echo "$ac_cv_lib_bz2_BZ2_bzCompress" >&6; }
-if test "x$ac_cv_lib_bz2_BZ2_bzCompress" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_BZ2_bzCompress" >&5
+echo "${ECHO_T}$ac_cv_lib_bz2_BZ2_bzCompress" >&6
+if test $ac_cv_lib_bz2_BZ2_bzCompress = yes; then
+
+
+for ac_header in bzlib.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
- for ac_header in bzlib.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_bzlib_h" = xyes; then :
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_BZLIB_H 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
BZ_LIB=-lbz2
-$as_echo "#define HAVE_LIBBZ2 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBBZ2 1
+_ACEOF
- $as_echo "#define HAVE_BZLIB_H 1" >>confdefs.h
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_BZLIB_H 1
+_ACEOF
fi
@@ -14456,78 +25295,288 @@ done
fi
- if test x$BZ_LIB = x; then
- as_fn_error $? "bzip2-headers and/or libs where not found, install them or build with --without-bzip2" "$LINENO" 5
- fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FAM" >&5
-$as_echo_n "checking for FAM... " >&6; }
+if test -z "$PKG_CONFIG"; then
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-# Check whether --with-fam was given.
-if test "${with_fam+set}" = set; then :
- withval=$with_fam; WITH_FAM=$withval
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+ echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
else
- WITH_FAM=no
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_FAM" >&5
-$as_echo "$WITH_FAM" >&6; }
+echo "$as_me:$LINENO: checking for FAM" >&5
+echo $ECHO_N "checking for FAM... $ECHO_C" >&6
+
+# Check whether --with-fam or --without-fam was given.
+if test "${with_fam+set}" = set; then
+ withval="$with_fam"
+ WITH_FAM=$withval
+else
+ WITH_FAM=no
+fi;
+echo "$as_me:$LINENO: result: $WITH_FAM" >&5
+echo "${ECHO_T}$WITH_FAM" >&6
if test "$WITH_FAM" != "no"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FAMOpen2 in -lfam" >&5
-$as_echo_n "checking for FAMOpen2 in -lfam... " >&6; }
-if ${ac_cv_lib_fam_FAMOpen2+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for FAMOpen2 in -lfam" >&5
+echo $ECHO_N "checking for FAMOpen2 in -lfam... $ECHO_C" >&6
+if test "${ac_cv_lib_fam_FAMOpen2+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lfam $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char FAMOpen2 ();
int
main ()
{
-return FAMOpen2 ();
+FAMOpen2 ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_fam_FAMOpen2=yes
else
- ac_cv_lib_fam_FAMOpen2=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_fam_FAMOpen2=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fam_FAMOpen2" >&5
-$as_echo "$ac_cv_lib_fam_FAMOpen2" >&6; }
-if test "x$ac_cv_lib_fam_FAMOpen2" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_fam_FAMOpen2" >&5
+echo "${ECHO_T}$ac_cv_lib_fam_FAMOpen2" >&6
+if test $ac_cv_lib_fam_FAMOpen2 = yes; then
+
+
+for ac_header in fam.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
- for ac_header in fam.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "fam.h" "ac_cv_header_fam_h" "$ac_includes_default"
-if test "x$ac_cv_header_fam_h" = xyes; then :
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_FAM_H 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
FAM_LIBS=-lfam
-$as_echo "#define HAVE_LIBFAM 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBFAM 1
+_ACEOF
-$as_echo "#define HAVE_FAM_H 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FAM_H 1
+_ACEOF
fi
@@ -14539,480 +25588,691 @@ fi
if test "x$FAM_LIBS" = x; then
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FAM" >&5
-$as_echo_n "checking for FAM... " >&6; }
+ succeeded=no
-if test -n "$FAM_CFLAGS"; then
- pkg_cv_FAM_CFLAGS="$FAM_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gamin >= 0.1.0\""; } >&5
- ($PKG_CONFIG --exists --print-errors "gamin >= 0.1.0") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_FAM_CFLAGS=`$PKG_CONFIG --cflags "gamin >= 0.1.0" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ if test -z "$PKG_CONFIG"; then
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
fi
-if test -n "$FAM_LIBS"; then
- pkg_cv_FAM_LIBS="$FAM_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gamin >= 0.1.0\""; } >&5
- ($PKG_CONFIG --exists --print-errors "gamin >= 0.1.0") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_FAM_LIBS=`$PKG_CONFIG --libs "gamin >= 0.1.0" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+ echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ fi
-
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- FAM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gamin >= 0.1.0" 2>&1`
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ echo "$as_me:$LINENO: checking for gamin >= 0.1.0" >&5
+echo $ECHO_N "checking for gamin >= 0.1.0... $ECHO_C" >&6
+
+ if $PKG_CONFIG --exists "gamin >= 0.1.0" ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ succeeded=yes
+
+ echo "$as_me:$LINENO: checking FAM_CFLAGS" >&5
+echo $ECHO_N "checking FAM_CFLAGS... $ECHO_C" >&6
+ FAM_CFLAGS=`$PKG_CONFIG --cflags "gamin >= 0.1.0"`
+ echo "$as_me:$LINENO: result: $FAM_CFLAGS" >&5
+echo "${ECHO_T}$FAM_CFLAGS" >&6
+
+ echo "$as_me:$LINENO: checking FAM_LIBS" >&5
+echo $ECHO_N "checking FAM_LIBS... $ECHO_C" >&6
+ FAM_LIBS=`$PKG_CONFIG --libs "gamin >= 0.1.0"`
+ echo "$as_me:$LINENO: result: $FAM_LIBS" >&5
+echo "${ECHO_T}$FAM_LIBS" >&6
else
- FAM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gamin >= 0.1.0" 2>&1`
+ FAM_CFLAGS=""
+ FAM_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ FAM_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gamin >= 0.1.0"`
+ echo $FAM_PKG_ERRORS
fi
- # Put the nasty error message in config.log where it belongs
- echo "$FAM_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (gamin >= 0.1.0) were not met:
-$FAM_PKG_ERRORS
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-Alternatively, you may set the environment variables FAM_CFLAGS
-and FAM_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
-Alternatively, you may set the environment variables FAM_CFLAGS
-and FAM_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
+ if test $succeeded = yes; then
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
- FAM_CFLAGS=$pkg_cv_FAM_CFLAGS
- FAM_LIBS=$pkg_cv_FAM_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBFAM 1
+_ACEOF
-$as_echo "#define HAVE_LIBFAM 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FAM_H 1
+_ACEOF
-$as_echo "#define HAVE_FAM_H 1" >>confdefs.h
+ else
+ { { echo "$as_me:$LINENO: error: Library requirements (gamin >= 0.1.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5
+echo "$as_me: error: Library requirements (gamin >= 0.1.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
-fi
fi
OLD_LIBS=$LIBS
LIBS=$FAM_LIBS
- for ac_func in FAMNoExists
-do :
- ac_fn_c_check_func "$LINENO" "FAMNoExists" "ac_cv_func_FAMNoExists"
-if test "x$ac_cv_func_FAMNoExists" = xyes; then :
+
+for ac_func in FAMNoExists
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_FAMNOEXISTS 1
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
LIBS=$OLD_LIBS
-
- if test x$FAM_LIBS = x; then
- as_fn_error $? "fam/gamin-headers and/or libs where not found, install them or build with --without-fam" "$LINENO" 5
- fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for properties in mod_webdav" >&5
-$as_echo_n "checking for properties in mod_webdav... " >&6; }
+echo "$as_me:$LINENO: checking for properties in mod_webdav" >&5
+echo $ECHO_N "checking for properties in mod_webdav... $ECHO_C" >&6
-# Check whether --with-webdav-props was given.
-if test "${with_webdav_props+set}" = set; then :
- withval=$with_webdav_props; WITH_WEBDAV_PROPS=$withval
+# Check whether --with-webdav-props or --without-webdav-props was given.
+if test "${with_webdav_props+set}" = set; then
+ withval="$with_webdav_props"
+ WITH_WEBDAV_PROPS=$withval
else
WITH_WEBDAV_PROPS=no
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_WEBDAV_PROPS" >&5
-$as_echo "$WITH_WEBDAV_PROPS" >&6; }
+fi;
+echo "$as_me:$LINENO: result: $WITH_WEBDAV_PROPS" >&5
+echo "${ECHO_T}$WITH_WEBDAV_PROPS" >&6
if test "$WITH_WEBDAV_PROPS" != "no"; then
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML" >&5
-$as_echo_n "checking for XML... " >&6; }
+ succeeded=no
-if test -n "$XML_CFLAGS"; then
- pkg_cv_XML_CFLAGS="$XML_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_XML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ if test -z "$PKG_CONFIG"; then
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
fi
-if test -n "$XML_LIBS"; then
- pkg_cv_XML_LIBS="$XML_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_XML_LIBS=`$PKG_CONFIG --libs "libxml-2.0" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+ echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ fi
-
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- XML_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0" 2>&1`
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ echo "$as_me:$LINENO: checking for libxml-2.0" >&5
+echo $ECHO_N "checking for libxml-2.0... $ECHO_C" >&6
+
+ if $PKG_CONFIG --exists "libxml-2.0" ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ succeeded=yes
+
+ echo "$as_me:$LINENO: checking XML_CFLAGS" >&5
+echo $ECHO_N "checking XML_CFLAGS... $ECHO_C" >&6
+ XML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0"`
+ echo "$as_me:$LINENO: result: $XML_CFLAGS" >&5
+echo "${ECHO_T}$XML_CFLAGS" >&6
+
+ echo "$as_me:$LINENO: checking XML_LIBS" >&5
+echo $ECHO_N "checking XML_LIBS... $ECHO_C" >&6
+ XML_LIBS=`$PKG_CONFIG --libs "libxml-2.0"`
+ echo "$as_me:$LINENO: result: $XML_LIBS" >&5
+echo "${ECHO_T}$XML_LIBS" >&6
else
- XML_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0" 2>&1`
+ XML_CFLAGS=""
+ XML_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ XML_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libxml-2.0"`
+ echo $XML_PKG_ERRORS
fi
- # Put the nasty error message in config.log where it belongs
- echo "$XML_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (libxml-2.0) were not met:
-$XML_PKG_ERRORS
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-Alternatively, you may set the environment variables XML_CFLAGS
-and XML_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
-Alternatively, you may set the environment variables XML_CFLAGS
-and XML_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
+ if test $succeeded = yes; then
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
- XML_CFLAGS=$pkg_cv_XML_CFLAGS
- XML_LIBS=$pkg_cv_XML_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBXML2 1
+_ACEOF
-$as_echo "#define HAVE_LIBXML2 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBXML_H 1
+_ACEOF
-$as_echo "#define HAVE_LIBXML_H 1" >>confdefs.h
+ else
+ { { echo "$as_me:$LINENO: error: Library requirements (libxml-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5
+echo "$as_me: error: Library requirements (libxml-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
-fi
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLITE" >&5
-$as_echo_n "checking for SQLITE... " >&6; }
+ succeeded=no
-if test -n "$SQLITE_CFLAGS"; then
- pkg_cv_SQLITE_CFLAGS="$SQLITE_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sqlite3\""; } >&5
- ($PKG_CONFIG --exists --print-errors "sqlite3") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_SQLITE_CFLAGS=`$PKG_CONFIG --cflags "sqlite3" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ if test -z "$PKG_CONFIG"; then
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
fi
-if test -n "$SQLITE_LIBS"; then
- pkg_cv_SQLITE_LIBS="$SQLITE_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sqlite3\""; } >&5
- ($PKG_CONFIG --exists --print-errors "sqlite3") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_SQLITE_LIBS=`$PKG_CONFIG --libs "sqlite3" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+ echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
else
- pkg_failed=yes
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- else
- pkg_failed=untried
-fi
-
+ fi
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- SQLITE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sqlite3" 2>&1`
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ echo "$as_me:$LINENO: checking for sqlite3" >&5
+echo $ECHO_N "checking for sqlite3... $ECHO_C" >&6
+
+ if $PKG_CONFIG --exists "sqlite3" ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ succeeded=yes
+
+ echo "$as_me:$LINENO: checking SQLITE_CFLAGS" >&5
+echo $ECHO_N "checking SQLITE_CFLAGS... $ECHO_C" >&6
+ SQLITE_CFLAGS=`$PKG_CONFIG --cflags "sqlite3"`
+ echo "$as_me:$LINENO: result: $SQLITE_CFLAGS" >&5
+echo "${ECHO_T}$SQLITE_CFLAGS" >&6
+
+ echo "$as_me:$LINENO: checking SQLITE_LIBS" >&5
+echo $ECHO_N "checking SQLITE_LIBS... $ECHO_C" >&6
+ SQLITE_LIBS=`$PKG_CONFIG --libs "sqlite3"`
+ echo "$as_me:$LINENO: result: $SQLITE_LIBS" >&5
+echo "${ECHO_T}$SQLITE_LIBS" >&6
else
- SQLITE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sqlite3" 2>&1`
+ SQLITE_CFLAGS=""
+ SQLITE_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ SQLITE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "sqlite3"`
+ echo $SQLITE_PKG_ERRORS
fi
- # Put the nasty error message in config.log where it belongs
- echo "$SQLITE_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (sqlite3) were not met:
-$SQLITE_PKG_ERRORS
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-Alternatively, you may set the environment variables SQLITE_CFLAGS
-and SQLITE_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
-Alternatively, you may set the environment variables SQLITE_CFLAGS
-and SQLITE_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
+ if test $succeeded = yes; then
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
- SQLITE_CFLAGS=$pkg_cv_SQLITE_CFLAGS
- SQLITE_LIBS=$pkg_cv_SQLITE_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SQLITE3 1
+_ACEOF
-$as_echo "#define HAVE_SQLITE3 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SQLITE3_H 1
+_ACEOF
-$as_echo "#define HAVE_SQLITE3_H 1" >>confdefs.h
+ else
+ { { echo "$as_me:$LINENO: error: Library requirements (sqlite3) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5
+echo "$as_me: error: Library requirements (sqlite3) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for locks in mod_webdav" >&5
-$as_echo_n "checking for locks in mod_webdav... " >&6; }
+echo "$as_me:$LINENO: checking for gdbm" >&5
+echo $ECHO_N "checking for gdbm... $ECHO_C" >&6
-# Check whether --with-webdav-locks was given.
-if test "${with_webdav_locks+set}" = set; then :
- withval=$with_webdav_locks; WITH_WEBDAV_LOCKS=$withval
+# Check whether --with-gdbm or --without-gdbm was given.
+if test "${with_gdbm+set}" = set; then
+ withval="$with_gdbm"
+ WITH_GDBM=$withval
else
- WITH_WEBDAV_LOCKS=no
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_WEBDAV_LOCKS" >&5
-$as_echo "$WITH_WEBDAV_LOCKS" >&6; }
+ WITH_GDBM=no
+fi;
+echo "$as_me:$LINENO: result: $WITH_GDBM" >&5
+echo "${ECHO_T}$WITH_GDBM" >&6
- if test "$WITH_WEBDAV_LOCKS" != "no"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_unparse in -luuid" >&5
-$as_echo_n "checking for uuid_unparse in -luuid... " >&6; }
-if ${ac_cv_lib_uuid_uuid_unparse+:} false; then :
- $as_echo_n "(cached) " >&6
+if test "$WITH_GDBM" != "no"; then
+ echo "$as_me:$LINENO: checking for gdbm_open in -lgdbm" >&5
+echo $ECHO_N "checking for gdbm_open in -lgdbm... $ECHO_C" >&6
+if test "${ac_cv_lib_gdbm_gdbm_open+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-luuid $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+LIBS="-lgdbm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
-char uuid_unparse ();
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gdbm_open ();
int
main ()
{
-return uuid_unparse ();
+gdbm_open ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_uuid_uuid_unparse=yes
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_gdbm_gdbm_open=yes
else
- ac_cv_lib_uuid_uuid_unparse=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_gdbm_gdbm_open=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_unparse" >&5
-$as_echo "$ac_cv_lib_uuid_uuid_unparse" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_unparse" = xyes; then :
-
- for ac_header in uuid/uuid.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_UUID_UUID_H 1
-_ACEOF
-
- UUID_LIBS=-luuid
-
-$as_echo "#define HAVE_UUID 1" >>confdefs.h
-
-
-$as_echo "#define HAVE_UUID_H 1" >>confdefs.h
-
-
-fi
-
-done
+echo "$as_me:$LINENO: result: $ac_cv_lib_gdbm_gdbm_open" >&5
+echo "${ECHO_T}$ac_cv_lib_gdbm_gdbm_open" >&6
+if test $ac_cv_lib_gdbm_gdbm_open = yes; then
+for ac_header in gdbm.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-
- fi
+ac_header_compiler=no
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdbm" >&5
-$as_echo_n "checking for gdbm... " >&6; }
-
-# Check whether --with-gdbm was given.
-if test "${with_gdbm+set}" = set; then :
- withval=$with_gdbm; WITH_GDBM=$withval
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- WITH_GDBM=no
+ ac_cpp_err=yes
fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_GDBM" >&5
-$as_echo "$WITH_GDBM" >&6; }
-
-if test "$WITH_GDBM" != "no"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdbm_open in -lgdbm" >&5
-$as_echo_n "checking for gdbm_open in -lgdbm... " >&6; }
-if ${ac_cv_lib_gdbm_gdbm_open+:} false; then :
- $as_echo_n "(cached) " >&6
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgdbm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gdbm_open ();
-int
-main ()
-{
-return gdbm_open ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_gdbm_gdbm_open=yes
-else
- ac_cv_lib_gdbm_gdbm_open=no
+ ac_header_preproc=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gdbm_gdbm_open" >&5
-$as_echo "$ac_cv_lib_gdbm_gdbm_open" >&6; }
-if test "x$ac_cv_lib_gdbm_gdbm_open" = xyes; then :
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
- for ac_header in gdbm.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "gdbm.h" "ac_cv_header_gdbm_h" "$ac_includes_default"
-if test "x$ac_cv_header_gdbm_h" = xyes; then :
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_GDBM_H 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
GDBM_LIB=-lgdbm
-$as_echo "#define HAVE_GDBM 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GDBM 1
+_ACEOF
- $as_echo "#define HAVE_GDBM_H 1" >>confdefs.h
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_GDBM_H 1
+_ACEOF
fi
@@ -15025,71 +26285,241 @@ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for memcache" >&5
-$as_echo_n "checking for memcache... " >&6; }
+echo "$as_me:$LINENO: checking for memcache" >&5
+echo $ECHO_N "checking for memcache... $ECHO_C" >&6
-# Check whether --with-memcache was given.
-if test "${with_memcache+set}" = set; then :
- withval=$with_memcache; WITH_MEMCACHE=$withval
+# Check whether --with-memcache or --without-memcache was given.
+if test "${with_memcache+set}" = set; then
+ withval="$with_memcache"
+ WITH_MEMCACHE=$withval
else
WITH_MEMCACHE=no
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_MEMCACHE" >&5
-$as_echo "$WITH_MEMCACHE" >&6; }
+fi;
+echo "$as_me:$LINENO: result: $WITH_MEMCACHE" >&5
+echo "${ECHO_T}$WITH_MEMCACHE" >&6
if test "$WITH_MEMCACHE" != "no"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mc_new in -lmemcache" >&5
-$as_echo_n "checking for mc_new in -lmemcache... " >&6; }
-if ${ac_cv_lib_memcache_mc_new+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for mc_new in -lmemcache" >&5
+echo $ECHO_N "checking for mc_new in -lmemcache... $ECHO_C" >&6
+if test "${ac_cv_lib_memcache_mc_new+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lmemcache $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char mc_new ();
int
main ()
{
-return mc_new ();
+mc_new ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_memcache_mc_new=yes
else
- ac_cv_lib_memcache_mc_new=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_memcache_mc_new=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_memcache_mc_new" >&5
-$as_echo "$ac_cv_lib_memcache_mc_new" >&6; }
-if test "x$ac_cv_lib_memcache_mc_new" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_memcache_mc_new" >&5
+echo "${ECHO_T}$ac_cv_lib_memcache_mc_new" >&6
+if test $ac_cv_lib_memcache_mc_new = yes; then
+
- for ac_header in memcache.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "memcache.h" "ac_cv_header_memcache_h" "$ac_includes_default"
-if test "x$ac_cv_header_memcache_h" = xyes; then :
+for ac_header in memcache.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMCACHE_H 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
MEMCACHE_LIB=-lmemcache
-$as_echo "#define HAVE_MEMCACHE 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MEMCACHE 1
+_ACEOF
-$as_echo "#define HAVE_MEMCACHE_H 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MEMCACHE_H 1
+_ACEOF
fi
@@ -15102,910 +26532,1844 @@ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua-support is requested" >&5
-$as_echo_n "checking if lua-support is requested... " >&6; }
+echo "$as_me:$LINENO: checking for lua" >&5
+echo $ECHO_N "checking for lua... $ECHO_C" >&6
-# Check whether --with-lua was given.
-if test "${with_lua+set}" = set; then :
- withval=$with_lua; WITH_LUA=$withval
+# Check whether --with-lua or --without-lua was given.
+if test "${with_lua+set}" = set; then
+ withval="$with_lua"
+ WITH_LUA=$withval
else
WITH_LUA=no
-fi
-
+fi;
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_LUA" >&5
-$as_echo "$WITH_LUA" >&6; }
+echo "$as_me:$LINENO: result: $WITH_LUA" >&5
+echo "${ECHO_T}$WITH_LUA" >&6
if test "$WITH_LUA" != "no"; then
- if test "$WITH_LUA" = "yes"; then
- WITH_LUA=lua
- fi
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
-$as_echo_n "checking for LUA... " >&6; }
+ # Extract the first word of "lua-config", so it can be a program name with args.
+set dummy lua-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_LUACONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $LUACONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_LUACONFIG="$LUACONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_LUACONFIG="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-if test -n "$LUA_CFLAGS"; then
- pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$WITH_LUA >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "$WITH_LUA >= 5.1") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "$WITH_LUA >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ ;;
+esac
fi
-if test -n "$LUA_LIBS"; then
- pkg_cv_LUA_LIBS="$LUA_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$WITH_LUA >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "$WITH_LUA >= 5.1") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "$WITH_LUA >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+LUACONFIG=$ac_cv_path_LUACONFIG
+
+if test -n "$LUACONFIG"; then
+ echo "$as_me:$LINENO: result: $LUACONFIG" >&5
+echo "${ECHO_T}$LUACONFIG" >&6
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ if test x"$LUACONFIG" != x; then
+ LUA_CFLAGS=`$LUACONFIG --include`
+ LUA_LIBS=`$LUACONFIG --libs --extralibs`
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$WITH_LUA >= 5.1" 2>&1`
- else
- LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$WITH_LUA >= 5.1" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$LUA_PKG_ERRORS" >&5
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LUA 1
+_ACEOF
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LUA_H 1
+_ACEOF
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
-$as_echo_n "checking for LUA... " >&6; }
+ else
+ echo "$as_me:$LINENO: checking for lua_open in -llua" >&5
+echo $ECHO_N "checking for lua_open in -llua... $ECHO_C" >&6
+if test "${ac_cv_lib_lua_lua_open+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-llua $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-if test -n "$LUA_CFLAGS"; then
- pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char lua_open ();
+int
+main ()
+{
+lua_open ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua5.1 >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$LUA_LIBS"; then
- pkg_cv_LUA_LIBS="$LUA_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua5.1 >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_lua_lua_open=yes
else
- pkg_failed=yes
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_lua_lua_open=no
fi
- else
- pkg_failed=untried
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_lua_lua_open" >&5
+echo "${ECHO_T}$ac_cv_lib_lua_lua_open" >&6
+if test $ac_cv_lib_lua_lua_open = yes; then
-
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
+for ac_header in lua.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
fi
- if test $_pkg_short_errors_supported = yes; then
- LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua5.1 >= 5.1" 2>&1`
- else
- LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua5.1 >= 5.1" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$LUA_PKG_ERRORS" >&5
-
-
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
-$as_echo_n "checking for LUA... " >&6; }
-
-if test -n "$LUA_CFLAGS"; then
- pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua-5.1 >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
fi
-if test -n "$LUA_LIBS"; then
- pkg_cv_LUA_LIBS="$LUA_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua-5.1 >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- pkg_failed=yes
+ ac_cpp_err=yes
fi
- else
- pkg_failed=untried
-fi
-
-
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- _pkg_short_errors_supported=no
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
- if test $_pkg_short_errors_supported = yes; then
- LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua-5.1 >= 5.1" 2>&1`
- else
- LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua-5.1 >= 5.1" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$LUA_PKG_ERRORS" >&5
-
- as_fn_error $? "Package requirements (lua-5.1 >= 5.1) were not met:
-
-$LUA_PKG_ERRORS
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-Alternatively, you may set the environment variables LUA_CFLAGS
-and LUA_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
+ LUA_LIBS="-llua -llualib"
-Alternatively, you may set the environment variables LUA_CFLAGS
-and LUA_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LUA 1
+_ACEOF
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
- LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
- LUA_LIBS=$pkg_cv_LUA_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LUA_H 1
+_ACEOF
-$as_echo "#define HAVE_LUA 1" >>confdefs.h
+fi
-$as_echo "#define HAVE_LUA_H 1" >>confdefs.h
+done
fi
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ fi
+ if test x"$LUA_LIBS" = x; then
+ # try pkgconfig
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
-$as_echo_n "checking for LUA... " >&6; }
+ succeeded=no
-if test -n "$LUA_CFLAGS"; then
- pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua-5.1 >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ if test -z "$PKG_CONFIG"; then
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
fi
-if test -n "$LUA_LIBS"; then
- pkg_cv_LUA_LIBS="$LUA_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua-5.1 >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+ echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
else
- pkg_failed=yes
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- else
- pkg_failed=untried
-fi
-
-
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ fi
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua-5.1 >= 5.1" 2>&1`
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ echo "$as_me:$LINENO: checking for lua" >&5
+echo $ECHO_N "checking for lua... $ECHO_C" >&6
+
+ if $PKG_CONFIG --exists "lua" ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ succeeded=yes
+
+ echo "$as_me:$LINENO: checking LUA_CFLAGS" >&5
+echo $ECHO_N "checking LUA_CFLAGS... $ECHO_C" >&6
+ LUA_CFLAGS=`$PKG_CONFIG --cflags "lua"`
+ echo "$as_me:$LINENO: result: $LUA_CFLAGS" >&5
+echo "${ECHO_T}$LUA_CFLAGS" >&6
+
+ echo "$as_me:$LINENO: checking LUA_LIBS" >&5
+echo $ECHO_N "checking LUA_LIBS... $ECHO_C" >&6
+ LUA_LIBS=`$PKG_CONFIG --libs "lua"`
+ echo "$as_me:$LINENO: result: $LUA_LIBS" >&5
+echo "${ECHO_T}$LUA_LIBS" >&6
else
- LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua-5.1 >= 5.1" 2>&1`
+ LUA_CFLAGS=""
+ LUA_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ LUA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "lua"`
+ echo $LUA_PKG_ERRORS
fi
- # Put the nasty error message in config.log where it belongs
- echo "$LUA_PKG_ERRORS" >&5
-
- as_fn_error $? "Package requirements (lua-5.1 >= 5.1) were not met:
-
-$LUA_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-Alternatively, you may set the environment variables LUA_CFLAGS
-and LUA_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-Alternatively, you may set the environment variables LUA_CFLAGS
-and LUA_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
- LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
- LUA_LIBS=$pkg_cv_LUA_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "#define HAVE_LUA 1" >>confdefs.h
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
+ if test $succeeded = yes; then
-$as_echo "#define HAVE_LUA_H 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LUA 1
+_ACEOF
-fi
-else
- LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
- LUA_LIBS=$pkg_cv_LUA_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LUA_H 1
+_ACEOF
-$as_echo "#define HAVE_LUA 1" >>confdefs.h
+ else
+ { { echo "$as_me:$LINENO: error: Library requirements (lua) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5
+echo "$as_me: error: Library requirements (lua) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
-$as_echo "#define HAVE_LUA_H 1" >>confdefs.h
fi
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
-$as_echo_n "checking for LUA... " >&6; }
+save_LIBS=$LIBS
+echo "$as_me:$LINENO: checking for library containing crypt" >&5
+echo $ECHO_N "checking for library containing crypt... $ECHO_C" >&6
+if test "${ac_cv_search_crypt+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_crypt=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-if test -n "$LUA_CFLAGS"; then
- pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char crypt ();
+int
+main ()
+{
+crypt ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua5.1 >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_crypt="none required"
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-if test -n "$LUA_LIBS"; then
- pkg_cv_LUA_LIBS="$LUA_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_crypt" = no; then
+ for ac_lib in crypt; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char crypt ();
+int
+main ()
+{
+crypt ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua5.1 >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_crypt="-l$ac_lib"
+break
else
- pkg_failed=yes
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
- else
- pkg_failed=untried
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
fi
-
-
-
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
+LIBS=$ac_func_search_save_LIBS
fi
- if test $_pkg_short_errors_supported = yes; then
- LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua5.1 >= 5.1" 2>&1`
- else
- LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua5.1 >= 5.1" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$LUA_PKG_ERRORS" >&5
+echo "$as_me:$LINENO: result: $ac_cv_search_crypt" >&5
+echo "${ECHO_T}$ac_cv_search_crypt" >&6
+if test "$ac_cv_search_crypt" != no; then
+ test "$ac_cv_search_crypt" = "none required" || LIBS="$ac_cv_search_crypt $LIBS"
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
-$as_echo_n "checking for LUA... " >&6; }
-
-if test -n "$LUA_CFLAGS"; then
- pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+for ac_header in crypt.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua-5.1 >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
fi
-if test -n "$LUA_LIBS"; then
- pkg_cv_LUA_LIBS="$LUA_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua-5.1 >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- pkg_failed=yes
+ ac_cpp_err=yes
fi
- else
- pkg_failed=untried
-fi
-
-
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- _pkg_short_errors_supported=no
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
- if test $_pkg_short_errors_supported = yes; then
- LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua-5.1 >= 5.1" 2>&1`
- else
- LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua-5.1 >= 5.1" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$LUA_PKG_ERRORS" >&5
-
- as_fn_error $? "Package requirements (lua-5.1 >= 5.1) were not met:
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-$LUA_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-Alternatively, you may set the environment variables LUA_CFLAGS
-and LUA_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_CRYPT_H 1
+_ACEOF
-Alternatively, you may set the environment variables LUA_CFLAGS
-and LUA_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
- LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
- LUA_LIBS=$pkg_cv_LUA_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+fi
+done
-$as_echo "#define HAVE_LUA 1" >>confdefs.h
-$as_echo "#define HAVE_LUA_H 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBCRYPT 1
+_ACEOF
+ if test "$ac_cv_search_crypt" != no; then
+ test "$ac_cv_search_crypt" = "none required" || CRYPT_LIB="$ac_cv_search_crypt"
+ fi
fi
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+LIBS=$save_LIBS
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
-$as_echo_n "checking for LUA... " >&6; }
+save_LIBS=$LIBS
+echo "$as_me:$LINENO: checking for library containing sendfilev" >&5
+echo $ECHO_N "checking for library containing sendfilev... $ECHO_C" >&6
+if test "${ac_cv_search_sendfilev+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_sendfilev=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-if test -n "$LUA_CFLAGS"; then
- pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char sendfilev ();
+int
+main ()
+{
+sendfilev ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua-5.1 >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_sendfilev="none required"
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-if test -n "$LUA_LIBS"; then
- pkg_cv_LUA_LIBS="$LUA_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_sendfilev" = no; then
+ for ac_lib in sendfile; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char sendfilev ();
+int
+main ()
+{
+sendfilev ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua-5.1 >= 5.1" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_sendfilev="-l$ac_lib"
+break
else
- pkg_failed=yes
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
- else
- pkg_failed=untried
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
fi
+echo "$as_me:$LINENO: result: $ac_cv_search_sendfilev" >&5
+echo "${ECHO_T}$ac_cv_search_sendfilev" >&6
+if test "$ac_cv_search_sendfilev" != no; then
+ test "$ac_cv_search_sendfilev" = "none required" || LIBS="$ac_cv_search_sendfilev $LIBS"
+ if test "$ac_cv_search_sendfilev" != no; then
+ test "$ac_cv_search_sendfilev" = "none required" || SENDFILE_LIB="$ac_cv_search_sendfilev"
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SENDFILEV 1
+_ACEOF
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ fi
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
fi
- if test $_pkg_short_errors_supported = yes; then
- LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua-5.1 >= 5.1" 2>&1`
- else
- LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua-5.1 >= 5.1" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$LUA_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (lua-5.1 >= 5.1) were not met:
+LIBS=$save_LIBS
-$LUA_PKG_ERRORS
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
+case $host_os in
+ *mingw* ) LIBS="$LIBS -lwsock32";;
+ * ) ;;
+esac
-Alternatively, you may set the environment variables LUA_CFLAGS
-and LUA_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-Alternatively, you may set the environment variables LUA_CFLAGS
-and LUA_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
- LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
- LUA_LIBS=$pkg_cv_LUA_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "#define HAVE_LUA 1" >>confdefs.h
-$as_echo "#define HAVE_LUA_H 1" >>confdefs.h
-fi
-else
- LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
- LUA_LIBS=$pkg_cv_LUA_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "#define HAVE_LUA 1" >>confdefs.h
-$as_echo "#define HAVE_LUA_H 1" >>confdefs.h
-fi
-else
- LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
- LUA_LIBS=$pkg_cv_LUA_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-$as_echo "#define HAVE_LUA 1" >>confdefs.h
-$as_echo "#define HAVE_LUA_H 1" >>confdefs.h
-fi
-fi
-save_LIBS=$LIBS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
-$as_echo_n "checking for library containing crypt... " >&6; }
-if ${ac_cv_search_crypt+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+
+
+
+
+
+
+for ac_func in dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
+ strdup strerror strstr strtol sendfile getopt socket \
+ gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \
+ getuid select signal pathconf madvise\
+ writev sigaction sendfile64 send_file kqueue port_create localtime_r
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
+{
#endif
-char crypt ();
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
int
main ()
{
-return crypt ();
+return f != $ac_func;
;
return 0;
}
_ACEOF
-for ac_lib in '' crypt; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_crypt=$ac_res
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_crypt+:} false; then :
- break
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
fi
done
-if ${ac_cv_search_crypt+:} false; then :
+
+echo "$as_me:$LINENO: checking for Large File System support" >&5
+echo $ECHO_N "checking for Large File System support... $ECHO_C" >&6
+# Check whether --enable-lfs or --disable-lfs was given.
+if test "${enable_lfs+set}" = set; then
+ enableval="$enable_lfs"
+ case "${enableval}" in
+ yes) CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" ;;
+ no) ;;
+ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-lfs" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-lfs" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+else
+ CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES"
+ enable_lfs=yes
+fi;
+echo "$as_me:$LINENO: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+
+echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6
+if test "${ac_cv_type_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((long *) 0)
+ return 0;
+if (sizeof (long))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_long=yes
else
- ac_cv_search_crypt=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_long=no
fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
-$as_echo "$ac_cv_search_crypt" >&6; }
-ac_res=$ac_cv_search_crypt
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6
- for ac_header in crypt.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "crypt.h" "ac_cv_header_crypt_h" "$ac_includes_default"
-if test "x$ac_cv_header_crypt_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_CRYPT_H 1
+echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6
+if test "${ac_cv_sizeof_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$ac_cv_type_long" = yes; then
+ # The cast to unsigned long works around a bug in the HP C Compiler
+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+ # This bug is HP SR number 8606223364.
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
+test_array [0] = 0
- $as_echo "#define HAVE_CRYPT_H 1" >>confdefs.h
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-done
-
-
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
+test_array [0] = 0
-$as_echo "#define HAVE_LIBCRYPT 1" >>confdefs.h
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
+test_array [0] = 0
- if test "$ac_cv_search_crypt" != no; then
- test "$ac_cv_search_crypt" = "none required" || CRYPT_LIB="$ac_cv_search_crypt"
- fi
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-LIBS=$save_LIBS
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-save_LIBS=$LIBS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sendfilev" >&5
-$as_echo_n "checking for library containing sendfilev... " >&6; }
-if ${ac_cv_search_sendfilev+:} false; then :
- $as_echo_n "(cached) " >&6
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; } ;;
+esac
else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char sendfilev ();
+$ac_includes_default
+long longval () { return (long) (sizeof (long)); }
+unsigned long ulongval () { return (long) (sizeof (long)); }
+#include <stdio.h>
+#include <stdlib.h>
int
main ()
{
-return sendfilev ();
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ exit (1);
+ if (((long) (sizeof (long))) < 0)
+ {
+ long i = longval ();
+ if (i != ((long) (sizeof (long))))
+ exit (1);
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long i = ulongval ();
+ if (i != ((long) (sizeof (long))))
+ exit (1);
+ fprintf (f, "%lu\n", i);
+ }
+ exit (ferror (f) || fclose (f) != 0);
+
;
return 0;
}
_ACEOF
-for ac_lib in '' sendfile; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_sendfilev=$ac_res
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_long=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_sendfilev+:} false; then :
- break
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-done
-if ${ac_cv_search_sendfilev+:} false; then :
-
+fi
+rm -f conftest.val
else
- ac_cv_search_sendfilev=no
+ ac_cv_sizeof_long=0
fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sendfilev" >&5
-$as_echo "$ac_cv_search_sendfilev" >&6; }
-ac_res=$ac_cv_search_sendfilev
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
- if test "$ac_cv_search_sendfilev" != no; then
- test "$ac_cv_search_sendfilev" = "none required" || SENDFILE_LIB="$ac_cv_search_sendfilev"
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
-$as_echo "#define HAVE_SENDFILEV 1" >>confdefs.h
- fi
+echo "$as_me:$LINENO: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6
+if test "${ac_cv_type_off_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((off_t *) 0)
+ return 0;
+if (sizeof (off_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_off_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_off_t=no
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6
-LIBS=$save_LIBS
-
+echo "$as_me:$LINENO: checking size of off_t" >&5
+echo $ECHO_N "checking size of off_t... $ECHO_C" >&6
+if test "${ac_cv_sizeof_off_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$ac_cv_type_off_t" = yes; then
+ # The cast to unsigned long works around a bug in the HP C Compiler
+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+ # This bug is HP SR number 8606223364.
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= 0)];
+test_array [0] = 0
-case $host_os in
- *mingw* ) LIBS="$LIBS -lwsock32";;
- * ) ;;
-esac
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)];
+test_array [0] = 0
-for ac_func in dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
- strdup strerror strstr strtol sendfile getopt socket lstat \
- gethostbyname poll epoll_ctl getrlimit chroot \
- getuid select signal pathconf madvise posix_fadvise posix_madvise \
- writev sigaction sendfile64 send_file kqueue port_create localtime_r gmtime_r
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+ ;
+ return 0;
+}
_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
fi
-done
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Large File System support" >&5
-$as_echo_n "checking for Large File System support... " >&6; }
-# Check whether --enable-lfs was given.
-if test "${enable_lfs+set}" = set; then :
- enableval=$enable_lfs; case "${enableval}" in
- yes) CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" ;;
- no) ;;
- *) as_fn_error $? "bad value ${enableval} for --enable-lfs" "$LINENO" 5 ;;
- esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
else
- CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES"
- enable_lfs=yes
-fi
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
-$as_echo "$enableval" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (off_t))) < 0)];
+test_array [0] = 0
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
-$as_echo_n "checking size of long... " >&6; }
-if ${ac_cv_sizeof_long+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= $ac_mid)];
+test_array [0] = 0
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_lo=$ac_mid; break
else
- if test "$ac_cv_type_long" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long=0
- fi
-fi
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
-$as_echo "$ac_cv_sizeof_long" >&6; }
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)];
+test_array [0] = 0
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_off_t=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (off_t), 77
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; } ;;
+esac
+else
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+long longval () { return (long) (sizeof (off_t)); }
+unsigned long ulongval () { return (long) (sizeof (off_t)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ exit (1);
+ if (((long) (sizeof (off_t))) < 0)
+ {
+ long i = longval ();
+ if (i != ((long) (sizeof (off_t))))
+ exit (1);
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long i = ulongval ();
+ if (i != ((long) (sizeof (off_t))))
+ exit (1);
+ fprintf (f, "%lu\n", i);
+ }
+ exit (ferror (f) || fclose (f) != 0);
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
-$as_echo_n "checking size of off_t... " >&6; }
-if ${ac_cv_sizeof_off_t+:} false; then :
- $as_echo_n "(cached) " >&6
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_off_t=`cat conftest.val`
else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (off_t), 77
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
else
- if test "$ac_cv_type_off_t" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (off_t)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_off_t=0
- fi
+ ac_cv_sizeof_off_t=0
fi
-
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
-$as_echo "$ac_cv_sizeof_off_t" >&6; }
-
-
-
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
_ACEOF
@@ -16013,16 +28377,22 @@ _ACEOF
if test "x$ac_cv_func_sendfile" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sendfile works" >&5
-$as_echo_n "checking if sendfile works... " >&6; }
+ # check if sendfile works
+ echo "$as_me:$LINENO: checking if sendfile works" >&5
+echo $ECHO_N "checking if sendfile works... $ECHO_C" >&6
if test "x$cross_compiling" = xno; then
- if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef HAVE_SYS_SENDFILE_H
@@ -16035,49 +28405,72 @@ else
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-$as_echo "#define HAVE_SENDFILE_BROKEN 1" >>confdefs.h
+( exit $ac_status )
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SENDFILE_BROKEN 1
+_ACEOF
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
-$as_echo "#define HAVE_SENDFILE_BROKEN 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SENDFILE_BROKEN 1
+_ACEOF
fi
fi
-# Check whether --enable-ipv6 was given.
-if test "${enable_ipv6+set}" = set; then :
- enableval=$enable_ipv6; case "${enableval}" in
+# Check whether --enable-ipv6 or --disable-ipv6 was given.
+if test "${enable_ipv6+set}" = set; then
+ enableval="$enable_ipv6"
+ case "${enableval}" in
yes) ipv6=true ;;
no) ipv6=false ;;
- *) as_fn_error $? "bad value ${enableval} for --enable-ipv6" "$LINENO" 5 ;;
+ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-ipv6" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-ipv6" >&2;}
+ { (exit 1); exit 1; }; } ;;
esac
else
ipv6=true
-fi
-
+fi;
if test x$ipv6 = xtrue; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 support" >&5
-$as_echo_n "checking for IPv6 support... " >&6; }
-if ${ac_cv_ipv6_support+:} false; then :
- $as_echo_n "(cached) " >&6
+ echo "$as_me:$LINENO: checking for IPv6 support" >&5
+echo $ECHO_N "checking for IPv6 support... $ECHO_C" >&6
+if test "${ac_cv_ipv6_support+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/socket.h>
@@ -16090,47 +28483,54 @@ struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_ad
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_ipv6_support=yes
else
- ac_cv_ipv6_support=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_ipv6_support=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ipv6_support" >&5
-$as_echo "$ac_cv_ipv6_support" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_ipv6_support" >&5
+echo "${ECHO_T}$ac_cv_ipv6_support" >&6
if test "$ac_cv_ipv6_support" = yes; then
-$as_echo "#define HAVE_IPV6 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IPV6 1
+_ACEOF
fi
fi
-# disable mmap by default; if a mmapped file gets truncated, the process gets a SIGBUS signal
-# on reading the truncated area which we can't handle (yet).
-# lighttpd may always use mmap with files it owns (created tmp files)
-# Check whether --enable-mmap was given.
-if test "${enable_mmap+set}" = set; then :
- enableval=$enable_mmap; case "${enableval}" in
- yes) mmap=true ;;
- no) mmap=false ;;
- *) as_fn_error $? "bad value ${enableval} for --enable-mmap" "$LINENO" 5 ;;
- esac
-else
- mmap=false
-fi
-
-if test x$mmap = xtrue; then
-$as_echo "#define ENABLE_MMAP 1" >>confdefs.h
-fi
-
-
- if test "x$cross_compiling" = xyes; then
+if test "x$cross_compiling" = xyes; then
CROSS_COMPILING_TRUE=
CROSS_COMPILING_FALSE='#'
else
@@ -16140,51 +28540,216 @@ fi
fastcgi_found=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FCGI_Accept in -lfcgi" >&5
-$as_echo_n "checking for FCGI_Accept in -lfcgi... " >&6; }
-if ${ac_cv_lib_fcgi_FCGI_Accept+:} false; then :
- $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for FCGI_Accept in -lfcgi" >&5
+echo $ECHO_N "checking for FCGI_Accept in -lfcgi... $ECHO_C" >&6
+if test "${ac_cv_lib_fcgi_FCGI_Accept+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lfcgi $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char FCGI_Accept ();
int
main ()
{
-return FCGI_Accept ();
+FCGI_Accept ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_fcgi_FCGI_Accept=yes
else
- ac_cv_lib_fcgi_FCGI_Accept=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_fcgi_FCGI_Accept=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcgi_FCGI_Accept" >&5
-$as_echo "$ac_cv_lib_fcgi_FCGI_Accept" >&6; }
-if test "x$ac_cv_lib_fcgi_FCGI_Accept" = xyes; then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_fcgi_FCGI_Accept" >&5
+echo "${ECHO_T}$ac_cv_lib_fcgi_FCGI_Accept" >&6
+if test $ac_cv_lib_fcgi_FCGI_Accept = yes; then
+
- for ac_header in fastcgi.h fastcgi/fastcgi.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+for ac_header in fastcgi.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to jan@kneschke.de ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fastcgi_found=yes
@@ -16197,7 +28762,9 @@ done
fi
- if test "x$fastcgi_found" = xyes; then
+
+
+if test "x$fastcgi_found" = xyes; then
CHECK_WITH_FASTCGI_TRUE=
CHECK_WITH_FASTCGI_FALSE='#'
else
@@ -16206,25 +28773,8 @@ else
fi
-
if test "${GCC}" = "yes"; then
- CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
-fi
-
-# Check whether --enable-extra-warnings was given.
-if test "${enable_extra_warnings+set}" = set; then :
- enableval=$enable_extra_warnings; case "${enableval}" in
- yes) extrawarnings=true ;;
- no) extrawarnings=false ;;
- *) as_fn_error $? "bad value ${enableval} for --enable-extra-warnings" "$LINENO" 5 ;;
- esac
-else
- extrawarnings=false
-fi
-
-
-if test x$extrawarnings = xtrue; then
- CFLAGS="${CFLAGS} -g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wno-pointer-sign -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wl,--as-needed -Wformat-security"
+ CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic"
fi
LIGHTTPD_VERSION_ID=`echo $PACKAGE_VERSION | $AWK -F '.' '{print "(" $1 " << 16 | " $2 " << 8 | " $3 ")"}'`
@@ -16234,7 +28784,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-ac_config_files="$ac_config_files Makefile src/Makefile doc/config/conf.d/Makefile doc/config/vhosts.d/Makefile doc/config/Makefile doc/scripts/Makefile doc/initscripts/Makefile doc/systemd/Makefile doc/outdated/Makefile doc/Makefile tests/Makefile tests/docroot/Makefile tests/docroot/123/Makefile tests/docroot/www/Makefile tests/docroot/www/go/Makefile tests/docroot/www/indexfile/Makefile tests/docroot/www/expire/Makefile distribute.sh"
+ ac_config_files="$ac_config_files Makefile src/Makefile doc/Makefile tests/Makefile tests/docroot/Makefile tests/docroot/123/Makefile tests/docroot/www/Makefile tests/docroot/www/go/Makefile tests/docroot/www/indexfile/Makefile tests/docroot/www/expire/Makefile lighttpd.spec distribute.sh cygwin/Makefile cygwin/lighttpd.README openwrt/Makefile openwrt/control openwrt/lighttpd.mk"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -16254,70 +28804,39 @@ _ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
+# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
+{
(set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
+ ;;
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
- esac |
- sort
-) |
+ esac;
+} |
sed '
- /^ac_cv_env_/b end
t clear
- :clear
+ : clear
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
@@ -16326,61 +28845,94 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
DEFS=-DHAVE_CONFIG_H
ac_libobjs=
ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
- if test -n "$EXEEXT"; then
- am__EXEEXT_TRUE=
- am__EXEEXT_FALSE='#'
-else
- am__EXEEXT_TRUE='#'
- am__EXEEXT_FALSE=
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
fi
-
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
fi
if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
fi
if test -z "${NO_RDYNAMIC_TRUE}" && test -z "${NO_RDYNAMIC_FALSE}"; then
- as_fn_error $? "conditional \"NO_RDYNAMIC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
+ { { echo "$as_me:$LINENO: error: conditional \"NO_RDYNAMIC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"NO_RDYNAMIC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
fi
if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then
- as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
+ { { echo "$as_me:$LINENO: error: conditional \"CROSS_COMPILING\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"CROSS_COMPILING\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
fi
if test -z "${CHECK_WITH_FASTCGI_TRUE}" && test -z "${CHECK_WITH_FASTCGI_FALSE}"; then
- as_fn_error $? "conditional \"CHECK_WITH_FASTCGI\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
+ { { echo "$as_me:$LINENO: error: conditional \"CHECK_WITH_FASTCGI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"CHECK_WITH_FASTCGI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
fi
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
+: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
@@ -16390,253 +28942,81 @@ cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
debug=false
ac_cs_recheck=false
ac_cs_silent=false
-
SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
+done
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
else
as_expr=false
fi
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-as_me=`$as_basename -- "$0" ||
+# Name of the executable.
+as_me=`$as_basename "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -16644,111 +29024,148 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
else
- as_ln_s='cp -pR'
+ PATH_SEPARATOR=:
fi
-else
- as_ln_s='cp -pR'
+ rm -f conf$$.sh
fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
-} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
+ as_mkdir_p=:
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
+as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -16757,20 +29174,31 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by lighttpd $as_me 1.4.31, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by lighttpd $as_me 1.4.8, which was
+generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -16778,47 +29206,45 @@ generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
_ACEOF
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
-_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
+\`$as_me' instantiates files from templates according to the
+current configuration.
-Usage: $0 [OPTION]... [TAG]...
+Usage: $0 [OPTIONS] [FILE]...
-h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
Configuration files:
$config_files
@@ -16829,92 +29255,84 @@ $config_headers
Configuration commands:
$config_commands
-Report bugs to <contact@lighttpd.net>."
-
+Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+
+cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-lighttpd config.status 1.4.31
-configured by $0, generated by GNU Autoconf 2.69,
- with options \\"\$ac_cs_config\\"
+lighttpd config.status 1.4.8
+configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
+srcdir=$srcdir
+INSTALL="$INSTALL"
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
ac_need_defaults=:
while test $# != 0
do
case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
ac_shift=:
;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
+ -*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
esac
case $ac_option in
# Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
ac_need_defaults=false;;
--header | --heade | --head | --hea )
$ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
- --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
+ *) ac_config_targets="$ac_config_targets $1" ;;
esac
shift
@@ -16928,346 +29346,55 @@ if $ac_cs_silent; then
fi
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>$CONFIG_STATUS <<_ACEOF
if \$ac_cs_recheck; then
- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
fi
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>$CONFIG_STATUS <<_ACEOF
#
-# INIT-COMMANDS
+# INIT-COMMANDS section.
#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
-Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
-GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
-EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
-FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
-SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
-ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
-LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
-enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
-enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
-macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
-macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
-pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
-enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
-PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
-host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
-host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
-host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
-build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
-build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
-build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
-NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
-LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
-max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
-ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
-exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
-lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
-lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
-lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
-reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
-reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
-deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
-file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
-AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
-AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
-STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
-RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
-old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
-lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
-CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
-CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
-compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
-GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
-objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
-MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
-need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
-DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
-NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
-LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
-OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
-libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
-shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
-extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
-hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
-inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
-always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
-include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
-prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
-file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
-variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
-need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
-version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
-runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
-libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
-library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
-soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
-install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
-postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
-finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
-hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
-sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
-enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
-old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
-striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
-
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in SED \
-GREP \
-EGREP \
-FGREP \
-SHELL \
-ECHO \
-LD \
-PATH_SEPARATOR \
-NM \
-LN_S \
-lt_SP2NL \
-lt_NL2SP \
-reload_flag \
-OBJDUMP \
-deplibs_check_method \
-file_magic_cmd \
-file_magic_glob \
-want_nocaseglob \
-DLLTOOL \
-sharedlib_from_linklib_cmd \
-AR \
-AR_FLAGS \
-archiver_list_spec \
-STRIP \
-RANLIB \
-CC \
-CFLAGS \
-compiler \
-lt_cv_sys_global_symbol_pipe \
-lt_cv_sys_global_symbol_to_cdecl \
-lt_cv_sys_global_symbol_to_c_name_address \
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-nm_file_list_spec \
-lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_pic \
-lt_prog_compiler_wl \
-lt_prog_compiler_static \
-lt_cv_prog_compiler_c_o \
-need_locks \
-MANIFEST_TOOL \
-DSYMUTIL \
-NMEDIT \
-LIPO \
-OTOOL \
-OTOOL64 \
-shrext_cmds \
-export_dynamic_flag_spec \
-whole_archive_flag_spec \
-compiler_needs_object \
-with_gnu_ld \
-allow_undefined_flag \
-no_undefined_flag \
-hardcode_libdir_flag_spec \
-hardcode_libdir_separator \
-exclude_expsyms \
-include_expsyms \
-file_list_spec \
-variables_saved_for_relink \
-libname_spec \
-library_names_spec \
-soname_spec \
-install_override_mode \
-finish_eval \
-old_striplib \
-striplib; do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-# Double-quote double-evaled strings.
-for var in reload_cmds \
-old_postinstall_cmds \
-old_postuninstall_cmds \
-old_archive_cmds \
-extract_expsyms_cmds \
-old_archive_from_new_cmds \
-old_archive_from_expsyms_cmds \
-archive_cmds \
-archive_expsym_cmds \
-module_cmds \
-module_expsym_cmds \
-export_symbols_cmds \
-prelink_cmds \
-postlink_cmds \
-postinstall_cmds \
-postuninstall_cmds \
-finish_cmds \
-sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec; do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-
- PACKAGE='$PACKAGE'
- VERSION='$VERSION'
- TIMESTAMP='$TIMESTAMP'
- RM='$RM'
- ofile='$ofile'
-
-
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Handling of arguments.
+
+cat >>$CONFIG_STATUS <<\_ACEOF
for ac_config_target in $ac_config_targets
do
- case $ac_config_target in
- "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
- "doc/config/conf.d/Makefile") CONFIG_FILES="$CONFIG_FILES doc/config/conf.d/Makefile" ;;
- "doc/config/vhosts.d/Makefile") CONFIG_FILES="$CONFIG_FILES doc/config/vhosts.d/Makefile" ;;
- "doc/config/Makefile") CONFIG_FILES="$CONFIG_FILES doc/config/Makefile" ;;
- "doc/scripts/Makefile") CONFIG_FILES="$CONFIG_FILES doc/scripts/Makefile" ;;
- "doc/initscripts/Makefile") CONFIG_FILES="$CONFIG_FILES doc/initscripts/Makefile" ;;
- "doc/systemd/Makefile") CONFIG_FILES="$CONFIG_FILES doc/systemd/Makefile" ;;
- "doc/outdated/Makefile") CONFIG_FILES="$CONFIG_FILES doc/outdated/Makefile" ;;
- "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
- "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
- "tests/docroot/Makefile") CONFIG_FILES="$CONFIG_FILES tests/docroot/Makefile" ;;
- "tests/docroot/123/Makefile") CONFIG_FILES="$CONFIG_FILES tests/docroot/123/Makefile" ;;
- "tests/docroot/www/Makefile") CONFIG_FILES="$CONFIG_FILES tests/docroot/www/Makefile" ;;
- "tests/docroot/www/go/Makefile") CONFIG_FILES="$CONFIG_FILES tests/docroot/www/go/Makefile" ;;
- "tests/docroot/www/indexfile/Makefile") CONFIG_FILES="$CONFIG_FILES tests/docroot/www/indexfile/Makefile" ;;
- "tests/docroot/www/expire/Makefile") CONFIG_FILES="$CONFIG_FILES tests/docroot/www/expire/Makefile" ;;
- "distribute.sh") CONFIG_FILES="$CONFIG_FILES distribute.sh" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+ "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+ "tests/docroot/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/docroot/Makefile" ;;
+ "tests/docroot/123/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/docroot/123/Makefile" ;;
+ "tests/docroot/www/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/docroot/www/Makefile" ;;
+ "tests/docroot/www/go/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/docroot/www/go/Makefile" ;;
+ "tests/docroot/www/indexfile/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/docroot/www/indexfile/Makefile" ;;
+ "tests/docroot/www/expire/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/docroot/www/expire/Makefile" ;;
+ "lighttpd.spec" ) CONFIG_FILES="$CONFIG_FILES lighttpd.spec" ;;
+ "distribute.sh" ) CONFIG_FILES="$CONFIG_FILES distribute.sh" ;;
+ "cygwin/Makefile" ) CONFIG_FILES="$CONFIG_FILES cygwin/Makefile" ;;
+ "cygwin/lighttpd.README" ) CONFIG_FILES="$CONFIG_FILES cygwin/lighttpd.README" ;;
+ "openwrt/Makefile" ) CONFIG_FILES="$CONFIG_FILES openwrt/Makefile" ;;
+ "openwrt/control" ) CONFIG_FILES="$CONFIG_FILES openwrt/control" ;;
+ "openwrt/lighttpd.mk" ) CONFIG_FILES="$CONFIG_FILES openwrt/lighttpd.mk" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
esac
done
-
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
@@ -17279,1321 +29406,875 @@ if $ac_need_defaults; then
fi
# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
+# simply because there is no reason to put it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
+# Create a temporary directory, and hook for its removal unless debugging.
$debug ||
{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
}
+
# Create a (secure) tmp directory for tmp files.
{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
} ||
{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
+#
+# CONFIG_FILES section.
+#
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
- ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
- if test -z "$ac_tt"; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@mkdir_p@,$mkdir_p,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@am__tar@,$am__tar,;t t
+s,@am__untar@,$am__untar,;t t
+s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+s,@MAINT@,$MAINT,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@EGREP@,$EGREP,;t t
+s,@CPP@,$CPP,;t t
+s,@LN_S@,$LN_S,;t t
+s,@NO_RDYNAMIC_TRUE@,$NO_RDYNAMIC_TRUE,;t t
+s,@NO_RDYNAMIC_FALSE@,$NO_RDYNAMIC_FALSE,;t t
+s,@U@,$U,;t t
+s,@ANSI2KNR@,$ANSI2KNR,;t t
+s,@ECHO@,$ECHO,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@CXX@,$CXX,;t t
+s,@CXXFLAGS@,$CXXFLAGS,;t t
+s,@ac_ct_CXX@,$ac_ct_CXX,;t t
+s,@CXXDEPMODE@,$CXXDEPMODE,;t t
+s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
+s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
+s,@CXXCPP@,$CXXCPP,;t t
+s,@F77@,$F77,;t t
+s,@FFLAGS@,$FFLAGS,;t t
+s,@ac_ct_F77@,$ac_ct_F77,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@MYSQL_CONFIG@,$MYSQL_CONFIG,;t t
+s,@MYSQL_LIBS@,$MYSQL_LIBS,;t t
+s,@MYSQL_INCLUDE@,$MYSQL_INCLUDE,;t t
+s,@LDAP_LIB@,$LDAP_LIB,;t t
+s,@LBER_LIB@,$LBER_LIB,;t t
+s,@ATTR_LIB@,$ATTR_LIB,;t t
+s,@DL_LIB@,$DL_LIB,;t t
+s,@SSL_LIB@,$SSL_LIB,;t t
+s,@PCRECONFIG@,$PCRECONFIG,;t t
+s,@PCRE_LIB@,$PCRE_LIB,;t t
+s,@Z_LIB@,$Z_LIB,;t t
+s,@BZ_LIB@,$BZ_LIB,;t t
+s,@PKG_CONFIG@,$PKG_CONFIG,;t t
+s,@FAM_CFLAGS@,$FAM_CFLAGS,;t t
+s,@FAM_LIBS@,$FAM_LIBS,;t t
+s,@XML_CFLAGS@,$XML_CFLAGS,;t t
+s,@XML_LIBS@,$XML_LIBS,;t t
+s,@SQLITE_CFLAGS@,$SQLITE_CFLAGS,;t t
+s,@SQLITE_LIBS@,$SQLITE_LIBS,;t t
+s,@GDBM_LIB@,$GDBM_LIB,;t t
+s,@MEMCACHE_LIB@,$MEMCACHE_LIB,;t t
+s,@LUACONFIG@,$LUACONFIG,;t t
+s,@LUA_CFLAGS@,$LUA_CFLAGS,;t t
+s,@LUA_LIBS@,$LUA_LIBS,;t t
+s,@CRYPT_LIB@,$CRYPT_LIB,;t t
+s,@SENDFILE_LIB@,$SENDFILE_LIB,;t t
+s,@CROSS_COMPILING_TRUE@,$CROSS_COMPILING_TRUE,;t t
+s,@CROSS_COMPILING_FALSE@,$CROSS_COMPILING_FALSE,;t t
+s,@CHECK_WITH_FASTCGI_TRUE@,$CHECK_WITH_FASTCGI_TRUE,;t t
+s,@CHECK_WITH_FASTCGI_FALSE@,$CHECK_WITH_FASTCGI_FALSE,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any. Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[ ]*#[ ]*define[ ][ ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- for (key in D) D_is_set[key] = 1
- FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
- line = \$ 0
- split(line, arg, " ")
- if (arg[1] == "#") {
- defundef = arg[2]
- mac1 = arg[3]
- } else {
- defundef = substr(arg[1], 2)
- mac1 = arg[2]
- }
- split(mac1, mac2, "(") #)
- macro = mac2[1]
- prefix = substr(line, 1, index(line, defundef) - 1)
- if (D_is_set[macro]) {
- # Preserve the white space surrounding the "#".
- print prefix "define", macro P[macro] D[macro]
- next
- } else {
- # Replace #undef with comments. This is necessary, for example,
- # in the case of _POSIX_SOURCE, which is predefined and required
- # on some systems where configure will not decide to define it.
- if (defundef == "undef") {
- print "/*", prefix defundef, macro, "*/"
- next
- }
- }
-}
-{ print }
-_ACAWK
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- ac_dir=`$as_dirname -- "$ac_file" ||
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
ac_builddir=.
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
case $srcdir in
- .) # We are building in place.
+ .) # No --srcdir option. We are building in place.
ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
esac
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- esac
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
$extrasub
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+cat >>$CONFIG_STATUS <<\_ACEOF
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ # Do quote $f, to prevent DOS paths from being IFS'd.
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
+ else
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
- } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
else
- rm -f "$ac_file"
- mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
fi
else
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
+ cat $tmp/config.h
+ rm -f $tmp/config.h
fi
-# Compute "$ac_file"'s index in $config_headers.
-_am_arg="$ac_file"
+# Compute $ac_file's index in $config_headers.
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
- $_am_arg | $_am_arg:* )
+ $ac_file | $ac_file:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
-$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$_am_arg" : 'X\(//\)[^/]' \| \
- X"$_am_arg" : 'X\(//\)$' \| \
- X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`/stamp-h$_am_stamp_count
- ;;
-
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
- ;;
- "libtool":C)
-
- # See if we are running on zsh, and set the options which allow our
- # commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
-
- cfgfile="${ofile}T"
- trap "$RM \"$cfgfile\"; exit 1" 1 2 15
- $RM "$cfgfile"
-
- cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is part of GNU Libtool.
#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
+# CONFIG_COMMANDS section.
#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-# The names of the tagged configurations supported by this script.
-available_tags=""
-
-# ### BEGIN LIBTOOL CONFIG
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="\$SED -e 1s/^X//"
-
-# A grep program that handles long lines.
-GREP=$lt_GREP
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# A literal string matcher.
-FGREP=$lt_FGREP
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# An echo program that protects backslashes.
-ECHO=$lt_ECHO
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Which release of libtool.m4 was used?
-macro_version=$macro_version
-macro_revision=$macro_revision
-
-# What type of objects to build.
-pic_mode=$pic_mode
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The PATH separator for the build system.
-PATH_SEPARATOR=$lt_PATH_SEPARATOR
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# A BSD- or MS-compatible name lister.
-NM=$lt_NM
-
-# Whether we need soft or hard links.
-LN_S=$lt_LN_S
-
-# What is the maximum length of a command?
-max_cmd_len=$max_cmd_len
-
-# Object file suffix (normally "o").
-objext=$ac_objext
-
-# Executable file suffix (normally "").
-exeext=$exeext
-
-# whether the shell understands "unset".
-lt_unset=$lt_unset
-
-# turn spaces into newlines.
-SP2NL=$lt_lt_SP2NL
-
-# turn newlines into spaces.
-NL2SP=$lt_lt_NL2SP
-
-# convert \$build file names to \$host format.
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-
-# convert \$build files to toolchain format.
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-
-# An object symbol dumper.
-OBJDUMP=$lt_OBJDUMP
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method = "file_magic".
-file_magic_cmd=$lt_file_magic_cmd
-
-# How to find potential files when deplibs_check_method = "file_magic".
-file_magic_glob=$lt_file_magic_glob
-
-# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-want_nocaseglob=$lt_want_nocaseglob
-
-# DLL creation program.
-DLLTOOL=$lt_DLLTOOL
-
-# Command to associate shared and link libraries.
-sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-
-# The archiver.
-AR=$lt_AR
-
-# Flags to create an archive.
-AR_FLAGS=$lt_AR_FLAGS
-
-# How to feed a file listing to the archiver.
-archiver_list_spec=$lt_archiver_list_spec
-
-# A symbol stripping program.
-STRIP=$lt_STRIP
-
-# Commands used to install an old-style archive.
-RANLIB=$lt_RANLIB
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Whether to use a lock for old archive extraction.
-lock_old_archive_extraction=$lock_old_archive_extraction
-
-# A C compiler.
-LTCC=$lt_CC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_CFLAGS
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration.
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair.
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# Transform the output of nm in a C name address pair when lib prefix is needed.
-global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
-
-# Specify filename containing input files for \$NM.
-nm_file_list_spec=$lt_nm_file_list_spec
-
-# The root where to search for dependent libraries,and in which our libraries should be installed.
-lt_sysroot=$lt_sysroot
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# Used to examine libraries when file_magic_cmd begins with "file".
-MAGIC_CMD=$MAGIC_CMD
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Manifest tool.
-MANIFEST_TOOL=$lt_MANIFEST_TOOL
-
-# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
-DSYMUTIL=$lt_DSYMUTIL
-
-# Tool to change global to local symbols on Mac OS X.
-NMEDIT=$lt_NMEDIT
-
-# Tool to manipulate fat objects and archives on Mac OS X.
-LIPO=$lt_LIPO
-
-# ldd/readelf like tool for Mach-O binaries on Mac OS X.
-OTOOL=$lt_OTOOL
-
-# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
-OTOOL64=$lt_OTOOL64
-
-# Old archive suffix (normally "a").
-libext=$libext
-
-# Shared library suffix (normally ".so").
-shrext_cmds=$lt_shrext_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at link time.
-variables_saved_for_relink=$lt_variables_saved_for_relink
-
-# Do we need the "lib" prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Library versioning type.
-version_type=$version_type
-
-# Shared library runtime path variable.
-runpath_var=$runpath_var
-
-# Shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Permission mode override for installation of shared libraries.
-install_override_mode=$lt_install_override_mode
-
-# Command to use after installation of a shared archive.
-postinstall_cmds=$lt_postinstall_cmds
-
-# Command to use after uninstallation of a shared archive.
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# As "finish_cmds", except a single script fragment to be evaled but
-# not shown.
-finish_eval=$lt_finish_eval
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Compile-time system search path for libraries.
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds
-
-# A language specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=$lt_postlink_cmds
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# ### END LIBTOOL CONFIG
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
-_LT_EOF
+ ac_builddir=.
- case $host_os in
- aix3*)
- cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
fi
-_LT_EOF
- ;;
- esac
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
-ltmain="$ac_aux_dir/ltmain.sh"
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- if test x"$xsi_shell" = xyes; then
- sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-func_dirname ()\
-{\
-\ case ${1} in\
-\ */*) func_dirname_result="${1%/*}${2}" ;;\
-\ * ) func_dirname_result="${3}" ;;\
-\ esac\
-} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_basename ()$/,/^} # func_basename /c\
-func_basename ()\
-{\
-\ func_basename_result="${1##*/}"\
-} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-func_dirname_and_basename ()\
-{\
-\ case ${1} in\
-\ */*) func_dirname_result="${1%/*}${2}" ;;\
-\ * ) func_dirname_result="${3}" ;;\
-\ esac\
-\ func_basename_result="${1##*/}"\
-} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-func_stripname ()\
-{\
-\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-\ # positional parameters, so assign one to ordinary parameter first.\
-\ func_stripname_result=${3}\
-\ func_stripname_result=${func_stripname_result#"${1}"}\
-\ func_stripname_result=${func_stripname_result%"${2}"}\
-} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-func_split_long_opt ()\
-{\
-\ func_split_long_opt_name=${1%%=*}\
-\ func_split_long_opt_arg=${1#*=}\
-} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-func_split_short_opt ()\
-{\
-\ func_split_short_opt_arg=${1#??}\
-\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-func_lo2o ()\
-{\
-\ case ${1} in\
-\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-\ *) func_lo2o_result=${1} ;;\
-\ esac\
-} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_xform ()$/,/^} # func_xform /c\
-func_xform ()\
-{\
- func_xform_result=${1%.*}.lo\
-} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_arith ()$/,/^} # func_arith /c\
-func_arith ()\
-{\
- func_arith_result=$(( $* ))\
-} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_len ()$/,/^} # func_len /c\
-func_len ()\
-{\
- func_len_result=${#1}\
-} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-fi
-
-if test x"$lt_shell_append" = xyes; then
- sed -e '/^func_append ()$/,/^} # func_append /c\
-func_append ()\
-{\
- eval "${1}+=\\${2}"\
-} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-func_append_quoted ()\
-{\
-\ func_quote_for_eval "${2}"\
-\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- # Save a `func_append' function call where possible by direct use of '+='
- sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-else
- # Save a `func_append' function call even when '+=' is not available
- sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-fi
-
-
- mv -f "$cfgfile" "$ofile" ||
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
;;
-
esac
-done # for ac_tag
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-as_fn_exit 0
+{ (exit 0); exit 0; }
_ACEOF
+chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
@@ -18613,17 +30294,12 @@ if test "$no_create" != yes; then
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+ $ac_cs_success || { (exit 1); exit 1; }
fi
-do_build="mod_cgi mod_fastcgi mod_extforward mod_proxy mod_evhost mod_simple_vhost mod_access mod_alias mod_setenv mod_usertrack mod_auth mod_status mod_accesslog"
-do_build="$do_build mod_rrdtool mod_secdownload mod_expire mod_compress mod_dirlisting mod_indexfile mod_userdir mod_webdav mod_staticfile mod_scgi mod_flv_streaming"
+do_build="mod_cgi mod_fastcgi mod_proxy mod_evhost mod_simple_vhost mod_access mod_alias mod_setenv mod_usertrack mod_auth mod_status mod_accesslog mod_rrdtool mod_secdownload mod_expire mod_compress mod_dirlisting mod_indexfiles mod_userdir mod_webdav mod_staticfile mod_scgi"
plugins="mod_rewrite mod_redirect mod_ssi mod_trigger_b4_dl"
features="regex-conditionals"
@@ -18642,7 +30318,7 @@ else
no_build="$no_build $plugins"
fi
-plugins="mod_cml mod_magnet"
+plugins="mod_cml"
if test ! "x$LUA_LIBS" = x; then
do_build="$do_build $plugins"
else
@@ -18691,6 +30367,7 @@ else
disable_feature="$disable_feature $features"
fi
+# no crypt call
features="auth-crypt"
if test "$ac_cv_search_crypt" = no; then
disable_feature="$disable_feature $features"
@@ -18726,14 +30403,7 @@ else
disable_feature="$disable_feature $features"
fi
-features="webdav-locks"
-if test "x$UUID_LIBS" \!= x; then
- enable_feature="$enable_feature $features"
-else
- disable_feature="$disable_feature $features"
-fi
-
-
+## output
$ECHO
$ECHO "Plugins:"
diff --git a/configure.ac b/configure.in
index 04f1eaf..0f94f5c 100644
--- a/configure.ac
+++ b/configure.in
@@ -1,21 +1,19 @@
-dnl -*- Autoconf -*-
-dnl Process this file with autoconf to produce a configure script.
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
-AC_INIT([lighttpd], [1.4.31], [contact@lighttpd.net])
+AC_INIT(lighttpd, 1.4.8, jan@kneschke.de)
AC_CONFIG_SRCDIR([src/server.c])
-AC_CONFIG_HEADER([config.h])
-AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE([-Wall -Wportability -Wno-override -Werror foreign dist-bzip2 tar-ustar])
+AM_INIT_AUTOMAKE
+
+AC_CONFIG_HEADER([config.h])
-dnl enable with --enable-silent-rules or make V=0 (needs automake >= 1.11)
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
+AM_MAINTAINER_MODE
-dnl Checks for programs.
+# Checks for programs.
AC_PROG_CC
-AM_PROG_CC_C_O
AC_PROG_LD
AC_PROG_INSTALL
AC_PROG_AWK
@@ -32,7 +30,7 @@ AC_MINIX
dnl AC_CANONICAL_HOST
case $host_os in
*darwin*|*cygwin*|*aix*|*mingw* ) NO_RDYNAMIC=yes;;
- * ) NO_RDYNAMIC=no;;
+ * ) NO_RDYNAMIC=no;;
esac
AM_CONDITIONAL(NO_RDYNAMIC, test x$NO_RDYNAMIC = xyes)
@@ -42,25 +40,25 @@ dnl more automake stuff
AM_C_PROTOTYPES
dnl libtool
-AC_DISABLE_STATIC
+AC_DISABLE_STATIC
AC_ENABLE_SHARED
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
-dnl for solaris
+dnl for solaris
CPPFLAGS="${CPPFLAGS} -D_REENTRANT -D__EXTENSIONS__"
-dnl Checks for header files.
+# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \
sys/socket.h sys/time.h unistd.h sys/sendfile.h sys/uio.h \
getopt.h sys/epoll.h sys/select.h poll.h sys/poll.h sys/devpoll.h sys/filio.h \
-sys/mman.h sys/event.h port.h pwd.h sys/syslimits.h \
-sys/resource.h sys/un.h syslog.h sys/prctl.h uuid/uuid.h])
+sys/mman.h sys/event.h sys/port.h pwd.h sys/syslimits.h \
+sys/resource.h sys/un.h syslog.h])
-dnl Checks for typedefs, structures, and compiler characteristics.
+# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_CHAR_UNSIGNED
@@ -68,61 +66,19 @@ AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
-AC_CHECK_MEMBER(struct tm.tm_gmtoff,[AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm])],,[#include <time.h>])
+AC_CHECK_MEMBER(struct tm.tm_gmtoff,AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm]),,[#include <time.h>])
AC_CHECK_TYPES(struct sockaddr_storage,,,[#include <sys/socket.h>])
AC_CHECK_TYPES(socklen_t,,,[#include <sys/types.h>
#include <sys/socket.h>])
-dnl Checks for library functions.
+# Checks for library functions.
AC_FUNC_FORK
dnl AC_FUNC_MALLOC
-dnl AC_FUNC_MMAP
+#AC_FUNC_MMAP
dnl AC_FUNC_REALLOC
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_STRFTIME
-AC_CHECK_FUNCS([issetugid inet_pton])
-
-if test -z "$PKG_CONFIG"; then
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-fi
-
-dnl checking for libev
-AC_MSG_CHECKING(for libev support)
-AC_ARG_WITH(libev,
- AC_HELP_STRING([--with-libev@<:@=PATH@:>@],[Include libev support for fdevent handlers in PATH/include and PATH/lib]),
- [WITH_LIBEV=$withval],[WITH_LIBEV=no])
-
-LIBEV_CFLAGS=""
-LIBEV_LIBS=""
-
-if test "$WITH_LIBEV" != "no"; then
- PKG_CHECK_MODULES(LIBEV, libev, [], [
- dnl no pkg-config for libev, searching manually:
-
- if test "$WITH_LIBEV" != "yes"; then
- LIBEV_CFLAGS="-I$WITH_LIBEV/include"
- LIBEV_LIBS="-L$WITH_LIBEV/lib -lev"
- else
- AC_CHECK_HEADERS([ev.h],[
- AC_CHECK_LIB([ev], [ev_time], [
- LIBEV_CFLAGS=""
- LIBEV_LIBS="-lev"
- ],[
- AC_MSG_ERROR([libev not found])
- ]
- )],[
- AC_MSG_ERROR([libev not found])
- ]
- )
- fi
- ])
-
- AC_DEFINE([HAVE_LIBEV], [1], [libev support])
-fi
-
-AC_SUBST(LIBEV_CFLAGS)
-AC_SUBST(LIBEV_LIBS)
dnl Checks for database.
MYSQL_INCLUDE=""
@@ -134,7 +90,7 @@ AC_ARG_WITH(mysql,
[WITH_MYSQL=$withval],[WITH_MYSQL=no])
if test "$WITH_MYSQL" != "no"; then
- AC_MSG_RESULT(yes)
+ AC_MSG_RESULT(yes)
if test "$WITH_MYSQL" = "yes"; then
AC_PATH_PROG(MYSQL_CONFIG, mysql_config)
else
@@ -185,7 +141,6 @@ if test "$WITH_LDAP" != "no"; then
LDAP_LIB=-lldap
AC_DEFINE([HAVE_LIBLDAP], [1], [libldap])
AC_DEFINE([HAVE_LDAP_H], [1])
- AC_DEFINE([LDAP_DEPRECATED], [1], [Using deprecated ldap api])
])
])
AC_SUBST(LDAP_LIB)
@@ -215,7 +170,7 @@ if test "$WITH_ATTR" != "no"; then
AC_SUBST(ATTR_LIB)
fi
-dnl openssl on solaris needs -lsocket -lnsl
+## openssl on solaris needs -lsocket -lnsl
AC_SEARCH_LIBS(socket,socket)
AC_SEARCH_LIBS(gethostbyname,nsl socket)
AC_SEARCH_LIBS(hstrerror,resolv)
@@ -282,8 +237,8 @@ if test "x$use_openssl" = "xyes"; then
AC_CHECK_HEADERS([openssl/ssl.h])
OLDLIBS="$LIBS"
- AC_CHECK_LIB(crypto, BIO_f_base64, [
- AC_CHECK_LIB(ssl, SSL_new, [ SSL_LIB="-lssl -lcrypto"
+ AC_CHECK_LIB(crypto, BIO_f_base64, [
+ AC_CHECK_LIB(ssl, SSL_new, [ SSL_LIB="-lssl -lcrypto"
AC_DEFINE(HAVE_LIBSSL, [], [Have libssl]) ], [], [ -lcrypto "$DL_LIB" ])
], [], [])
LIBS="$OLDLIBS"
@@ -295,38 +250,33 @@ AC_ARG_WITH(pcre, AC_HELP_STRING([--with-pcre],[Enable pcre support (default yes
[WITH_PCRE=$withval],[WITH_PCRE=yes])
AC_MSG_RESULT([$WITH_PCRE])
-if test "$WITH_PCRE" != "no"; then
+if test "x$cross_compiling" = xno -a "$WITH_PCRE" != "no"; then
AC_PATH_PROG(PCRECONFIG, pcre-config)
- if test x"$PCRECONFIG" != x; then
+ if test x"$PCRECONFIG" != x; then
PCRE_LIB=`$PCRECONFIG --libs`
CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`"
- AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
- AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
- else
- AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre])
+ OLDLIBS="$LIBS"
+ LIBS="$LIBS $PCRE_LIB"
+ AC_CHECK_LIB(pcre, pcre_compile, [
+ AC_CHECK_HEADERS([pcre.h], [
+ AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
+ AC_DEFINE([HAVE_PCRE_H], [1])
+ ])
+ ])
+ LIBS="$OLDLIBS"
fi
fi
AC_SUBST(PCRE_LIB)
-AC_MSG_CHECKING(for zlib support)
-AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib],[Enable zlib support for mod_compress]),
- [WITH_ZLIB=$withval],[WITH_ZLIB=yes])
-AC_MSG_RESULT([$WITH_ZLIB])
-
-if test "$WITH_ZLIB" != "no"; then
- AC_CHECK_LIB(z, deflate, [
- AC_CHECK_HEADERS([zlib.h],[
- Z_LIB=-lz
- AC_DEFINE([HAVE_LIBZ], [1], [libz])
- AC_DEFINE([HAVE_ZLIB_H], [1])
- ])
+AC_CHECK_LIB(z, deflate, [
+ AC_CHECK_HEADERS([zlib.h],[
+ Z_LIB=-lz
+ AC_DEFINE([HAVE_LIBZ], [1], [libz])
+ AC_DEFINE([HAVE_ZLIB_H], [1])
])
- if test x$Z_LIB = x; then
- AC_MSG_ERROR([zlib-headers and/or libs where not found, install them or build with --without-zlib])
- fi
-fi
+])
AC_SUBST(Z_LIB)
AC_MSG_CHECKING(for bzip2 support)
@@ -342,12 +292,13 @@ if test "$WITH_BZIP2" != "no"; then
AC_DEFINE([HAVE_BZLIB_H], [1])
])
])
- if test x$BZ_LIB = x; then
- AC_MSG_ERROR([bzip2-headers and/or libs where not found, install them or build with --without-bzip2])
- fi
fi
AC_SUBST(BZ_LIB)
+if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+fi
+
dnl Check for gamin
AC_MSG_CHECKING(for FAM)
AC_ARG_WITH(fam, AC_HELP_STRING([--with-fam],[fam/gamin for reducing number of stat() calls]),
@@ -372,10 +323,6 @@ if test "$WITH_FAM" != "no"; then
LIBS=$FAM_LIBS
AC_CHECK_FUNCS([FAMNoExists])
LIBS=$OLD_LIBS
-
- if test x$FAM_LIBS = x; then
- AC_MSG_ERROR([fam/gamin-headers and/or libs where not found, install them or build with --without-fam])
- fi
fi
AC_MSG_CHECKING(for properties in mod_webdav)
@@ -392,24 +339,7 @@ if test "$WITH_WEBDAV_PROPS" != "no"; then
AC_DEFINE([HAVE_SQLITE3], [1], [libsqlite3])
AC_DEFINE([HAVE_SQLITE3_H], [1], [sqlite3.h])
])
-
- AC_MSG_CHECKING(for locks in mod_webdav)
- AC_ARG_WITH(webdav-locks, AC_HELP_STRING([--with-webdav-locks],[locks in mod_webdav]),
- [WITH_WEBDAV_LOCKS=$withval],[WITH_WEBDAV_LOCKS=no])
- AC_MSG_RESULT([$WITH_WEBDAV_LOCKS])
-
- if test "$WITH_WEBDAV_LOCKS" != "no"; then
- AC_CHECK_LIB(uuid, uuid_unparse, [
- AC_CHECK_HEADERS([uuid/uuid.h],[
- UUID_LIBS=-luuid
- AC_DEFINE([HAVE_UUID], [1], [libuuid])
- AC_DEFINE([HAVE_UUID_H], [1], [uuid/uuid.h is available])
- ])
- ])
-
- fi
fi
-AC_SUBST(UUID_LIBS)
dnl Check for gdbm
AC_MSG_CHECKING(for gdbm)
@@ -443,33 +373,38 @@ if test "$WITH_MEMCACHE" != "no"; then
])
AC_SUBST(MEMCACHE_LIB)
fi
-
+
dnl Check for lua
-AC_MSG_CHECKING(if lua-support is requested)
+AC_MSG_CHECKING(for lua)
AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua engine for mod_cml]),
[WITH_LUA=$withval],[WITH_LUA=no])
AC_MSG_RESULT($WITH_LUA)
if test "$WITH_LUA" != "no"; then
- if test "$WITH_LUA" = "yes"; then
- WITH_LUA=lua
- fi
- PKG_CHECK_MODULES(LUA, $WITH_LUA >= 5.1, [
- AC_DEFINE([HAVE_LUA], [1], [liblua])
- AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
- ],[
- dnl for debian based systems
- PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
- AC_DEFINE([HAVE_LUA], [1], [liblua])
- AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
- ],[
- dnl for freebsd
- PKG_CHECK_MODULES(LUA, lua-5.1 >= 5.1, [
+ AC_PATH_PROG(LUACONFIG, lua-config)
+
+ if test x"$LUACONFIG" != x; then
+ LUA_CFLAGS=`$LUACONFIG --include`
+ LUA_LIBS=`$LUACONFIG --libs --extralibs`
AC_DEFINE([HAVE_LUA], [1], [liblua])
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
- ])
- ])
- ])
+ else
+ AC_CHECK_LIB(lua, lua_open, [
+ AC_CHECK_HEADERS([lua.h],[
+ LUA_LIBS="-llua -llualib"
+ AC_DEFINE([HAVE_LUA], [1], [liblua])
+ AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
+ ])
+ ])
+ fi
+
+ if test x"$LUA_LIBS" = x; then
+ # try pkgconfig
+ PKG_CHECK_MODULES(LUA, lua, [
+ AC_DEFINE([HAVE_LUA], [1], [liblua])
+ AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
+ ])
+ fi
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LIBS)
@@ -505,10 +440,10 @@ case $host_os in
esac
AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
- strdup strerror strstr strtol sendfile getopt socket lstat \
- gethostbyname poll epoll_ctl getrlimit chroot \
- getuid select signal pathconf madvise posix_fadvise posix_madvise \
- writev sigaction sendfile64 send_file kqueue port_create localtime_r gmtime_r])
+ strdup strerror strstr strtol sendfile getopt socket \
+ gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \
+ getuid select signal pathconf madvise\
+ writev sigaction sendfile64 send_file kqueue port_create localtime_r])
AC_MSG_CHECKING(for Large File System support)
AC_ARG_ENABLE(lfs,
@@ -525,7 +460,7 @@ AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(off_t)
if test "x$ac_cv_func_sendfile" = xyes; then
- dnl check if sendfile works
+ # check if sendfile works
AC_MSG_CHECKING(if sendfile works)
if test "x$cross_compiling" = xno; then
AC_TRY_RUN([
@@ -537,13 +472,13 @@ if test "x$ac_cv_func_sendfile" = xyes; then
int o = 0;
if (-1 == sendfile(-1, 0, &o, 0) && errno == ENOSYS) return -1;
return 0;
- } ],
- AC_MSG_RESULT(yes),
- [ AC_MSG_RESULT(no)
+ } ],
+ AC_MSG_RESULT(yes),
+ [ AC_MSG_RESULT(no)
AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile]) ] )
else
- AC_MSG_RESULT(no, cross-compiling)
- AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile])
+ AC_MSG_RESULT(no, cross-compiling)
+ AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile])
fi
fi
@@ -563,84 +498,46 @@ if test x$ipv6 = xtrue; then
#include <sys/socket.h>
#include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0; ],
[ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
-
+
if test "$ac_cv_ipv6_support" = yes; then
AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
fi
fi
-# disable mmap by default; if a mmapped file gets truncated, the process gets a SIGBUS signal
-# on reading the truncated area which we can't handle (yet).
-# lighttpd may always use mmap with files it owns (created tmp files)
-AC_ARG_ENABLE(mmap,
- AC_HELP_STRING([--enable-mmap],[use mmap if available (DANGEROUS, allows local users to trigger SIGBUS crashes)]),
- [case "${enableval}" in
- yes) mmap=true ;;
- no) mmap=false ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmap) ;;
- esac],[mmap=false])
-
-if test x$mmap = xtrue; then
- AC_DEFINE(ENABLE_MMAP, [1], [Use mmap if available])
-fi
-
AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
dnl check for fastcgi lib, for the tests only
fastcgi_found=no
AC_CHECK_LIB(fcgi, FCGI_Accept, [
- AC_CHECK_HEADERS([fastcgi.h fastcgi/fastcgi.h],[
+ AC_CHECK_HEADERS([fastcgi.h],[
fastcgi_found=yes
])
])
AM_CONDITIONAL(CHECK_WITH_FASTCGI, test "x$fastcgi_found" = xyes)
-
-dnl check for extra compiler options (warning options)
if test "${GCC}" = "yes"; then
- CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
-fi
-
-AC_ARG_ENABLE(extra-warnings,
- AC_HELP_STRING([--enable-extra-warnings],[enable extra warnings (gcc specific)]),
- [case "${enableval}" in
- yes) extrawarnings=true ;;
- no) extrawarnings=false ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-warnings) ;;
- esac],[extrawarnings=false])
-
-if test x$extrawarnings = xtrue; then
- CFLAGS="${CFLAGS} -g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wno-pointer-sign -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wl,--as-needed -Wformat-security"
+ CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic"
fi
dnl build version-id
LIGHTTPD_VERSION_ID=`echo $PACKAGE_VERSION | $AWK -F '.' '{print "(" $1 " << 16 | " $2 " << 8 | " $3 ")"}'`
-AC_DEFINE_UNQUOTED([LIGHTTPD_VERSION_ID], [$LIGHTTPD_VERSION_ID], [lighttpd-version-id])
-
-AC_CONFIG_FILES([Makefile src/Makefile
- doc/config/conf.d/Makefile \
- doc/config/vhosts.d/Makefile \
- doc/config/Makefile \
- doc/scripts/Makefile \
- doc/initscripts/Makefile \
- doc/systemd/Makefile \
- doc/outdated/Makefile \
- doc/Makefile \
- tests/Makefile \
+AC_DEFINE_UNQUOTED([LIGHTTPD_VERSION_ID], [$LIGHTTPD_VERSION_ID], [lighttpd-version-id])
+
+AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile tests/Makefile \
tests/docroot/Makefile \
tests/docroot/123/Makefile \
tests/docroot/www/Makefile \
tests/docroot/www/go/Makefile \
tests/docroot/www/indexfile/Makefile \
tests/docroot/www/expire/Makefile \
- distribute.sh])
+ lighttpd.spec distribute.sh cygwin/Makefile cygwin/lighttpd.README
+ openwrt/Makefile openwrt/control openwrt/lighttpd.mk])
AC_OUTPUT
-do_build="mod_cgi mod_fastcgi mod_extforward mod_proxy mod_evhost mod_simple_vhost mod_access mod_alias mod_setenv mod_usertrack mod_auth mod_status mod_accesslog"
-do_build="$do_build mod_rrdtool mod_secdownload mod_expire mod_compress mod_dirlisting mod_indexfile mod_userdir mod_webdav mod_staticfile mod_scgi mod_flv_streaming"
+do_build="mod_cgi mod_fastcgi mod_proxy mod_evhost mod_simple_vhost mod_access mod_alias mod_setenv mod_usertrack mod_auth mod_status mod_accesslog mod_rrdtool mod_secdownload mod_expire mod_compress mod_dirlisting mod_indexfiles mod_userdir mod_webdav mod_staticfile mod_scgi"
plugins="mod_rewrite mod_redirect mod_ssi mod_trigger_b4_dl"
features="regex-conditionals"
@@ -659,7 +556,7 @@ else
no_build="$no_build $plugins"
fi
-plugins="mod_cml mod_magnet"
+plugins="mod_cml"
if test ! "x$LUA_LIBS" = x; then
do_build="$do_build $plugins"
else
@@ -708,7 +605,7 @@ else
disable_feature="$disable_feature $features"
fi
-dnl no crypt call
+# no crypt call
features="auth-crypt"
if test "$ac_cv_search_crypt" = no; then
disable_feature="$disable_feature $features"
@@ -744,15 +641,7 @@ else
disable_feature="$disable_feature $features"
fi
-features="webdav-locks"
-if test "x$UUID_LIBS" \!= x; then
- enable_feature="$enable_feature $features"
-else
- disable_feature="$disable_feature $features"
-fi
-
-
-dnl output
+## output
$ECHO
$ECHO "Plugins:"
diff --git a/cygwin/Makefile.am b/cygwin/Makefile.am
new file mode 100644
index 0000000..8892f64
--- /dev/null
+++ b/cygwin/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST=lighttpd.README setup.hint
diff --git a/doc/systemd/Makefile.in b/cygwin/Makefile.in
index 8f2b107..f0339e1 100644
--- a/doc/systemd/Makefile.in
+++ b/cygwin/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,12 +13,15 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -34,31 +36,23 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
-subdir = doc/systemd
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+subdir = cygwin
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/lighttpd.README.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
+CONFIG_CLEAN_FILES = lighttpd.README
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ATTR_LIB = @ATTR_LIB@
AUTOCONF = @AUTOCONF@
@@ -69,73 +63,69 @@ BZ_LIB = @BZ_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@
+CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
+CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
CRYPT_LIB = @CRYPT_LIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
+ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
FAM_CFLAGS = @FAM_CFLAGS@
FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
+FFLAGS = @FFLAGS@
GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LBER_LIB = @LBER_LIB@
-LD = @LD@
LDAP_LIB = @LDAP_LIB@
LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LUACONFIG = @LUACONFIG@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
+NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@
+NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@
OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
PCRE_LIB = @PCRE_LIB@
PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
-SED = @SED@
SENDFILE_LIB = @SENDFILE_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -144,18 +134,20 @@ SQLITE_LIBS = @SQLITE_LIBS@
SSL_LIB = @SSL_LIB@
STRIP = @STRIP@
U = @U@
-UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -167,60 +159,48 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
-builddir = @builddir@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
-localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-EXTRA_DIST = lighttpd.service
+EXTRA_DIST = lighttpd.README setup.hint
all: all-am
.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/systemd/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign doc/systemd/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu cygwin/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu cygwin/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -234,17 +214,22 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
+lighttpd.README: $(top_builddir)/config.status $(srcdir)/lighttpd.README.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
tags: TAGS
TAGS:
@@ -253,32 +238,29 @@ CTAGS:
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
@@ -296,22 +278,16 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -322,7 +298,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
-distclean-am: clean-am distclean-generic
+distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
@@ -330,38 +306,18 @@ dvi-am:
html: html-am
-html-am:
-
info: info-am
info-am:
install-data-am:
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
install-exec-am:
-install-html: install-html-am
-
-install-html-am:
-
install-info: install-info-am
-install-info-am:
-
install-man:
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -380,21 +336,17 @@ ps: ps-am
ps-am:
-uninstall-am:
-
-.MAKE: install-am install-strip
+uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
-
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/cygwin/lighttpd.README b/cygwin/lighttpd.README
new file mode 100644
index 0000000..18bf85f
--- /dev/null
+++ b/cygwin/lighttpd.README
@@ -0,0 +1,114 @@
+lighttpd
+------------------------------------------
+A fast, secure and flexible webserver
+
+Runtime requirements:
+ cygwin-1.5.10 or newer
+ crypt-1.1 or newer
+ libbz2_1-1.0.2 or newer
+ libpcre0-4.5 or newer
+ openssl-0.9.7d or newer
+ zlib-1.2.1 or newer
+
+Build requirements:
+ cygwin-1.5.10 or newer
+ gcc-3.3.1-3 or newer
+ binutils-20030901-1 or newer
+ crypt
+ openssl-devel
+ openssl
+ openldap
+ openldap-devel
+ zlib
+ bzip2
+
+Canonical homepage:
+ http://jan.kneschke.de/projects/lighttpd/
+
+Canonical download:
+ http://jan.kneschke.de/projects/lighttpd/download
+
+------------------------------------
+
+Build instructions:
+ unpack lighttpd-1.4.8-<REL>-src.tar.bz2
+ if you use setup to install this src package, it will be
+ unpacked under /usr/src automatically
+ cd /usr/src
+ ./lighttpd-1.4.8-<REL>.sh all
+
+This will create:
+ /usr/src/lighttpd-1.4.8-<REL>.tar.bz2
+ /usr/src/lighttpd-1.4.8-<REL>-src.tar.bz2
+
+Or use './lighttpd-1.4.8-<REL>.sh prep' to get a patched source directory
+
+-------------------------------------------
+
+Files included in the binary distribution:
+
+ /etc/lighttpd/lighttpd.conf.default
+ /usr/lib/cyglightcomp.dll
+ /usr/lib/lighttpd/mod_access.dll
+ /usr/lib/lighttpd/mod_accesslog.dll
+ /usr/lib/lighttpd/mod_auth.dll
+ /usr/lib/lighttpd/mod_cgi.dll
+ /usr/lib/lighttpd/mod_compress.dll
+ /usr/lib/lighttpd/mod_evhost.dll
+ /usr/lib/lighttpd/mod_expire.dll
+ /usr/lib/lighttpd/mod_fastcgi.dll
+ /usr/lib/lighttpd/mod_httptls.dll
+ /usr/lib/lighttpd/mod_maps.dll
+ /usr/lib/lighttpd/mod_proxy.dll
+ /usr/lib/lighttpd/mod_redirect.dll
+ /usr/lib/lighttpd/mod_rewrite.dll
+ /usr/lib/lighttpd/mod_rrdtool.dll
+ /usr/lib/lighttpd/mod_secdownload.dll
+ /usr/lib/lighttpd/mod_simple_vhost.dll
+ /usr/lib/lighttpd/mod_ssi.dll
+ /usr/lib/lighttpd/mod_status.dll
+ /usr/lib/lighttpd/mod_usertrack.dll
+ /usr/sbin/lighttpd.exe
+ /usr/share/doc/Cygwin/lighttpd-1.3.0.README
+ /usr/share/doc/lighttpd-1.3.0/accesslog.txt
+ /usr/share/doc/lighttpd-1.3.0/authentification.txt
+ /usr/share/doc/lighttpd-1.3.0/AUTHORS
+ /usr/share/doc/lighttpd-1.3.0/cgi.txt
+ /usr/share/doc/lighttpd-1.3.0/ChangeLog
+ /usr/share/doc/lighttpd-1.3.0/compress.txt
+ /usr/share/doc/lighttpd-1.3.0/configuration.txt
+ /usr/share/doc/lighttpd-1.3.0/COPYING
+ /usr/share/doc/lighttpd-1.3.0/fastcgi-state.txt
+ /usr/share/doc/lighttpd-1.3.0/fastcgi.txt
+ /usr/share/doc/lighttpd-1.3.0/features.txt
+ /usr/share/doc/lighttpd-1.3.0/INSTALL
+ /usr/share/doc/lighttpd-1.3.0/NEWS
+ /usr/share/doc/lighttpd-1.3.0/performance.txt
+ /usr/share/doc/lighttpd-1.3.0/plugins.txt
+ /usr/share/doc/lighttpd-1.3.0/proxy.txt
+ /usr/share/doc/lighttpd-1.3.0/README
+ /usr/share/doc/lighttpd-1.3.0/redirect.txt
+ /usr/share/doc/lighttpd-1.3.0/rewrite.txt
+ /usr/share/doc/lighttpd-1.3.0/rrdtool.txt
+ /usr/share/doc/lighttpd-1.3.0/secdownload.txt
+ /usr/share/doc/lighttpd-1.3.0/security.txt
+ /usr/share/doc/lighttpd-1.3.0/simple-vhost.txt
+ /usr/share/doc/lighttpd-1.3.0/skeleton.txt
+ /usr/share/doc/lighttpd-1.3.0/ssi.txt
+ /usr/share/doc/lighttpd-1.3.0/state.txt
+ /usr/share/man/man1/lighttpd.1.gz
+
+------------------
+
+Port Notes:
+
+---------- lighttpd-1.3.1-1 -----------
+
+Updated to 1.3.1
+
+---------- lighttpd-1.3.0-1 -----------
+Initial release
+
+Cygwin port maintained by: Jan Kneschke <jan@kneschke.de>
+Please address all questions to the Cygwin mailing list at <cygwin@cygwin.com>
+
diff --git a/cygwin/lighttpd.README.in b/cygwin/lighttpd.README.in
new file mode 100644
index 0000000..2b45546
--- /dev/null
+++ b/cygwin/lighttpd.README.in
@@ -0,0 +1,114 @@
+lighttpd
+------------------------------------------
+A fast, secure and flexible webserver
+
+Runtime requirements:
+ cygwin-1.5.10 or newer
+ crypt-1.1 or newer
+ libbz2_1-1.0.2 or newer
+ libpcre0-4.5 or newer
+ openssl-0.9.7d or newer
+ zlib-1.2.1 or newer
+
+Build requirements:
+ cygwin-1.5.10 or newer
+ gcc-3.3.1-3 or newer
+ binutils-20030901-1 or newer
+ crypt
+ openssl-devel
+ openssl
+ openldap
+ openldap-devel
+ zlib
+ bzip2
+
+Canonical homepage:
+ http://jan.kneschke.de/projects/lighttpd/
+
+Canonical download:
+ http://jan.kneschke.de/projects/lighttpd/download
+
+------------------------------------
+
+Build instructions:
+ unpack lighttpd-@VERSION@-<REL>-src.tar.bz2
+ if you use setup to install this src package, it will be
+ unpacked under /usr/src automatically
+ cd /usr/src
+ ./lighttpd-@VERSION@-<REL>.sh all
+
+This will create:
+ /usr/src/lighttpd-@VERSION@-<REL>.tar.bz2
+ /usr/src/lighttpd-@VERSION@-<REL>-src.tar.bz2
+
+Or use './lighttpd-@VERSION@-<REL>.sh prep' to get a patched source directory
+
+-------------------------------------------
+
+Files included in the binary distribution:
+
+ /etc/lighttpd/lighttpd.conf.default
+ /usr/lib/cyglightcomp.dll
+ /usr/lib/lighttpd/mod_access.dll
+ /usr/lib/lighttpd/mod_accesslog.dll
+ /usr/lib/lighttpd/mod_auth.dll
+ /usr/lib/lighttpd/mod_cgi.dll
+ /usr/lib/lighttpd/mod_compress.dll
+ /usr/lib/lighttpd/mod_evhost.dll
+ /usr/lib/lighttpd/mod_expire.dll
+ /usr/lib/lighttpd/mod_fastcgi.dll
+ /usr/lib/lighttpd/mod_httptls.dll
+ /usr/lib/lighttpd/mod_maps.dll
+ /usr/lib/lighttpd/mod_proxy.dll
+ /usr/lib/lighttpd/mod_redirect.dll
+ /usr/lib/lighttpd/mod_rewrite.dll
+ /usr/lib/lighttpd/mod_rrdtool.dll
+ /usr/lib/lighttpd/mod_secdownload.dll
+ /usr/lib/lighttpd/mod_simple_vhost.dll
+ /usr/lib/lighttpd/mod_ssi.dll
+ /usr/lib/lighttpd/mod_status.dll
+ /usr/lib/lighttpd/mod_usertrack.dll
+ /usr/sbin/lighttpd.exe
+ /usr/share/doc/Cygwin/lighttpd-1.3.0.README
+ /usr/share/doc/lighttpd-1.3.0/accesslog.txt
+ /usr/share/doc/lighttpd-1.3.0/authentification.txt
+ /usr/share/doc/lighttpd-1.3.0/AUTHORS
+ /usr/share/doc/lighttpd-1.3.0/cgi.txt
+ /usr/share/doc/lighttpd-1.3.0/ChangeLog
+ /usr/share/doc/lighttpd-1.3.0/compress.txt
+ /usr/share/doc/lighttpd-1.3.0/configuration.txt
+ /usr/share/doc/lighttpd-1.3.0/COPYING
+ /usr/share/doc/lighttpd-1.3.0/fastcgi-state.txt
+ /usr/share/doc/lighttpd-1.3.0/fastcgi.txt
+ /usr/share/doc/lighttpd-1.3.0/features.txt
+ /usr/share/doc/lighttpd-1.3.0/INSTALL
+ /usr/share/doc/lighttpd-1.3.0/NEWS
+ /usr/share/doc/lighttpd-1.3.0/performance.txt
+ /usr/share/doc/lighttpd-1.3.0/plugins.txt
+ /usr/share/doc/lighttpd-1.3.0/proxy.txt
+ /usr/share/doc/lighttpd-1.3.0/README
+ /usr/share/doc/lighttpd-1.3.0/redirect.txt
+ /usr/share/doc/lighttpd-1.3.0/rewrite.txt
+ /usr/share/doc/lighttpd-1.3.0/rrdtool.txt
+ /usr/share/doc/lighttpd-1.3.0/secdownload.txt
+ /usr/share/doc/lighttpd-1.3.0/security.txt
+ /usr/share/doc/lighttpd-1.3.0/simple-vhost.txt
+ /usr/share/doc/lighttpd-1.3.0/skeleton.txt
+ /usr/share/doc/lighttpd-1.3.0/ssi.txt
+ /usr/share/doc/lighttpd-1.3.0/state.txt
+ /usr/share/man/man1/lighttpd.1.gz
+
+------------------
+
+Port Notes:
+
+---------- lighttpd-1.3.1-1 -----------
+
+Updated to 1.3.1
+
+---------- lighttpd-1.3.0-1 -----------
+Initial release
+
+Cygwin port maintained by: Jan Kneschke <jan@kneschke.de>
+Please address all questions to the Cygwin mailing list at <cygwin@cygwin.com>
+
diff --git a/cygwin/setup.hint b/cygwin/setup.hint
new file mode 100644
index 0000000..c50b615
--- /dev/null
+++ b/cygwin/setup.hint
@@ -0,0 +1,4 @@
+sdesc: "a light-weight and flexible webserver"
+ldesc: "lighttpd a secure, fast, compliant and very flexible web-server which has been optimized for high-performance environments. It has a very low memory footprint compared to other webservers and takes care of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth, Output-Compression, URL-Rewriting and many more) make lighttpd the perfect webserver-software for every server that is suffering load problems. "
+category: Net Web
+requires: libpcre0 cygwin zlib openssl libbzip2_1 crypt
diff --git a/depcomp b/depcomp
index df8eea7..aea3d00 100755
--- a/depcomp
+++ b/depcomp
@@ -1,10 +1,7 @@
#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2009-04-28.21; # UTC
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright 1999, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,7 +14,9 @@ scriptversion=2009-04-28.21; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -26,45 +25,22 @@ scriptversion=2009-04-28.21; # UTC
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
-case $1 in
- '')
- echo "$0: No command. Try \`$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
- depmode Dependency tracking mode.
- source Source file read by `PROGRAMS ARGS'.
- object Object file output by `PROGRAMS ARGS'.
- DEPDIR directory where to store dependencies.
- depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputing dependencies.
- libtool Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit $?
- ;;
-esac
-
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
+# `libtool' can also be set to `yes' or `no'.
+
+if test -z "$depfile"; then
+ base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
+ dir=`echo "$object" | sed 's,/.*$,/,'`
+ if test "$dir" = "$object"; then
+ dir=
+ fi
+ # FIXME: should be _deps on DOS.
+ depfile="$dir.deps/$base"
+fi
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
@@ -85,34 +61,12 @@ if test "$depmode" = dashXmstdout; then
depmode=dashmstdout
fi
-cygpath_u="cygpath -u -f -"
-if test "$depmode" = msvcmsys; then
- # This is just like msvisualcpp but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u="sed s,\\\\\\\\,/,g"
- depmode=msvisualcpp
-fi
-
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am. Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
- for arg
- do
- case $arg in
- -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
- *) set fnord "$@" "$arg" ;;
- esac
- shift # fnord
- shift # $arg
- done
- "$@"
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
@@ -199,14 +153,14 @@ sgi)
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
-' ' ' >> "$depfile"
- echo >> "$depfile"
+' ' ' >> $depfile
+ echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> "$depfile"
+ >> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
@@ -218,43 +172,31 @@ sgi)
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts `$object:' at the
- # start of each line; $object doesn't have directory information.
- # Version 6 uses the directory in both cases.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ # in a .u file. This file always lives in the current directory.
+ # Also, the AIX compiler puts `$object:' at the start of each line;
+ # $object doesn't have directory information.
+ stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ outname="$stripped.o"
if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$base.u
- tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$dir$base.u
- tmpdepfile3=$dir$base.u
"$@" -M
fi
- stat=$?
+ stat=$?
if test $stat -eq 0; then :
else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ rm -f "$tmpdepfile"
exit $stat
fi
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
@@ -302,51 +244,6 @@ icc)
rm -f "$tmpdepfile"
;;
-hp2)
- # The "hp" stanza above does not work with aCC (C++) and HP's ia64
- # compilers, which have integrated preprocessors. The correct option
- # to use with these is +Maked; it writes dependencies to a file named
- # 'foo.d', which lands next to the object file, wherever that
- # happens to be.
- # Much of this is similar to the tru64 case; see comments there.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir.libs/$base.d
- "$@" -Wc,+Maked
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- "$@" +Maked
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
- # Add `dependent.h:' lines.
- sed -ne '2,${
- s/^ *//
- s/ \\*$//
- s/$/:/
- p
- }' "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile" "$tmpdepfile2"
- ;;
-
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
@@ -358,47 +255,31 @@ tru64)
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
- # With Tru64 cc, shared objects can also be used to make a
- # static library. This mechanism is used in libtool 1.4 series to
- # handle both shared and static libraries in a single compilation.
- # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
- #
- # With libtool 1.5 this exception was removed, and libtool now
- # generates 2 separate objects for the 2 libraries. These two
- # compilations output dependencies in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
- tmpdepfile2=$dir$base.o.d # libtool 1.5
- tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
- tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ tmpdepfile1="$dir.libs/$base.lo.d"
+ tmpdepfile2="$dir.libs/$base.d"
"$@" -Wc,-MD
else
- tmpdepfile1=$dir$base.o.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- tmpdepfile4=$dir$base.d
+ tmpdepfile1="$dir$base.o.d"
+ tmpdepfile2="$dir$base.d"
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- do
- test -f "$tmpdepfile" && break
- done
+ if test -f "$tmpdepfile1"; then
+ tmpdepfile="$tmpdepfile1"
+ else
+ tmpdepfile="$tmpdepfile2"
+ fi
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ # That's a space and a tab in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
@@ -411,12 +292,12 @@ tru64)
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o.
+ # always write the proprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
+ while test $1 != '--mode=compile'; do
shift
done
shift
@@ -467,39 +348,32 @@ makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
+ while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
- cleared=no eat=no
- for arg
- do
+ cleared=no
+ for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
- if test $eat = yes; then
- eat=no
- continue
- fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
- -arch)
- eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
- obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
@@ -514,12 +388,12 @@ makedepend)
cpp)
# Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
+ # always write the proprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
+ while test $1 != '--mode=compile'; do
shift
done
shift
@@ -545,8 +419,7 @@ cpp)
done
"$@" -E |
- sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
@@ -557,27 +430,13 @@ cpp)
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
"$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
IFS=" "
for arg
do
case "$arg" in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
@@ -590,23 +449,16 @@ msvisualcpp)
;;
esac
done
- "$@" -E 2>/dev/null |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
-msvcmsys)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
none)
exec "$@"
;;
@@ -618,13 +470,3 @@ none)
esac
exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/distribute.sh.in b/distribute.sh.in
index a85fcec..e0b63a3 100644
--- a/distribute.sh.in
+++ b/distribute.sh.in
@@ -3,7 +3,7 @@ PACKAGE=@PACKAGE_TARNAME@
VERSION=@VERSION@
NAME=@PACKAGE_TARNAME@-@VERSION@
-DISTDIR="/home/jan/wwwroot/servers/www.lighttpd.net/pages/download/"
+DISTDIR="/home/jan/wwwroot/servers/www.lighttpd.net/pages/download/"
RPMS="/home/jan/rpmbuild/RPMS/i386/${NAME}-1.i386.rpm \
/home/jan/rpmbuild/SRPMS/${NAME}-1.src.rpm"
FILES="${RPMS} ${NAME}.tar.gz \
@@ -21,7 +21,7 @@ esac
echo ${nopack}
if test x${pack} = x1; then
- make distcheck && rpmbuild -ta --nodeps ${NAME}.tar.gz
+ make distcheck && rpmbuild -ta --nodeps ${NAME}.tar.gz
gpg --detach-sign ${NAME}.tar.gz
rpm --addsign ${RPMS}
fi
@@ -49,7 +49,7 @@ Download
MD5: ${MD5SRPM}
- ${NAME}.tar.gz
${DLNAME}.tar.gz
- MD5: ${MD5TGZ}
+ MD5: ${MD5TGZ}
Signature: ${DLNAME}.tar.gz.sig
EOF
@@ -67,7 +67,7 @@ Checksums
- ${NAME}-1.src.rpm
MD5: ${MD5SRPM}
- ${NAME}.tar.gz
- MD5: ${MD5TGZ}
+ MD5: ${MD5TGZ}
EOF
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 8ba0016..043e570 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,6 +1,96 @@
-SUBDIRS=config scripts initscripts systemd outdated
-dist_man8_MANS=lighttpd.8
+dist_man1_MANS=lighttpd.1 spawn-fcgi.1
-EXTRA_DIST= \
+
+DOCS=accesslog.txt \
+authentication.txt \
+cgi.txt \
+compress.txt \
+configuration.txt \
+fastcgi-state.txt \
+fastcgi.txt \
+features.txt \
+performance.txt \
+plugins.txt \
+proxy.txt \
+redirect.txt \
+rewrite.txt \
+secdownload.txt \
+security.txt \
+simple-vhost.txt \
+skeleton.txt \
+ssi.txt \
+ssl.txt \
+state.txt \
+rrdtool.txt \
+alias.txt \
+userdir.txt \
+mysqlvhost.txt \
+access.txt \
+traffic-shaping.txt \
+setenv.txt \
+status.txt \
+scgi.txt \
+cml.txt \
+trigger_b4_dl.txt \
+webdav.txt \
+expire.txt
+
+HTMLDOCS=accesslog.html \
+ authentication.html \
+ cgi.html \
+ compress.html \
+ configuration.html \
+ fastcgi-state.html \
+ fastcgi.html \
+ features.html \
+ performance.html \
+ plugins.html \
+ proxy.html \
+ redirect.html \
+ rewrite.html \
+ secdownload.html \
+ security.html \
+ simple-vhost.html \
+ skeleton.html \
+ ssi.html \
+ ssl.html \
+ state.html \
+ rrdtool.html \
+ alias.html \
+ userdir.html \
+ mysqlvhost.html \
+ access.html \
+ traffic-shaping.html \
+ setenv.html \
+ status.html \
+ scgi.html \
+ cml.html \
+ trigger_b4_dl.html \
+ webdav.html \
+ expire.html
+
+EXTRA_DIST=lighttpd.conf lighttpd.user \
+ rc.lighttpd rc.lighttpd.redhat sysconfig.lighttpd \
+ rrdtool-graph.sh \
+ state.dot fastcgi-state.dot \
+ spawn-php.sh \
newstyle.css \
- oldstyle.css
+ oldstyle.css \
+ $(DOCS)
+
+%.html: %.txt
+ rst2html $^ > $@
+
+
+html: $(HTMLDOCS)
+
+#%.ps.gz: %.ps
+# gzip $^
+
+#%.ps: %.dot
+# dot -Tps -o $@ $^
+
+clean-local:
+ rm -f *.html
+
+
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 01ac18e..219b2f2 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,12 +13,15 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -35,102 +37,26 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = doc
-DIST_COMMON = $(dist_man8_MANS) $(srcdir)/Makefile.am \
+DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
SOURCES =
DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-dvi-recursive install-exec-recursive \
- install-html-recursive install-info-recursive \
- install-pdf-recursive install-ps-recursive install-recursive \
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-man8dir = $(mandir)/man8
-am__installdirs = "$(DESTDIR)$(man8dir)"
+man1dir = $(mandir)/man1
+am__installdirs = "$(DESTDIR)$(man1dir)"
NROFF = nroff
-MANS = $(dist_man8_MANS)
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
- distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
+MANS = $(dist_man1_MANS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ATTR_LIB = @ATTR_LIB@
AUTOCONF = @AUTOCONF@
@@ -141,73 +67,69 @@ BZ_LIB = @BZ_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@
+CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
+CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
CRYPT_LIB = @CRYPT_LIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
+ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
FAM_CFLAGS = @FAM_CFLAGS@
FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
+FFLAGS = @FFLAGS@
GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LBER_LIB = @LBER_LIB@
-LD = @LD@
LDAP_LIB = @LDAP_LIB@
LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LUACONFIG = @LUACONFIG@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
+NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@
+NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@
OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
PCRE_LIB = @PCRE_LIB@
PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
-SED = @SED@
SENDFILE_LIB = @SENDFILE_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -216,18 +138,20 @@ SQLITE_LIBS = @SQLITE_LIBS@
SSL_LIB = @SSL_LIB@
STRIP = @STRIP@
U = @U@
-UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -239,65 +163,125 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
-builddir = @builddir@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
-localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = config scripts initscripts systemd outdated
-dist_man8_MANS = lighttpd.8
-EXTRA_DIST = \
+dist_man1_MANS = lighttpd.1 spawn-fcgi.1
+DOCS = accesslog.txt \
+authentication.txt \
+cgi.txt \
+compress.txt \
+configuration.txt \
+fastcgi-state.txt \
+fastcgi.txt \
+features.txt \
+performance.txt \
+plugins.txt \
+proxy.txt \
+redirect.txt \
+rewrite.txt \
+secdownload.txt \
+security.txt \
+simple-vhost.txt \
+skeleton.txt \
+ssi.txt \
+ssl.txt \
+state.txt \
+rrdtool.txt \
+alias.txt \
+userdir.txt \
+mysqlvhost.txt \
+access.txt \
+traffic-shaping.txt \
+setenv.txt \
+status.txt \
+scgi.txt \
+cml.txt \
+trigger_b4_dl.txt \
+webdav.txt \
+expire.txt
+
+HTMLDOCS = accesslog.html \
+ authentication.html \
+ cgi.html \
+ compress.html \
+ configuration.html \
+ fastcgi-state.html \
+ fastcgi.html \
+ features.html \
+ performance.html \
+ plugins.html \
+ proxy.html \
+ redirect.html \
+ rewrite.html \
+ secdownload.html \
+ security.html \
+ simple-vhost.html \
+ skeleton.html \
+ ssi.html \
+ ssl.html \
+ state.html \
+ rrdtool.html \
+ alias.html \
+ userdir.html \
+ mysqlvhost.html \
+ access.html \
+ traffic-shaping.html \
+ setenv.html \
+ status.html \
+ scgi.html \
+ cml.html \
+ trigger_b4_dl.html \
+ webdav.html \
+ expire.html
+
+EXTRA_DIST = lighttpd.conf lighttpd.user \
+ rc.lighttpd rc.lighttpd.redhat sysconfig.lighttpd \
+ rrdtool-graph.sh \
+ state.dot fastcgi-state.dot \
+ spawn-php.sh \
newstyle.css \
- oldstyle.css
+ oldstyle.css \
+ $(DOCS)
-all: all-recursive
+all: all-am
.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign doc/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -311,381 +295,201 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
-install-man8: $(dist_man8_MANS)
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
- test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
- @list='$(dist_man8_MANS)'; test -n "$(man8dir)" || exit 0; \
- { for i in $$list; do echo "$$i"; done; \
- } | while read p; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; echo "$$p"; \
- done | \
- sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
- sed 'N;N;s,\n, ,g' | { \
- list=; while read file base inst; do \
- if test "$$base" = "$$inst"; then list="$$list $$file"; else \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
- fi; \
+ test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
done; \
- for i in $$list; do echo "$$i"; done | $(am__base_list) | \
- while read files; do \
- test -z "$$files" || { \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
- done; }
-
-uninstall-man8:
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
+ done
+uninstall-man1:
@$(NORMAL_UNINSTALL)
- @list='$(dist_man8_MANS)'; test -n "$(man8dir)" || exit 0; \
- files=`{ for i in $$list; do echo "$$i"; done; \
- } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
- dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
esac; \
done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
+ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
tags: TAGS
+TAGS:
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+CTAGS:
+
distdir: $(DISTFILES)
- @list='$(MANS)'; if test -n "$$list"; then \
- list=`for p in $$list; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
- if test -n "$$list" && \
- grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
- echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
- grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
- echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
- echo " typically \`make maintainer-clean' will remove them" >&2; \
- exit 1; \
- else :; fi; \
- else :; fi
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
check-am: all-am
-check: check-recursive
+check: check-am
all-am: Makefile $(MANS)
-installdirs: installdirs-recursive
-installdirs-am:
- for dir in "$(DESTDIR)$(man8dir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+installdirs:
+ for dir in "$(DESTDIR)$(man1dir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-installcheck: installcheck-recursive
+installcheck: installcheck-am
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
+clean: clean-am
-clean-am: clean-generic clean-libtool mostlyclean-am
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
-distclean: distclean-recursive
+distclean: distclean-am
-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
+distclean-am: clean-am distclean-generic distclean-libtool
-dvi: dvi-recursive
+dvi: dvi-am
dvi-am:
-html: html-recursive
-
-html-am:
-
-info: info-recursive
+info: info-am
info-am:
install-data-am: install-man
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
install-exec-am:
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man: install-man8
+install-info: install-info-am
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
+install-man: install-man1
installcheck-am:
-maintainer-clean: maintainer-clean-recursive
+maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
-mostlyclean: mostlyclean-recursive
+mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-pdf: pdf-recursive
+pdf: pdf-am
pdf-am:
-ps: ps-recursive
+ps: ps-am
ps-am:
-uninstall-am: uninstall-man
+uninstall-am: uninstall-info-am uninstall-man
+
+uninstall-man: uninstall-man1
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-local distclean distclean-generic distclean-libtool \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-man1 install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-info-am \
+ uninstall-man uninstall-man1
+
-uninstall-man: uninstall-man8
+%.html: %.txt
+ rst2html $^ > $@
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
- install-am install-strip tags-recursive
+html: $(HTMLDOCS)
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am check check-am clean clean-generic clean-libtool \
- ctags ctags-recursive distclean distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-man8 install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-recursive uninstall uninstall-am uninstall-man \
- uninstall-man8
+#%.ps.gz: %.ps
+# gzip $^
+#%.ps: %.dot
+# dot -Tps -o $@ $^
+clean-local:
+ rm -f *.html
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/doc/outdated/access.txt b/doc/access.txt
index 042da01..acfdcb7 100644
--- a/doc/outdated/access.txt
+++ b/doc/access.txt
@@ -12,10 +12,10 @@ Module: mod_access
:abstract:
The access module is used to deny access to files with given trailing path names.
-
+
.. meta::
:keywords: lighttpd, trailing path access control
-
+
.. contents:: Table of Contents
Description
@@ -32,7 +32,7 @@ url.access-deny
Default: empty
Example: ::
-
+
url.access-deny = ( "~", ".inc")
will deny access to all files ended with a diacritical mark (~) or .inc
diff --git a/doc/outdated/accesslog.txt b/doc/accesslog.txt
index 889a4da..36584cf 100644
--- a/doc/outdated/accesslog.txt
+++ b/doc/accesslog.txt
@@ -11,11 +11,11 @@ Module: mod_accesslog
:Revision: $Revision: 1.2 $
:abstract:
- The accesslog module ...
-
+ The accesslog module ...
+
.. meta::
:keywords: lighttpd, accesslog, CLF
-
+
.. contents:: Table of Contents
Description
@@ -28,30 +28,30 @@ Options
accesslog.use-syslog
send the accesslog to syslog
-
+
Default: disabled
accesslog.filename
name of the file where the accesslog should be written too if syslog
is not used.
-
+
if the name starts with a '|' the rest of the name is taken
as the name of a process which will be spawn and will get the
output
-
+
e.g.: ::
-
+
accesslog.filename = "/var/log/lighttpd.log"
-
+
$HTTP["host"] == "mail.example.org" {
accesslog.filename = "|/usr/bin/cronolog"
}
-
+
Default: disabled
accesslog.format
the format of the logfile
-
+
====== ================================
Option Description
====== ================================
@@ -60,8 +60,8 @@ accesslog.format
%l ident name (not supported)
%u authenticated user
%t timestamp for the request-start
- %r request-line
- %s status code
+ %r request-line
+ %s status code
%b bytes sent for the body
%i HTTP-header field
%a remote address
@@ -86,16 +86,16 @@ accesslog.format
%I bytes incomming
%O bytes outgoing
====== ================================
-
+
If %s is written %>s or %<s the < and the > are ignored. They are support
- for compat with apache.
-
+ for compat with apache.
+
%i and %o expect the name of the field which should be written in curly brackets.
-
+
e.g.: ::
-
+
accesslog.format = "%h %l %u %t \"%r\" %b %>s \"%{User-Agent}i\" \"%{Referer}i\""
-
+
Default: CLF compatible output
Response Header
@@ -109,18 +109,18 @@ If you want to log it into the accesslog just specify the field-name within
a %{...}o like ::
accesslog.format = "%h %l %u %t \"%r\" %b %>s \"%{User-Agent}i\" \"%{Referer}i\" \"%{X-LIGHTTPD-SID}o\""
-
+
The prefix ``X-LIGHTTPD-`` is special as every response header starting with
this prefix is assumed to be special for lighttpd and won't be sent out
-to the client.
+to the client.
An example the use this functionality is provided below: ::
<?php
-
+
session_start();
-
+
header("X-LIGHTTPD-SID: ".session_id());
-
+
?>
diff --git a/doc/outdated/alias.txt b/doc/alias.txt
index 1315f93..15012e3 100644
--- a/doc/outdated/alias.txt
+++ b/doc/alias.txt
@@ -11,11 +11,11 @@ Module: mod_alias
:Revision: $Revision: 1.1 $
:abstract:
- The alias module ...
-
+ The alias module ...
+
.. meta::
:keywords: lighttpd, alias
-
+
.. contents:: Table of Contents
Description
@@ -32,5 +32,5 @@ alias.url
Default: empty
Example: ::
-
+
alias.url = ( "/cgi-bin/" => "/var/www/servers/www.example.org/cgi-bin/" )
diff --git a/doc/outdated/authentication.txt b/doc/authentication.txt
index edc2b2b..20c06bd 100644
--- a/doc/outdated/authentication.txt
+++ b/doc/authentication.txt
@@ -7,15 +7,15 @@ Module: mod_auth
----------------
:Author: Jan Kneschke
-:Date: $Date$
-:Revision: $Revision$
+:Date: $Date: 2005-09-16 14:45:15 +0200 (Fri, 16 Sep 2005) $
+:Revision: $Revision: 712 $
:abstract:
The auth module provides ...
-
+
.. meta::
:keywords: lighttpd, authentication
-
+
.. contents:: Table of Contents
Description
@@ -24,115 +24,103 @@ Description
Supported Methods
-----------------
-lighttpd supportes both authentication method described by
-RFC 2617:
+lighttpd supportes both authentication method described by
+RFC 2617:
basic
`````
-The Basic method transfers the username and the password in
-cleartext over the network (base64 encoded) and might result
-in security problems if not used in conjunction with a crypted
+The Basic method transfers the username and the password in
+cleartext over the network (base64 encoded) and might result
+in security problems if not used in conjunction with a crypted
channel between client and server.
digest
``````
-The Digest method only transfers a hashed value over the
-network which performs a lot of work to harden the
+The Digest method only transfers a hashed value over the
+network which performs a lot of work to harden the
authentication process in insecure networks.
Backends
--------
-Depending on the method lighttpd provides various way to store
+Depending on the method lighttpd provides various way to store
the credentials used for the authentication.
for basic auth:
- plain_
-- htpasswd_
+- htpasswd_
- htdigest_
- ldap_
-
+
for digest auth:
- plain_
- htdigest_
-
+
plain
`````
-A file which contains username and the cleartext password
-seperated by a colon. Each entry is terminated by a single
+A file which contains username and the cleartext password
+seperated by a colon. Each entry is terminated by a single
newline.::
e.g.:
agent007:secret
-
+
htpasswd
````````
-A file which contains username and the crypt()'ed password
-seperated by a colon. Each entry is terminated by a single
+A file which contains username and the crypt()'ed password
+seperated by a colon. Each entry is terminated by a single
newline. ::
e.g.:
agent007:XWY5JwrAVBXsQ
-You can use htpasswd from the apache distribution to manage
+You can use htpasswd from the apache distribution to manage
those files. ::
-
- $ htpasswd lighttpd.user.htpasswd agent007
-
-
+
+ $ htpasswd lighttpd.user.digest agent007
+
+
htdigest
````````
-A file which contains username, realm and the md5()'ed
-password seperated by a colon. Each entry is terminated
+A file which contains username, realm and the md5()'ed
+password seperated by a colon. Each entry is terminated
by a single newline. ::
-
+
e.g.:
agent007:download area:8364d0044ef57b3defcfa141e8f77b65
-
-You can use htdigest from the apache distribution to manage
+
+You can use htdigest from the apache distribution to manage
those files. ::
- $ htdigest lighttpd.user.htdigest 'download area' agent007
-
+ $ htdigest src/lighttpd.user.digest 'download area' agent007
+
Using md5sum can also generate the password-hash: ::
-
- #!/bin/sh
- user=$1
- realm=$2
- pass=$3
-
- hash=`echo -n "$user:$realm:$pass" | md5sum | cut -b -32`
-
- echo "$user:$realm:$hash"
-
-To use it:
-
- $ htdigest.sh 'agent007' 'download area' 'secret'
- agent007:download area:8364d0044ef57b3defcfa141e8f77b65
-
-
-
+
+ $ echo -n "agent007:download area:secret" | md5sum -
+ 8364d0044ef57b3defcfa141e8f77b65 -
+
+
ldap
````
-the ldap backend is basically performing the following steps
+the ldap backend is basically performing the following steps
to authenticate a user
-
+
1. connect anonymously (at plugin init)
2. get DN for filter = username
3. auth against ldap server
4. disconnect
-
-if all 4 steps are performed without any error the user is
+
+if all 4 steps are performed without any error the user is
authenticated
Configuration
@@ -143,28 +131,28 @@ Configuration
## debugging
# 0 for off, 1 for 'auth-ok' messages, 2 for verbose debugging
auth.debug = 0
-
- ## type of backend
+
+ ## type of backend
# plain, htpasswd, ldap or htdigest
auth.backend = "htpasswd"
- # filename of the password storage for
+ # filename of the password storage for
# plain
auth.backend.plain.userfile = "lighttpd-plain.user"
-
+
## for htpasswd
auth.backend.htpasswd.userfile = "lighttpd-htpasswd.user"
-
+
## for htdigest
auth.backend.htdigest.userfile = "lighttpd-htdigest.user"
## for ldap
- # the $ in auth.backend.ldap.filter is replaced by the
+ # the $ in auth.backend.ldap.filter is replaced by the
# 'username' from the login dialog
auth.backend.ldap.hostname = "localhost"
auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
auth.backend.ldap.filter = "(uid=$)"
- # if enabled, startTLS needs a valid (base64-encoded) CA
+ # if enabled, startTLS needs a valid (base64-encoded) CA
# certificate
auth.backend.ldap.starttls = "enable"
auth.backend.ldap.ca-file = "/etc/CAcertificate.pem"
@@ -178,20 +166,20 @@ Configuration
# "require" => "user=<username>" )
# )
#
- # <realm> is a string to display in the dialog
- # presented to the user and is also used for the
- # digest-algorithm and has to match the realm in the
+ # <realm> is a string to display in the dialog
+ # presented to the user and is also used for the
+ # digest-algorithm and has to match the realm in the
# htdigest file (if used)
#
- auth.require = ( "/download/" =>
- (
+ auth.require = ( "/download/" =>
+ (
"method" => "digest",
"realm" => "download archiv",
"require" => "user=agent007|user=agent008"
),
- "/server-info" =>
- (
+ "/server-info" =>
+ (
"method" => "digest",
"realm" => "download archiv",
"require" => "valid-user"
@@ -201,7 +189,7 @@ Configuration
Limitations
============
-- The implementation of digest method is currently not
+- The implementation of digest method is currently not
completely compliant with the standard as it still allows
a replay attack.
diff --git a/doc/outdated/cgi.txt b/doc/cgi.txt
index 95d187c..081d795 100644
--- a/doc/outdated/cgi.txt
+++ b/doc/cgi.txt
@@ -12,10 +12,10 @@ Module: mod_cgi
:abstract:
The cgi module provides a CGI-conforming interface.
-
+
.. meta::
:keywords: lighttpd, cgi
-
+
.. contents:: Table of Contents
Description
@@ -32,7 +32,7 @@ cgi.assign
file-extensions that are handled by a CGI program
e.g.: ::
-
+
cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl" )
@@ -43,7 +43,7 @@ To setup a executable which doesn't need the help of a external program you
just don't specify a handler for the extension. ::
cgi.assign = ( ".sh" => "" )
-
+
If the file has no extension keep in mind that lighttpd matches not the
extension itself but the right part of the URL: ::
diff --git a/doc/outdated/cml.txt b/doc/cml.txt
index 10fac70..f7752d4 100644
--- a/doc/outdated/cml.txt
+++ b/doc/cml.txt
@@ -12,10 +12,10 @@ Module: mod_cml
:abstract:
CML is a Meta language to describe the dependencies of a page at one side and building a page from its fragments on the other side using LUA.
-
+
.. meta::
:keywords: lighttpd, cml, lua
-
+
.. contents:: Table of Contents
Description
@@ -31,7 +31,7 @@ CML (Cache Meta Language) wants to solves several problems:
Cache Decision
--------------
-A simple example should show how to a content caching the very simple way in PHP.
+A simple example should show how to a content caching the very simple way in PHP.
jan.kneschke.de has a very simple design:
@@ -39,7 +39,7 @@ jan.kneschke.de has a very simple design:
* the menu is generated from a menu.csv file
* the content is coming from files on the local directory named content-1, content-2 and so on
-The page content is static as long non of the those tree items changes. A change in the layout
+The page content is static as long non of the those tree items changes. A change in the layout
is affecting all pages, a change of menu.csv too, a change of content-x file only affects the
cached page itself.
@@ -58,7 +58,7 @@ If we model this in PHP we get: ::
}
foreach($content as $k => $v) {
- if (isset($v["file"]) &&
+ if (isset($v["file"]) &&
filemtime($v["file"]) > $cachemtime) {
return 0;
}
@@ -71,7 +71,7 @@ If we model this in PHP we get: ::
return 0;
}
}
-
+
if (is_cachable(...), $cachefile) {
readfile($cachefile);
exit();
@@ -81,7 +81,7 @@ If we model this in PHP we get: ::
?>
Quite simple. No magic involved. If the one of the files is new than the cached
-content, the content is dirty and has to be regenerated.
+content, the content is dirty and has to be regenerated.
Now let take a look at the numbers:
@@ -92,9 +92,9 @@ As you can see the increase is not as good as it could be. The main reason as th
of the PHP interpreter to start up (a byte-code cache has been used here).
Moving these decisions out of the PHP script into a server module will remove the need
-to start PHP for a cache-hit.
+to start PHP for a cache-hit.
-To transform this example into a CML you need 'index.cml' in the list of indexfiles
+To transform this example into a CML you need 'index.cml' in the list of indexfiles
and the following index.cml file: ::
output_contenttype = "text/html"
@@ -110,7 +110,7 @@ and the following index.cml file: ::
file_mtime(b .. "templates/jk.tmpl") > file_mtime(cwd .. "_cache.html") or
file_mtime(b .. "content.html") > file_mtime(cwd .. "_cache.html") then
return CACHE_MISS
- else
+ else
return CACHE_HIT
end
@@ -132,77 +132,30 @@ Sometimes the different fragment are already generated externally. You have to c
readfile("spacer2.html");
readfile("news.html");
readfile("footer.html");
- ?>
+ ?>
-We we can do the same several times faster directly in the webserver.
+We we can do the same several times faster directly in the webserver.
Don't forget: Webserver are built to send out static content, that is what they can do best.
The index.cml for this looks like: ::
- output_contenttype = "text/html"
-
+ output_content_type = "text/html"
+
cwd = request["CWD"]
-
- output_include = { cwd .. "head.html",
+
+ output_include = { cwd .. "head.html",
cwd .. "menu.html",
cwd .. "spacer.html",
cwd .. "db-content.html",
cwd .. "spacer2.html",
cwd .. "news.html",
cwd .. "footer.html" }
-
+
return CACHE_HIT
Now we get about 10000 req/s instead of 600 req/s.
-Power Magnet
-------------
-
-Next to all the features about Cache Decisions CML can do more. Starting
-with lighttpd 1.4.9 a power-magnet was added which attracts each request
-and allows you to manipulate the request for your needs.
-
-We want to display a maintainance page by putting a file in a specified
-place:
-
-We enable the power magnet: ::
-
- cml.power-magnet = "/home/www/power-magnet.cml"
-
-and create /home/www/power-magnet.cml with: ::
-
- dr = request["DOCUMENT_ROOT"]
-
- if file_isreg(dr .. 'maintainance.html') then
- output_include = { 'maintainance.html' }
- return CACHE_HIT
- end
-
- return CACHE_MISS
-
-For each requested file the /home/www/power-magnet.cml is executed which
-checks if maintainance.html exists in the docroot and displays it
-instead of handling the usual request.
-
-Another example, create thumbnail for requested image and serve it instead
-of sending the big image: ::
-
- ## image-url is /album/baltic_winter_2005.jpg
- ## no params -> 640x480 is served
- ## /album/baltic_winter_2005.jpg/orig for full size
- ## /album/baltic_winter_2005.jpg/thumb for thumbnail
-
- dr = request["DOCUMENT_ROOT"]
- sn = request["SCRIPT_NAME"]
-
- ## to be continued :) ...
-
- trigger_handler = '/gen_image.php'
-
- return CACHE_MISS
-
-
Installation
============
@@ -217,19 +170,17 @@ To use the plugin you have to load it: ::
Options
=======
-:cml.extension:
+:cml.extension:
the file extension that is bound to the cml-module
:cml.memcache-hosts:
hosts for the memcache.* functions
:cml.memcache-namespace:
(not used yet)
-:cml.power-magnet:
- a cml file that is executed for each request
Language
========
-The language used for CML is provided by `LUA <http://www.lua.org/>`_.
+The language used for CML is provided by `LUA <http://www.lua.org/>`_.
Additionally to the functions provided by lua mod_cml provides: ::
@@ -252,10 +203,10 @@ Additionally to the functions provided by lua mod_cml provides: ::
number file_mtime(string)
string memcache_get_string(string)
number memcache_get_long(string)
- boolean memcache_exists(string)
+ boolean memcache_exists(string)
-What ever your script does, it has to return either CACHE_HIT or CACHE_MISS.
-It case a error occures check the error-log, the user will get a error 500. If you don't like
+What ever your script does, it has to return either 0 or 1 for ``cache-hit`` or ``cache-miss``.
+It case a error occures check the error-log, the user will get a error 500. If you don't like
the standard error-page use ``server.errorfile-prefix``.
diff --git a/doc/compress.txt b/doc/compress.txt
new file mode 100644
index 0000000..7b083e9
--- /dev/null
+++ b/doc/compress.txt
@@ -0,0 +1,66 @@
+==================
+Output Compression
+==================
+
+--------------------
+Module: mod_compress
+--------------------
+
+:Author: Jan Kneschke
+:Date: $Date: 2004/08/29 09:43:49 $
+:Revision: $Revision: 1.1 $
+
+:abstract:
+ a nice, short abstrace about the module
+
+.. meta::
+ :keywords: lighttpd, compress
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+Output compression reduces the network load and can improve the overall
+throughput of the webserver.
+
+Only static content is supported up to now.
+
+The server negotiates automaticly which compression method is used.
+Supported are gzip, deflate, bzip.
+
+Options
+=======
+
+compress.cache-dir
+ name of the directory where compressed content will be cached
+
+ e.g.: ::
+
+ compress.cache-dir = "/var/www/cache/"
+
+ # even better with virt-hosting
+ $HTTP["host"] == "docs.example.org" {
+ compress.cache-dir = "/var/www/cache/docs.example.org/"
+ }
+
+ Default: not set, compress the file for every request
+
+compress.filetype
+ mimetypes where might get compressed
+
+ e.g.: ::
+
+ compress.filetype = ("text/plain", "text/html")
+
+ Default: not set
+
+
+Compressing Dynamic Content
+===========================
+
+To compress dynamic content with PHP please enable ::
+
+ zlib.output_compression = 1
+
+in the php.ini as PHP provides compression support by itself.
diff --git a/doc/config/Makefile.am b/doc/config/Makefile.am
deleted file mode 100644
index 57bf101..0000000
--- a/doc/config/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-SUBDIRS=conf.d vhosts.d
-EXTRA_DIST=lighttpd.conf modules.conf
diff --git a/doc/config/Makefile.in b/doc/config/Makefile.in
deleted file mode 100644
index 869a407..0000000
--- a/doc/config/Makefile.in
+++ /dev/null
@@ -1,604 +0,0 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = doc/config
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-dvi-recursive install-exec-recursive \
- install-html-recursive install-info-recursive \
- install-pdf-recursive install-ps-recursive install-recursive \
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
- distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ATTR_LIB = @ATTR_LIB@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BZ_LIB = @BZ_LIB@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CRYPT_LIB = @CRYPT_LIB@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FAM_CFLAGS = @FAM_CFLAGS@
-FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
-GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LBER_LIB = @LBER_LIB@
-LD = @LD@
-LDAP_LIB = @LDAP_LIB@
-LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LUA_CFLAGS = @LUA_CFLAGS@
-LUA_LIBS = @LUA_LIBS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
-MYSQL_CONFIG = @MYSQL_CONFIG@
-MYSQL_INCLUDE = @MYSQL_INCLUDE@
-MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PCRECONFIG = @PCRECONFIG@
-PCRE_LIB = @PCRE_LIB@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SENDFILE_LIB = @SENDFILE_LIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SQLITE_CFLAGS = @SQLITE_CFLAGS@
-SQLITE_LIBS = @SQLITE_LIBS@
-SSL_LIB = @SSL_LIB@
-STRIP = @STRIP@
-U = @U@
-UUID_LIBS = @UUID_LIBS@
-VERSION = @VERSION@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = conf.d vhosts.d
-EXTRA_DIST = lighttpd.conf modules.conf
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/config/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign doc/config/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
- install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am check check-am clean clean-generic clean-libtool \
- ctags ctags-recursive distclean distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
- uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/doc/config/conf.d/Makefile.am b/doc/config/conf.d/Makefile.am
deleted file mode 100644
index 165c17e..0000000
--- a/doc/config/conf.d/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-EXTRA_DIST=access_log.conf \
- auth.conf \
- cgi.conf \
- cml.conf \
- compress.conf \
- debug.conf \
- dirlisting.conf \
- evhost.conf \
- expire.conf \
- fastcgi.conf \
- geoip.conf \
- magnet.conf \
- mime.conf \
- mod.template \
- mysql_vhost.conf \
- proxy.conf \
- rrdtool.conf \
- scgi.conf \
- secdownload.conf \
- simple_vhost.conf \
- ssi.conf \
- status.conf \
- trigger_b4_dl.conf \
- userdir.conf \
- webdav.conf
diff --git a/doc/config/conf.d/Makefile.in b/doc/config/conf.d/Makefile.in
deleted file mode 100644
index 1b3fc95..0000000
--- a/doc/config/conf.d/Makefile.in
+++ /dev/null
@@ -1,426 +0,0 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = doc/config/conf.d
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-SOURCES =
-DIST_SOURCES =
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ATTR_LIB = @ATTR_LIB@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BZ_LIB = @BZ_LIB@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CRYPT_LIB = @CRYPT_LIB@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FAM_CFLAGS = @FAM_CFLAGS@
-FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
-GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LBER_LIB = @LBER_LIB@
-LD = @LD@
-LDAP_LIB = @LDAP_LIB@
-LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LUA_CFLAGS = @LUA_CFLAGS@
-LUA_LIBS = @LUA_LIBS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
-MYSQL_CONFIG = @MYSQL_CONFIG@
-MYSQL_INCLUDE = @MYSQL_INCLUDE@
-MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PCRECONFIG = @PCRECONFIG@
-PCRE_LIB = @PCRE_LIB@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SENDFILE_LIB = @SENDFILE_LIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SQLITE_CFLAGS = @SQLITE_CFLAGS@
-SQLITE_LIBS = @SQLITE_LIBS@
-SSL_LIB = @SSL_LIB@
-STRIP = @STRIP@
-U = @U@
-UUID_LIBS = @UUID_LIBS@
-VERSION = @VERSION@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-EXTRA_DIST = access_log.conf \
- auth.conf \
- cgi.conf \
- cml.conf \
- compress.conf \
- debug.conf \
- dirlisting.conf \
- evhost.conf \
- expire.conf \
- fastcgi.conf \
- geoip.conf \
- magnet.conf \
- mime.conf \
- mod.template \
- mysql_vhost.conf \
- proxy.conf \
- rrdtool.conf \
- scgi.conf \
- secdownload.conf \
- simple_vhost.conf \
- ssi.conf \
- status.conf \
- trigger_b4_dl.conf \
- userdir.conf \
- webdav.conf
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/config/conf.d/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign doc/config/conf.d/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-tags: TAGS
-TAGS:
-
-ctags: CTAGS
-CTAGS:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- distclean distclean-generic distclean-libtool distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/doc/config/conf.d/access_log.conf b/doc/config/conf.d/access_log.conf
deleted file mode 100644
index 6c1e7e3..0000000
--- a/doc/config/conf.d/access_log.conf
+++ /dev/null
@@ -1,27 +0,0 @@
-#######################################################################
-##
-## Corresponding documentation:
-##
-## http://www.lighttpd.net/documentation/access.html
-##
-server.modules += ( "mod_accesslog" )
-
-##
-## Default access log.
-##
-accesslog.filename = log_root + "/access.log"
-
-##
-## The default format produces CLF compatible output.
-## For available parameters see access.txt
-##
-#accesslog.format = "%h %l %u %t \"%r\" %b %>s \"%{User-Agent}i\" \"%{Referer}i\""
-
-##
-## If you want to log to syslog you have to unset the
-## accesslog.use-syslog setting and uncomment the next line.
-##
-#accesslog.use-syslog = "enable"
-
-#
-#######################################################################
diff --git a/doc/config/conf.d/auth.conf b/doc/config/conf.d/auth.conf
deleted file mode 100644
index 1d3d69c..0000000
--- a/doc/config/conf.d/auth.conf
+++ /dev/null
@@ -1,27 +0,0 @@
-#######################################################################
-##
-## Authentication Module
-## -----------------------
-##
-## See http://www.lighttpd.net/documentation/authentification.html
-## for more info.
-##
-
-#auth.backend = "plain"
-#auth.backend.plain.userfile = "/etc/lighttpd/lighttpd.user"
-#auth.backend.plain.groupfile = "/etc/lighttpd/lighttpd.group"
-
-#auth.backend.ldap.hostname = "localhost"
-#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
-#auth.backend.ldap.filter = "(uid=$)"
-
-#auth.require = ( "/server-status" =>
-# (
-# "method" => "digest",
-# "realm" => "Server Status",
-# "require" => "valid-user"
-# ),
-# )
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/cgi.conf b/doc/config/conf.d/cgi.conf
deleted file mode 100644
index ed27799..0000000
--- a/doc/config/conf.d/cgi.conf
+++ /dev/null
@@ -1,33 +0,0 @@
-#######################################################################
-##
-## CGI modules
-## ---------------
-##
-## http://www.lighttpd.net/documentation/cgi.html
-##
-server.modules += ( "mod_cgi" )
-
-##
-## Plain old CGI handling
-##
-## For PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini.
-##
-cgi.assign = ( ".pl" => "/usr/bin/perl",
- ".cgi" => "/usr/bin/perl",
- ".rb" => "/usr/bin/ruby",
- ".erb" => "/usr/bin/eruby",
- ".py" => "/usr/bin/python" )
-
-##
-## to get the old cgi-bin behavior of apache
-##
-## Note: make sure that mod_alias is loaded if you uncomment the
-## next line. (see modules.conf)
-##
-#alias.url += ( "/cgi-bin" => server_root + "/cgi-bin" )
-#$HTTP["url"] =~ "^/cgi-bin" {
-# cgi.assign = ( "" => "" )
-#}
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/cml.conf b/doc/config/conf.d/cml.conf
deleted file mode 100644
index 8054ea6..0000000
--- a/doc/config/conf.d/cml.conf
+++ /dev/null
@@ -1,27 +0,0 @@
-#######################################################################
-##
-## CML Module
-## ---------------
-##
-## see http://www.lighttpd.net/documentation/cml.html
-##
-server.modules += ( "mod_cml" )
-index-file.names += ( "index.cml" )
-
-##
-## The file extension that is bound to the cml-module.
-##
-cml.extension = ".cml"
-
-##
-## Memcached hosts used for memcache* functions.
-##
-#cml.memcache-hosts = ( "127.0.0.1:11211" )
-
-##
-## A cml file that is executed for each request.
-##
-#cml.power-magnet = server_root + "/htdocs/powermagnet.cml"
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/compress.conf b/doc/config/conf.d/compress.conf
deleted file mode 100644
index 8ea4248..0000000
--- a/doc/config/conf.d/compress.conf
+++ /dev/null
@@ -1,31 +0,0 @@
-#######################################################################
-##
-## Output Compression
-## --------------------
-##
-## see http://www.lighttpd.net/documentation/compress.html
-##
-server.modules += ( "mod_compress" )
-
-##
-## where should the compressed files be cached?
-## see the base config for the declaration of the variable.
-##
-## This directory should be changed per vhost otherwise you can
-## run into trouble with overlapping filenames
-##
-compress.cache-dir = cache_dir + "/compress"
-
-##
-## FileTypes to compress.
-##
-compress.filetype = ("text/plain", "text/html")
-
-##
-## Maximum filesize that will be compressed.
-## Default is 0, which means unlimited file size.
-##
-#compress.max-filesize = 0
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/debug.conf b/doc/config/conf.d/debug.conf
deleted file mode 100644
index 80bbea0..0000000
--- a/doc/config/conf.d/debug.conf
+++ /dev/null
@@ -1,47 +0,0 @@
-#######################################################################
-##
-## Debug options
-## ---------------
-##
-## Enable those options for debugging the behavior
-##
-## The settings can be set per location/vhost.
-##
-
-##
-## log-request-handling allows you to track the request
-## handing inside lighttpd.
-##
-#debug.log-request-handling = "enable"
-
-##
-## log all request headers.
-##
-#debug.log-request-header = "enable"
-
-##
-## similar to log-request-header.
-## but only logs if we encountered an error.
-## (return codes 400 and 5xx)
-##
-#debug.log-request-header-on-error = "enable"
-
-##
-## log the header we send out to the client.
-##
-#debug.log-response-header = "enable"
-
-##
-## log if a file wasnt found in the error log.
-##
-#debug.log-file-not-found = "enable"
-
-##
-## debug conditionals handling
-##
-#debug.log-condition-handling = "enable"
-
-#
-#######################################################################
-
-
diff --git a/doc/config/conf.d/dirlisting.conf b/doc/config/conf.d/dirlisting.conf
deleted file mode 100644
index 53a18a2..0000000
--- a/doc/config/conf.d/dirlisting.conf
+++ /dev/null
@@ -1,55 +0,0 @@
-#######################################################################
-##
-## Dirlisting Module
-## -------------------
-##
-## See http://www.lighttpd.net/documentation/dirlisting.html
-##
-
-##
-## Enabled Directory listing
-##
-dir-listing.activate = "disable"
-
-##
-## Hide dot files from the listing?
-## By default they are listed.
-##
-dir-listing.hide-dotfiles = "disable"
-
-##
-## list of regular expressions. Files that match any of the specified
-## regular expressions will be excluded from directory listings.
-##
-dir-listing.exclude = ( "~$" )
-
-##
-## set a encoding for the generated directory listing
-##
-## If you file-system is not using ASCII you have to set the encoding of
-## the filenames as they are put into the HTML listing AS IS (with XML
-## encoding)
-##
-dir-listing.encoding = "UTF-8"
-
-##
-## Specify the url to an optional CSS file.
-##
-#dir-listing.external-css = "/dirindex.css"
-
-##
-## Include HEADER.txt files above the directory listing.
-## You can disable showing the HEADER.txt in the listing.
-##
-dir-listing.hide-header-file = "disable"
-dir-listing.show-header = "disable"
-
-##
-## Include README.txt files above the directory listing.
-## You can disable showing the README.txt in the listing.
-##
-dir-listing.hide-readme-file = "disable"
-dir-listing.show-readme = "disable"
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/evhost.conf b/doc/config/conf.d/evhost.conf
deleted file mode 100644
index 6da89c1..0000000
--- a/doc/config/conf.d/evhost.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-#######################################################################
-##
-## Enhanced virtual hosting
-## --------------------------
-##
-## See http://www.lighttpd.net/documentation/evhost.html
-##
-server.modules += ( "mod_evhost" )
-
-##
-## define a pattern for the host url finding
-## %% => % sign
-## %0 => domain name + tld
-## %1 => tld
-## %2 => domain name without tld
-## %3 => subdomain 1 name
-## %4 => subdomain 2 name
-##
-evhost.path-pattern = vhosts_dir + "/%3/htdocs/"
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/expire.conf b/doc/config/conf.d/expire.conf
deleted file mode 100644
index 0ca0ab2..0000000
--- a/doc/config/conf.d/expire.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-#######################################################################
-##
-## Expire Module
-## ---------------
-##
-## See http://www.lighttpd.net/documentation/expire.html
-##
-server.modules += ( "mod_expire" )
-
-##
-## assignes a expiration to all files below the specified path. The
-## specification of the time is made up of:
-##
-## <access|modification> <number> <years|months|days|hours|minutes|seconds>
-##
-#expire.url = (
-# "/buggy/" => "access 2 hours",
-# "/images/" => "access plus 1 seconds 2 minutes"
-#)
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/fastcgi.conf b/doc/config/conf.d/fastcgi.conf
deleted file mode 100644
index 49cff62..0000000
--- a/doc/config/conf.d/fastcgi.conf
+++ /dev/null
@@ -1,135 +0,0 @@
-#######################################################################
-##
-## FastCGI Module
-## ---------------
-##
-## http://www.lighttpd.net/documentation/fastcgi.html
-##
-server.modules += ( "mod_fastcgi" )
-
-##
-## PHP Example
-## For PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini.
-##
-## The number of php processes you will get can be easily calculated:
-##
-## num-procs = max-procs * ( 1 + PHP_FCGI_CHILDREN )
-##
-## for the php-num-procs example it means you will get 17*5 = 85 php
-## processes. you always should need this high number for your very
-## busy sites. And if you have a lot of RAM. :)
-##
-#fastcgi.server = ( ".php" =>
-# ( "php-local" =>
-# (
-# "socket" => socket_dir + "/php-fastcgi-1.socket",
-# "bin-path" => server_root + "/cgi-bin/php5",
-# "max-procs" => 1,
-# "broken-scriptfilename" => "enable",
-# )
-# ),
-# ( "php-tcp" =>
-# (
-# "host" => "127.0.0.1",
-# "port" => 9999,
-# "check-local" => "disable",
-# "broken-scriptfilename" => "enable",
-# )
-# ),
-#
-# ( "php-num-procs" =>
-# (
-# "socket" => socket_dir + "/php-fastcgi-2.socket",
-# "bin-path" => server_root + "/cgi-bin/php5",
-# "bin-environment" => (
-# "PHP_FCGI_CHILDREN" => "16",
-# "PHP_FCGI_MAX_REQUESTS" => "10000",
-# ),
-# "max-procs" => 5,
-# "broken-scriptfilename" => "enable",
-# )
-# ),
-# )
-
-##
-## Ruby on Rails Example
-##
-## Normally you only run one Rails application on one vhost.
-##
-#$HTTP["host"] == "rails1.example.com" {
-# server.document-root = server_root + "/rails/someapp/public"
-# server.error-handler-404 = "/dispatch.fcgi"
-# fastcgi.server = ( ".fcgi" =>
-# ("someapp" =>
-# ( "socket" => socket_dir + "/someapp-fcgi.socket",
-# "bin-path" => server_root + "/rails/someapp/public/dispatch.fcgi",
-# "bin-environment" => (
-# "RAILS_ENV" => "production",
-# "TMP" => home_dir + "/rails/someapp",
-# ),
-# )
-# )
-# )
-#}
-
-##
-## Another example with multiple rails applications on one vhost.
-##
-## http://blog.lighttpd.net/articles/2005/11/23/lighttpd-1-4-8-and-multiple-rails-apps
-##
-#$HTTP["host"] == "rails2.example.com" {
-# $HTTP["url"] =~ "^/someapp1" {
-# server.document-root = server_root + "/rails/someapp1/public"
-# server.error-handler-404 = "/dispatch.fcgi"
-# fastcgi.server = ( ".fcgi" =>
-# ("someapp1" =>
-# ( "socket" => socket_dir + "/someapp1-fcgi.socket",
-# "bin-path" => server_root + "/rails/someapp1/public/dispatch.fcgi",
-# "bin-environment" => (
-# "RAILS_ENV" => "production",
-# "TMP" => home_dir + "/rails/someapp1",
-# ),
-# "strip-request-uri" => "/someapp1/"
-# )
-# )
-# )
-# }
-#
-# $HTTP["url"] =~ "^/someapp2" {
-# server.document-root = server_root + "/rails/someapp2/public"
-# server.error-handler-404 = "/dispatch.fcgi"
-# fastcgi.server = ( ".fcgi" =>
-# ("someapp2" =>
-# ( "socket" => socket_dir + "/someapp2-fcgi.socket",
-# "bin-path" => server_root + "/rails/someapp2/public/dispatch.fcgi",
-# "bin-environment" => (
-# "RAILS_ENV" => "production",
-# "TMP" => home_dir + "/rails/someapp2",
-# ),
-# "strip-request-uri" => "/someapp2/"
-# )
-# )
-# )
-# }
-#}
-
-## chrooted webserver + external PHP
-##
-## $ spawn-fcgi -f /usr/bin/php-cgi -p 2000 -a 127.0.0.1 -C 8
-##
-## webserver chrooted to /srv/www/
-## php running outside the chroot
-#
-#fastcgi.server = (
-# ".php" => ((
-# "host" => "127.0.0.1",
-# "port" => "2000",
-# "docroot" => "/srv/www/servers/www.example.org/htdocs/"
-# )))
-#
-#server.chroot = "/srv/www"
-#server.document-root = "/servers/wwww.example.org/htdocs/"
-#
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/geoip.conf b/doc/config/conf.d/geoip.conf
deleted file mode 100644
index 5b5b28b..0000000
--- a/doc/config/conf.d/geoip.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-#######################################################################
-##
-## GeoIP Module
-## ---------------
-##
-## mod_geoip is a module for fast ip/location lookups. It uses MaxMind
-## GeoIP / GeoCity databases. If the ip was found in the database the
-## module sets the appropriate environments variables to the request,
-## thus making other modules/fcgi be informed.
-##
-server.modules += ( "mod_geoip" )
-
-##
-## mod_geoip will determine the database type automatically so if you
-## enter GeoCity databse path it will load GeoCity Env.
-##
-#geoip.db-filename = "/path/to/GeoCityLite.dat"
-
-##
-## If enabled, mod_geoip will load the database binary file to memory
-## for very fast lookups. The only penalty is memory usage.
-##
-#geoip.memory-cache = "disable"
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/magnet.conf b/doc/config/conf.d/magnet.conf
deleted file mode 100644
index 1ebf529..0000000
--- a/doc/config/conf.d/magnet.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-#######################################################################
-##
-## Magnet Module
-## ---------------
-##
-## see http://trac.lighttpd.net/trac/wiki/Docs%3AModMagnet
-##
-server.modules += ( "mod_magnet" )
-
-##
-##
-##
-#magnet.attract-raw-url-to = ( )
-
-##
-## as an example for that see the mod_magnet docs and
-## http://pixel.global-banlist.de./
-##
-#magnet.attract-physical-path-to = ( conf_dir + "/cleanurl.lua" )
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/mime.conf b/doc/config/conf.d/mime.conf
deleted file mode 100644
index a3c6f0c..0000000
--- a/doc/config/conf.d/mime.conf
+++ /dev/null
@@ -1,77 +0,0 @@
-#######################################################################
-##
-## MimeType handling
-## -------------------
-##
-## http://www.lighttpd.net/documentation/configuration.html#mimetypes
-##
-## Use the "Content-Type" extended attribute to obtain mime type if
-## possible
-##
-mimetype.use-xattr = "disable"
-
-##
-## mimetype mapping
-##
-mimetype.assign = (
- ".pdf" => "application/pdf",
- ".sig" => "application/pgp-signature",
- ".spl" => "application/futuresplash",
- ".class" => "application/octet-stream",
- ".ps" => "application/postscript",
- ".torrent" => "application/x-bittorrent",
- ".dvi" => "application/x-dvi",
- ".gz" => "application/x-gzip",
- ".pac" => "application/x-ns-proxy-autoconfig",
- ".swf" => "application/x-shockwave-flash",
- ".tar.gz" => "application/x-tgz",
- ".tgz" => "application/x-tgz",
- ".tar" => "application/x-tar",
- ".zip" => "application/zip",
- ".mp3" => "audio/mpeg",
- ".m3u" => "audio/x-mpegurl",
- ".wma" => "audio/x-ms-wma",
- ".wax" => "audio/x-ms-wax",
- ".ogg" => "application/ogg",
- ".wav" => "audio/x-wav",
- ".gif" => "image/gif",
- ".jpg" => "image/jpeg",
- ".jpeg" => "image/jpeg",
- ".png" => "image/png",
- ".xbm" => "image/x-xbitmap",
- ".xpm" => "image/x-xpixmap",
- ".xwd" => "image/x-xwindowdump",
- ".css" => "text/css",
- ".html" => "text/html",
- ".htm" => "text/html",
- ".js" => "text/javascript",
- ".asc" => "text/plain",
- ".c" => "text/plain",
- ".cpp" => "text/plain",
- ".log" => "text/plain",
- ".conf" => "text/plain",
- ".text" => "text/plain",
- ".txt" => "text/plain",
- ".spec" => "text/plain",
- ".dtd" => "text/xml",
- ".xml" => "text/xml",
- ".mpeg" => "video/mpeg",
- ".mpg" => "video/mpeg",
- ".mov" => "video/quicktime",
- ".qt" => "video/quicktime",
- ".avi" => "video/x-msvideo",
- ".asf" => "video/x-ms-asf",
- ".asx" => "video/x-ms-asf",
- ".wmv" => "video/x-ms-wmv",
- ".bz2" => "application/x-bzip",
- ".tbz" => "application/x-bzip-compressed-tar",
- ".tar.bz2" => "application/x-bzip-compressed-tar",
- ".rpm" => "application/x-rpm",
- # make the default mime type application/octet-stream.
- "" => "application/octet-stream",
- )
-
-
-#
-#######################################################################
-
diff --git a/doc/config/conf.d/mod.template b/doc/config/conf.d/mod.template
deleted file mode 100644
index fcfdac4..0000000
--- a/doc/config/conf.d/mod.template
+++ /dev/null
@@ -1,16 +0,0 @@
-#######################################################################
-##
-## Foo Module
-## ---------------
-##
-## http://www.lighttpd.net/documentation/Foo.html
-##
-server.modules += ( "mod_Foo" )
-
-##
-## foo
-##
-#foo.bar = 1
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/mysql_vhost.conf b/doc/config/conf.d/mysql_vhost.conf
deleted file mode 100644
index 63550c4..0000000
--- a/doc/config/conf.d/mysql_vhost.conf
+++ /dev/null
@@ -1,47 +0,0 @@
-#######################################################################
-##
-## Virtual hosting with MySQL
-## ----------------------------
-##
-## http://www.lighttpd.net/documentation/mysqlvhost.html
-##
-server.modules += ( "mod_mysql_vhost" )
-
-##
-## Either set the the socket or host (and port)
-##
-## Local path to the mysql socket
-##
-#mysql-vhost.sock = "/var/lib/mysql/mysql.sock"
-
-##
-## Host of the MySQL server.
-##
-#mysql-vhost.hostname = "localhost"
-
-##
-## Optional: port to use.
-##
-#mysql-vhost.port = 3306
-
-##
-## Name of the database
-##
-mysql-vhost.db = "lighttpd"
-
-##
-## SQL User/Password for the connection
-##
-mysql-vhost.user = "lighttpd"
-mysql-vhost.pass = "secret"
-
-##
-## The query to get the needed informations from the database.
-##
-## It doesnt matter how you name the fields the first field is always used
-## as the document root.
-##
-mysql-vhost.sql = "SELECT docroot FROM domains WHERE domain='?'"
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/proxy.conf b/doc/config/conf.d/proxy.conf
deleted file mode 100644
index f0552c2..0000000
--- a/doc/config/conf.d/proxy.conf
+++ /dev/null
@@ -1,35 +0,0 @@
-#######################################################################
-##
-## Proxy Module
-## ---------------
-##
-## http://www.lighttpd.net/documentation/proxy.html
-##
-server.modules += ( "mod_proxy" )
-
-##
-## a value between 0 and 65535 to set the debug-level in the Proxy module.
-## Currently only 0 and 1 are used. Use 1 to enable some debug output, 0 to
-## disable it.
-##
-#proxy.debug = 1
-
-##
-## might be one of 'hash', 'round-robin' or 'fair' (default).
-##
-#proxy.balance = "fair"
-
-##
-## Handle all jsp requests via 192.168.0.101
-##
-#proxy.server = ( ".jsp" =>
-# ( "tomcat" =>
-# (
-# "host" => "192.168.0.101",
-# "port" => 80
-# )
-# )
-# )
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/rrdtool.conf b/doc/config/conf.d/rrdtool.conf
deleted file mode 100644
index c29013b..0000000
--- a/doc/config/conf.d/rrdtool.conf
+++ /dev/null
@@ -1,21 +0,0 @@
-#######################################################################
-##
-## RRD Tool Module
-## -----------------
-##
-## see http://www.lighttpd.net/documentation/rrdtool.html
-##
-server.modules += ( "mod_rrdtool" )
-
-##
-## Path to the rrdtool binary.
-##
-rrdtool.binary = "/usr/bin/rrdtool"
-
-##
-## Path to the rrdtool database. You can override this in conditionals.
-##
-rrdtool.db-name = "/var/lib/lighttpd/lighttpd.rrd"
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/scgi.conf b/doc/config/conf.d/scgi.conf
deleted file mode 100644
index 3fcf280..0000000
--- a/doc/config/conf.d/scgi.conf
+++ /dev/null
@@ -1,51 +0,0 @@
-#######################################################################
-##
-## FastCGI Module
-## ---------------
-##
-## http://www.lighttpd.net/documentation/scgi.html
-##
-server.modules += ( "mod_scgi" )
-
-##
-## Ruby on Rails Example
-##
-## Normally you only run one Rails application on one vhost.
-##
-#$HTTP["host"] == "rails1.example.com" {
-# server.document-root = server_root + "/rails/someapp/public"
-# server.error-handler-404 = "/dispatch.fcgi"
-# scgi.server = ( ".scgi" =>
-# ("scgi-someapp" =>
-# ( "socket" => socket_dir + "/someapp-scgi.socket",
-# "bin-path" => server_root + "/rails/someapp/public/dispatch.scgi",
-# "bin-environment" => (
-# "RAILS_ENV" => "production",
-# "TMP" => home_dir + "/rails/someapp",
-# ),
-# )
-# )
-# )
-#}
-
-##
-## 2nd Ruby on Rails Example
-##
-## This time we launch the rails application via scgi_rails externally.
-##
-#$HTTP["host"] == "rails2.example.com" {
-# server.document-root = server_root + "/rails/someapp/public"
-# server.error-handler-404 = "/dispatch.scgi"
-# scgi.server = ( ".scgi" =>
-# ( "scgi-tcp" =>
-# (
-# "host" => "127.0.0.1",
-# "port" => 9998,
-# "check-local" => "disable",
-# )
-# )
-# )
-#}
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/secdownload.conf b/doc/config/conf.d/secdownload.conf
deleted file mode 100644
index 2d4d11a..0000000
--- a/doc/config/conf.d/secdownload.conf
+++ /dev/null
@@ -1,35 +0,0 @@
-#######################################################################
-##
-## Secure Download Module
-## ------------------------
-##
-## see http://www.lighttpd.net/documentation/secdownload.html
-##
-server.modules += ( "mod_secdownload" )
-
-##
-## Document root for the download area.
-## The directory should not be below your normal
-## document root!
-##
-#secdownload.document-root = server_root + "/downloads"
-
-##
-## Secret string that will be used for the checksum calculation.
-##
-#secdownload.secret = ""
-
-##
-## How long is the secret valid?
-##
-## Default: 60 seconds
-##
-#secdownload.timeout = 60
-
-##
-## Prefix for the download area.
-##
-#secdownload.uri-prefix = "/download/"
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/simple_vhost.conf b/doc/config/conf.d/simple_vhost.conf
deleted file mode 100644
index 220331e..0000000
--- a/doc/config/conf.d/simple_vhost.conf
+++ /dev/null
@@ -1,28 +0,0 @@
-#######################################################################
-##
-## Simple Virtual hosting
-## ------------------------
-##
-## http://www.lighttpd.net/documentation/simple-vhost.html
-##
-server.modules += ( "mod_simple_vhost" )
-
-## If you want name-based virtual hosting add the next three settings and load
-## mod_simple_vhost
-##
-## document-root =
-## virtual-server-root + virtual-server-default-host + virtual-server-docroot
-## or
-## virtual-server-root + http-host + virtual-server-docroot
-##
-simple-vhost.server-root = vhosts_dir + "/"
-simple-vhost.default-host = "default.example.com"
-simple-vhost.document-root = "/htdocs/"
-
-##
-## Print some errors for finding the document-root
-##
-#simple-vhost.debug = "enable"
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/ssi.conf b/doc/config/conf.d/ssi.conf
deleted file mode 100644
index a82d1a5..0000000
--- a/doc/config/conf.d/ssi.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-#######################################################################
-##
-## Server Side Includes
-## -----------------------
-##
-## see /usr/share/doc/packages/lighttpd/ssi.html
-##
-server.modules += ( "mod_ssi" )
-
-##
-## which extensions should be ran through mod_ssi.
-##
-ssi.extension = ( ".shtml" )
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/status.conf b/doc/config/conf.d/status.conf
deleted file mode 100644
index 946939f..0000000
--- a/doc/config/conf.d/status.conf
+++ /dev/null
@@ -1,24 +0,0 @@
-#######################################################################
-##
-## Status Module
-## ---------------
-##
-## see http://www.lighttpd.net/documentation/status.html
-##
-server.modules += ( "mod_status" )
-
-$HTTP["remoteip"] == "127.0.0.0/8" {
-##
-## configure urls for the various parts of the module.
-##
- status.status-url = "/server-status"
- status.config-url = "/server-config"
- status.statistics-url = "/server-statistics"
-##
-## add JavaScript which allows client-side sorting for the connection
-## overview
-##
- status.enable-sort = "enable"
-}
-##
-#######################################################################
diff --git a/doc/config/conf.d/trigger_b4_dl.conf b/doc/config/conf.d/trigger_b4_dl.conf
deleted file mode 100644
index 1efd3fd..0000000
--- a/doc/config/conf.d/trigger_b4_dl.conf
+++ /dev/null
@@ -1,70 +0,0 @@
-#######################################################################
-##
-## Trigger before download
-## ---------------
-##
-## - if user requests ''download-url'' directly, the request is denied
-## and he is redirected to ''deny-url'
-## - if user visits ''trigger-url'' before requesting ''download-url'',
-## access is granted
-## - if user visits ''download-url'' again after ''trigger-timeout'' has
-## elapsed, the request is denied and he is redirected to ''deny-url''
-##
-## http://www.lighttpd.net/documentation/trigger_b4_dl.html
-##
-server.modules += ( "mod_mod_trigger_b4_dl" )
-
-##
-## To store the trigger state you can either use a local GDBM
-## file or memcached(s).
-##
-
-##
-## Path to the local GDBM file.
-##
-trigger-before-download.gdbm-filename = home_dir + "/trigger.db"
-
-##
-## List of memcached servers.
-##
-#trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" )
-
-##
-## URL prefix a visitor has to visit before downloading is allowed
-##
-trigger-before-download.trigger-url = "^/trigger/"
-
-##
-## URL Prefix of the proteced area.
-##
-trigger-before-download.download-url = "^/download/"
-
-##
-##
-## The deny url.
-##
-trigger-before-download.deny-url = "http://www.example.com/index.html"
-
-##
-## How long the "ticket" of the user will be valid.
-##
-## Value in seconds.
-##
-trigger-before-download.trigger-timeout = 10
-
-##
-## Normally the memcached key will be the remote ip of the request
-## If you store other data in the memcached aswell and want to avoid
-## key collisions you can configure a memcache-namespace.
-##
-## The key for the request will be memcache-namespace + remote_ip than.
-##
-#trigger-before-download.memcache-namespace = "t4bdl_"
-
-##
-## If set to 1, the module will log some debug informations.
-##
-#trigger-before-download.debug = 0
-
-##
-#######################################################################
diff --git a/doc/config/conf.d/userdir.conf b/doc/config/conf.d/userdir.conf
deleted file mode 100644
index 1e3691e..0000000
--- a/doc/config/conf.d/userdir.conf
+++ /dev/null
@@ -1,37 +0,0 @@
-#######################################################################
-##
-## Userdir Module
-## ----------------
-##
-## for all details see:
-## http://www.lighttpd.net/documentation/userdir.html
-##
-server.modules += ( "mod_userdir" )
-
-##
-## usually it should be set to "public_html" to take ~/public_html/ as
-## the document root
-## Default: empty (document root is the home directory)
-##
-userdir.path = "public_html"
-
-##
-## If set, don't check /etc/passwd for homedir
-## Default: empty
-#userdir.basepath = server_root + "/users/"
-
-##
-## list of usernames which may not use this feature
-## Default: empty (all users may use it)
-##
-#userdir.exclude-user = ( "root", "postmaster" )
-
-##
-## if set, only users from this list may use the feature
-## Default: empty (all users may use it)
-##
-#userdir.include-user = ("user1", "user2")
-
-##
-#######################################################################
-
diff --git a/doc/config/conf.d/webdav.conf b/doc/config/conf.d/webdav.conf
deleted file mode 100644
index 2c37335..0000000
--- a/doc/config/conf.d/webdav.conf
+++ /dev/null
@@ -1,33 +0,0 @@
-#######################################################################
-##
-## WebDAV Module
-## ---------------
-##
-## http://www.lighttpd.net/documentation/webdav.html
-##
-server.modules += ( "mod_webdav" )
-
-$HTTP["url"] =~ "^/dav($|/)" {
- ##
- ## enable webdav for this location
- ##
- webdav.activate = "enable"
-
- ##
- ## By default the webdav url is writable.
- ## Uncomment the following line if you want to make it readonly.
- ##
- #webdav.is-readonly = "enable"
-
- ##
- ## Log the XML Request bodies for debugging
- ##
- #webdav.log-xml = "disable"
-
- ##
- ##
- ##
- webdav.sqlite-db-name = home_dir + "/webdav.db"
-}
-##
-#######################################################################
diff --git a/doc/config/lighttpd.conf b/doc/config/lighttpd.conf
deleted file mode 100644
index 47d6729..0000000
--- a/doc/config/lighttpd.conf
+++ /dev/null
@@ -1,445 +0,0 @@
-#######################################################################
-##
-## /etc/lighttpd/lighttpd.conf
-##
-## check /etc/lighttpd/conf.d/*.conf for the configuration of modules.
-##
-#######################################################################
-
-#######################################################################
-##
-## Some Variable definition which will make chrooting easier.
-##
-## if you add a variable here. Add the corresponding variable in the
-## chroot example aswell.
-##
-var.log_root = "/var/log/lighttpd"
-var.server_root = "/srv/www"
-var.state_dir = "/var/run"
-var.home_dir = "/var/lib/lighttpd"
-var.conf_dir = "/etc/lighttpd"
-
-##
-## run the server chrooted.
-##
-## This requires root permissions during startup.
-##
-## If you run Chrooted set the the variables to directories relative to
-## the chroot dir.
-##
-## example chroot configuration:
-##
-#var.log_root = "/logs"
-#var.server_root = "/"
-#var.state_dir = "/run"
-#var.home_dir = "/lib/lighttpd"
-#var.vhosts_dir = "/vhosts"
-#var.conf_dir = "/etc"
-#
-#server.chroot = "/srv/www"
-
-##
-## Some additional variables to make the configuration easier
-##
-
-##
-## Base directory for all virtual hosts
-##
-## used in:
-## conf.d/evhost.conf
-## conf.d/simple_vhost.conf
-## vhosts.d/vhosts.template
-##
-var.vhosts_dir = server_root + "/vhosts"
-
-##
-## Cache for mod_compress
-##
-## used in:
-## conf.d/compress.conf
-##
-var.cache_dir = "/var/cache/lighttpd"
-
-##
-## Base directory for sockets.
-##
-## used in:
-## conf.d/fastcgi.conf
-## conf.d/scgi.conf
-##
-var.socket_dir = home_dir + "/sockets"
-
-##
-#######################################################################
-
-#######################################################################
-##
-## Load the modules.
-include "modules.conf"
-
-##
-#######################################################################
-
-#######################################################################
-##
-## Basic Configuration
-## ---------------------
-##
-server.port = 80
-
-##
-## Use IPv6?
-##
-server.use-ipv6 = "enable"
-
-##
-## bind to a specific IP
-##
-#server.bind = "localhost"
-
-##
-## Run as a different username/groupname.
-## This requires root permissions during startup.
-##
-server.username = "lighttpd"
-server.groupname = "lighttpd"
-
-##
-## enable core files.
-##
-#server.core-files = "disable"
-
-##
-## Document root
-##
-server.document-root = server_root + "/htdocs"
-
-##
-## The value for the "Server:" response field.
-##
-## It would be nice to keep it at "lighttpd".
-##
-#server.tag = "lighttpd"
-
-##
-## store a pid file
-##
-server.pid-file = state_dir + "/lighttpd.pid"
-
-##
-#######################################################################
-
-#######################################################################
-##
-## Logging Options
-## ------------------
-##
-## all logging options can be overwritten per vhost.
-##
-## Path to the error log file
-##
-server.errorlog = log_root + "/error.log"
-
-##
-## If you want to log to syslog you have to unset the
-## server.errorlog setting and uncomment the next line.
-##
-#server.errorlog-use-syslog = "enable"
-
-##
-## Access log config
-##
-include "conf.d/access_log.conf"
-
-##
-## The debug options are moved into their own file.
-## see conf.d/debug.conf for various options for request debugging.
-##
-include "conf.d/debug.conf"
-
-##
-#######################################################################
-
-#######################################################################
-##
-## Tuning/Performance
-## --------------------
-##
-## corresponding documentation:
-## http://www.lighttpd.net/documentation/performance.html
-##
-## set the event-handler (read the performance section in the manual)
-##
-## possible options on linux are:
-##
-## select
-## poll
-## linux-sysepoll
-##
-## linux-sysepoll is recommended on kernel 2.6.
-##
-server.event-handler = "linux-sysepoll"
-
-##
-## The basic network interface for all platforms at the syscalls read()
-## and write(). Every modern OS provides its own syscall to help network
-## servers transfer files as fast as possible
-##
-## linux-sendfile - is recommended for small files.
-## writev - is recommended for sending many large files
-##
-server.network-backend = "linux-sendfile"
-
-##
-## As lighttpd is a single-threaded server, its main resource limit is
-## the number of file descriptors, which is set to 1024 by default (on
-## most systems).
-##
-## If you are running a high-traffic site you might want to increase this
-## limit by setting server.max-fds.
-##
-## Changing this setting requires root permissions on startup. see
-## server.username/server.groupname.
-##
-## By default lighttpd would not change the operation system default.
-## But setting it to 2048 is a better default for busy servers.
-##
-server.max-fds = 2048
-
-##
-## Stat() call caching.
-##
-## lighttpd can utilize FAM/Gamin to cache stat call.
-##
-## possible values are:
-## disable, simple or fam.
-##
-server.stat-cache-engine = "simple"
-
-##
-## Fine tuning for the request handling
-##
-## max-connections == max-fds/2 (maybe /3)
-## means the other file handles are used for fastcgi/files
-##
-server.max-connections = 1024
-
-##
-## How many seconds to keep a keep-alive connection open,
-## until we consider it idle.
-##
-## Default: 5
-##
-#server.max-keep-alive-idle = 5
-
-##
-## How many keep-alive requests until closing the connection.
-##
-## Default: 16
-##
-#server.max-keep-alive-requests = 16
-
-##
-## Maximum size of a request in kilobytes.
-## By default it is unlimited (0).
-##
-## Uploads to your server cant be larger than this value.
-##
-#server.max-request-size = 0
-
-##
-## Time to read from a socket before we consider it idle.
-##
-## Default: 60
-##
-#server.max-read-idle = 60
-
-##
-## Time to write to a socket before we consider it idle.
-##
-## Default: 360
-##
-#server.max-write-idle = 360
-
-##
-## Traffic Shaping
-## -----------------
-##
-## see /usr/share/doc/lighttpd/traffic-shaping.txt
-##
-## Values are in kilobyte per second.
-##
-## Keep in mind that a limit below 32kB/s might actually limit the
-## traffic to 32kB/s. This is caused by the size of the TCP send
-## buffer.
-##
-## per server:
-##
-#server.kbytes-per-second = 128
-
-##
-## per connection:
-##
-#connection.kbytes-per-second = 32
-
-##
-#######################################################################
-
-#######################################################################
-##
-## Filename/File handling
-## ------------------------
-
-##
-## files to check for if .../ is requested
-## index-file.names = ( "index.php", "index.rb", "index.html",
-## "index.htm", "default.htm" )
-##
-index-file.names += (
- "index.xhtml", "index.html", "index.htm", "default.htm", "index.php"
-)
-
-##
-## deny access the file-extensions
-##
-## ~ is for backupfiles from vi, emacs, joe, ...
-## .inc is often used for code includes which should in general not be part
-## of the document-root
-url.access-deny = ( "~", ".inc" )
-
-##
-## disable range requests for pdf files
-## workaround for a bug in the Acrobat Reader plugin.
-##
-$HTTP["url"] =~ "\.pdf$" {
- server.range-requests = "disable"
-}
-
-##
-## url handling modules (rewrite, redirect)
-##
-#url.rewrite = ( "^/$" => "/server-status" )
-#url.redirect = ( "^/wishlist/(.+)" => "http://www.example.com/$1" )
-
-##
-## both rewrite/redirect support back reference to regex conditional using %n
-##
-#$HTTP["host"] =~ "^www\.(.*)" {
-# url.redirect = ( "^/(.*)" => "http://%1/$1" )
-#}
-
-##
-## which extensions should not be handle via static-file transfer
-##
-## .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
-##
-static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" )
-
-##
-## error-handler for status 404
-##
-#server.error-handler-404 = "/error-handler.html"
-#server.error-handler-404 = "/error-handler.php"
-
-##
-## Format: <errorfile-prefix><status-code>.html
-## -> ..../status-404.html for 'File not found'
-##
-#server.errorfile-prefix = "/srv/www/htdocs/errors/status-"
-
-##
-## mimetype mapping
-##
-include "conf.d/mime.conf"
-
-##
-## directory listing configuration
-##
-include "conf.d/dirlisting.conf"
-
-##
-## Should lighttpd follow symlinks?
-##
-server.follow-symlink = "enable"
-
-##
-## force all filenames to be lowercase?
-##
-#server.force-lowercase-filenames = "disable"
-
-##
-## defaults to /var/tmp as we assume it is a local harddisk
-##
-server.upload-dirs = ( "/var/tmp" )
-
-##
-#######################################################################
-
-
-#######################################################################
-##
-## SSL Support
-## -------------
-##
-## To enable SSL for the whole server you have to provide a valid
-## certificate and have to enable the SSL engine.::
-##
-## ssl.engine = "enable"
-## ssl.pemfile = "/path/to/server.pem"
-##
-## The HTTPS protocol does not allow you to use name-based virtual
-## hosting with SSL. If you want to run multiple SSL servers with
-## one lighttpd instance you must use IP-based virtual hosting: ::
-##
-## $SERVER["socket"] == "10.0.0.1:443" {
-## ssl.engine = "enable"
-## ssl.pemfile = "/etc/ssl/private/www.example.com.pem"
-## #
-## # Mitigate BEAST attack:
-## #
-## # A stricter base cipher suite. For details see:
-## # http://blog.ivanristic.com/2011/10/mitigating-the-beast-attack-on-tls.html
-## #
-## ssl.cipher-list = "ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4-SHA:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM"
-## #
-## # Make the server prefer the order of the server side cipher suite instead of the client suite.
-## # This is necessary to mitigate the BEAST attack (unless you disable all non RC4 algorithms).
-## # This option is enabled by default, but only used if ssl.cipher-list is set.
-## #
-## # ssl.honor-cipher-order = "enable"
-## #
-## # Mitigate CVE-2009-3555 by disabling client triggered renegotation
-## # This is enabled by default.
-## #
-## # ssl.disable-client-renegotiation = "enable"
-## #
-## server.name = "www.example.com"
-##
-## server.document-root = "/srv/www/vhosts/example.com/www/"
-## }
-##
-
-## If you have a .crt and a .key file, cat them together into a
-## single PEM file:
-## $ cat /etc/ssl/private/lighttpd.key /etc/ssl/certs/lighttpd.crt \
-## > /etc/ssl/private/lighttpd.pem
-##
-#ssl.pemfile = "/etc/ssl/private/lighttpd.pem"
-
-##
-## optionally pass the CA certificate here.
-##
-##
-#ssl.ca-file = ""
-
-##
-#######################################################################
-
-#######################################################################
-##
-## custom includes like vhosts.
-##
-#include "conf.d/config.conf"
-#include_shell "cat /etc/lighttpd/vhosts.d/*.conf"
-##
-#######################################################################
diff --git a/doc/config/modules.conf b/doc/config/modules.conf
deleted file mode 100644
index 99a3c3f..0000000
--- a/doc/config/modules.conf
+++ /dev/null
@@ -1,172 +0,0 @@
-#######################################################################
-##
-## Modules to load
-## -----------------
-##
-## at least mod_access and mod_accesslog should be loaded
-## all other module should only be loaded if really neccesary
-##
-## - saves some time
-## - saves memory
-##
-## the default module set contains:
-##
-## "mod_indexfile", "mod_dirlisting", "mod_staticfile"
-##
-## you dont have to include those modules in your list
-##
-## Modules, which are pulled in via conf.d/*.conf
-##
-## NOTE: the order of modules is important.
-##
-## - mod_accesslog -> conf.d/access_log.conf
-## - mod_compress -> conf.d/compress.conf
-## - mod_status -> conf.d/status.conf
-## - mod_webdav -> conf.d/webdav.conf
-## - mod_cml -> conf.d/cml.conf
-## - mod_evhost -> conf.d/evhost.conf
-## - mod_simple_vhost -> conf.d/simple_vhost.conf
-## - mod_mysql_vhost -> conf.d/mysql_vhost.conf
-## - mod_trigger_b4_dl -> conf.d/trigger_b4_dl.conf
-## - mod_userdir -> conf.d/userdir.conf
-## - mod_rrdtool -> conf.d/rrdtool.conf
-## - mod_ssi -> conf.d/ssi.conf
-## - mod_cgi -> conf.d/cgi.conf
-## - mod_scgi -> conf.d/scgi.conf
-## - mod_fastcgi -> conf.d/fastcgi.conf
-## - mod_proxy -> conf.d/proxy.conf
-## - mod_secdownload -> conf.d/secdownload.conf
-## - mod_expire -> conf.d/expire.conf
-##
-
-server.modules = (
- "mod_access",
-# "mod_alias",
-# "mod_auth",
-# "mod_evasive",
-# "mod_redirect",
-# "mod_rewrite",
-# "mod_setenv",
-# "mod_usertrack",
-)
-
-##
-#######################################################################
-
-#######################################################################
-##
-## Config for various Modules
-##
-
-##
-## mod_ssi
-##
-#include "conf.d/ssi.conf"
-
-##
-## mod_status
-##
-#include "conf.d/status.conf"
-
-##
-## mod_webdav
-##
-#include "conf.d/webdav.conf"
-
-##
-## mod_compress
-##
-#include "conf.d/compress.conf"
-
-##
-## mod_userdir
-##
-#include "conf.d/userdir.conf"
-
-##
-## mod_magnet
-##
-#include "conf.d/magnet.conf"
-
-##
-## mod_cml
-##
-#include "conf.d/cml.conf"
-
-##
-## mod_rrdtool
-##
-#include "conf.d/rrdtool.conf"
-
-##
-## mod_proxy
-##
-#include "conf.d/proxy.conf"
-
-##
-## mod_expire
-##
-#include "conf.d/expire.conf"
-
-##
-## mod_secdownload
-##
-#include "conf.d/secdownload.conf"
-
-##
-#######################################################################
-
-#######################################################################
-##
-## CGI modules
-##
-
-##
-## SCGI (mod_scgi)
-##
-#include "conf.d/scgi.conf"
-
-##
-## FastCGI (mod_fastcgi)
-##
-#include "conf.d/fastcgi.conf"
-
-##
-## plain old CGI (mod_cgi)
-##
-#include "conf.d/cgi.conf"
-
-##
-#######################################################################
-
-#######################################################################
-##
-## VHost Modules
-##
-## Only load ONE of them!
-## ========================
-##
-
-##
-## You can use conditionals for vhosts aswell.
-##
-## see http://www.lighttpd.net/documentation/configuration.html
-##
-
-##
-## mod_evhost
-##
-#include "conf.d/evhost.conf"
-
-##
-## mod_simple_vhost
-##
-#include "conf.d/simple_vhost.conf"
-
-##
-## mod_mysql_vhost
-##
-#include "conf.d/mysql_vhost.conf"
-
-##
-#######################################################################
diff --git a/doc/config/vhosts.d/Makefile.am b/doc/config/vhosts.d/Makefile.am
deleted file mode 100644
index 51d9376..0000000
--- a/doc/config/vhosts.d/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST=vhosts.template
diff --git a/doc/config/vhosts.d/Makefile.in b/doc/config/vhosts.d/Makefile.in
deleted file mode 100644
index a6e536d..0000000
--- a/doc/config/vhosts.d/Makefile.in
+++ /dev/null
@@ -1,401 +0,0 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = doc/config/vhosts.d
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-SOURCES =
-DIST_SOURCES =
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ATTR_LIB = @ATTR_LIB@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BZ_LIB = @BZ_LIB@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CRYPT_LIB = @CRYPT_LIB@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FAM_CFLAGS = @FAM_CFLAGS@
-FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
-GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LBER_LIB = @LBER_LIB@
-LD = @LD@
-LDAP_LIB = @LDAP_LIB@
-LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LUA_CFLAGS = @LUA_CFLAGS@
-LUA_LIBS = @LUA_LIBS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
-MYSQL_CONFIG = @MYSQL_CONFIG@
-MYSQL_INCLUDE = @MYSQL_INCLUDE@
-MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PCRECONFIG = @PCRECONFIG@
-PCRE_LIB = @PCRE_LIB@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SENDFILE_LIB = @SENDFILE_LIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SQLITE_CFLAGS = @SQLITE_CFLAGS@
-SQLITE_LIBS = @SQLITE_LIBS@
-SSL_LIB = @SSL_LIB@
-STRIP = @STRIP@
-U = @U@
-UUID_LIBS = @UUID_LIBS@
-VERSION = @VERSION@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-EXTRA_DIST = vhosts.template
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/config/vhosts.d/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign doc/config/vhosts.d/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-tags: TAGS
-TAGS:
-
-ctags: CTAGS
-CTAGS:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- distclean distclean-generic distclean-libtool distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/doc/config/vhosts.d/vhosts.template b/doc/config/vhosts.d/vhosts.template
deleted file mode 100644
index 2c443aa..0000000
--- a/doc/config/vhosts.d/vhosts.template
+++ /dev/null
@@ -1,33 +0,0 @@
-#######################################################################
-##
-## For more examples check:
-##
-## http://www.lighttpd.net/documentation/configuration.html#conditional-configuration
-##
-$HTTP["host"] == "download.example.com" {
- var.server_name = "download.example.com"
-
- server.name = server_name
- ##
- ## use trigger before download
- ##
- include "conf.d/trigger_b4_dl.conf"
-
- server.document-root = vhosts_dir + "/example.com/download/htdocs"
- ##
- ## use a seperate access log file
- ## At the moment you cant have different error log files.
- ##
- accesslog.filename = log_root + "/" + server_name "/access.log"
-}
-
-$SERVER["socket"] == "127.0.0.1:443" {
- server.name = "localhost"
- ssl.pemfile = "/etc/ssl/private/lighttpd-localhost.pem"
- ssl.engine = "enable"
-
- server.document-root = vhosts_dir + "/ssl-localhost/pages/"
-}
-
-##
-#######################################################################
diff --git a/doc/outdated/configuration.txt b/doc/configuration.txt
index 3d49f7f..106b008 100644
--- a/doc/outdated/configuration.txt
+++ b/doc/configuration.txt
@@ -7,15 +7,15 @@ Module: core
------------
:Author: Jan Kneschke
-:Date: $Date$
-:Revision: $Revision$
+:Date: $Date: 2005-11-11 13:43:16 +0100 (Fri, 11 Nov 2005) $
+:Revision: $Revision: 835 $
:abstract:
the layout of the configuration file
-
+
.. meta::
:keywords: lighttpd, configuration
-
+
.. contents:: Table of Contents
Description
@@ -36,25 +36,25 @@ A BNF like notation: ::
<array> : "(" [ <string> "=>" ] <value> [, [ <string> "=>" ] <value> ]* ")"
INCLUDE : "include" VALUE
INCLUDE_SHELL : "include_shell" STRING_VALUE
-
+
Example
-------
::
-
+
# default document-root
server.document-root = "/var/www/example.org/pages/"
-
+
# TCP port
server.port = 80
-
+
# selecting modules
server.modules = ( "mod_access", "mod_rewrite" )
-
+
# variables, computed when config is read.
var.mymodule = "foo"
server.modules += ( "mod_" + var.mymodule )
- # var.PID is initialised to the pid of lighttpd before config is parsed
+ var.PID is initized to the pid of lighttpd before config is parsed
# include, relative to dirname of main config file
include "mime.types.conf"
@@ -85,31 +85,20 @@ where <field> is one of one of the following:
$HTTP["cookie"]
match on cookie
-$HTTP["scheme"]
- match on scheme
$HTTP["host"]
match on host
$HTTP["useragent"]
-$HTTP["user-agent"]
match on useragent
$HTTP["referer"]
match on referer
-$HTTP["method"]
- math on the http method
$HTTP["url"]
match on url
-$HTTP["query-string"]
- match on the (not decoded) query-string
$HTTP["remoteip"]
-$HTTP["remote-ip"]
match on the remote IP or a remote Network
-$HTTP["language"]
- match on the Accept-Language header
$SERVER["socket"]
- match on socket. Value must be on the format "ip:port" where ip is an IP
- address and port a port number. Only equal match (==) is supported.
- It also binds the daemon to this socket. Use this if you want to do IP/port-
- based virtual hosts.
+ match on socket. Value must be on the format "$ip:$port" where $ip is an IP
+ address and $port a port number. Only equal match (==) is supported.
+ It also binds to this socket.
<operator> is one of:
@@ -135,22 +124,22 @@ Example
$HTTP["url"] =~ "^/download/" {
dir-listing.activate = "disable"
}
-
+
# handish virtual hosting
- # map all domains of a top-level-domain to a single document-root
- $HTTP["host"] =~ "(^|\.)example\.org$" {
+ # map all subdomains to a single document-root
+ $HTTP["host"] =~ "\.example\.org$" {
server.document-root = "/var/www/htdocs/example.org/pages/"
}
-
+
# multiple sockets
$SERVER["socket"] == "127.0.0.1:81" {
server.document-root = "..."
}
-
+
$SERVER["socket"] == "127.0.0.1:443" {
ssl.pemfile = "/var/www/certs/localhost.pem"
ssl.engine = "enable"
-
+
server.document-root = "/var/www/htdocs/secure.example.org/pages/"
}
@@ -158,88 +147,19 @@ Example
$HTTP["useragent"] =~ "Google" {
url.access-deny = ( "" )
}
-
+
# deny access for all image stealers
$HTTP["referer"] !~ "^($|http://www\.example\.org)" {
url.access-deny = ( ".jpg", ".jpeg", ".png" )
}
- # deny the access to www.example.org to all user which
+ # deny the access to www.example.org to all user which
# are not in the 10.0.0.0/8 network
$HTTP["host"] == "www.example.org" {
$HTTP["remoteip"] != "10.0.0.0/8" {
url.access-deny = ( "" )
}
- }
-
-Using variables
-===============
-
-You can set your own variables in the configuration to simplify your config.
-::
-
- var.basedir = "/home/www/servers/"
- $HTTP["host"] == "www.example.org" {
- server.name = "www.example.org"
- include "incl-base.conf"
- }
-
- in incl-base.conf:
- server.document-root = basedir + server.name + "/pages/"
- accesslog.filename = basedir + server.name + "/logs/access.log"
-
-You can also use environement variables or the default variables var.PID and
-var.CWD: ::
-
- var.basedir = env.LIGHTTPDBASE
-
- $HTTP["host"] == "www.example.org" {
- server.name = "www.example.org"
- include "incl-base.conf"
- include "incl-fastcgi.conf"
- }
-
- in incl-fastcgi.conf:
- fastcgi.server = ( ... => ((
- "socket" => basedir + server.name + "/tmp/fastcgi-" + PID + ".sock"
- )) )
-
-Or like the lighttpd script for rails does:
-
- var.basedir = var.CWD
-
- server.document-root = basedir + "/public/"
-
-Global context
-==============
-
-::
-
- global {
- ...
- }
-
-You don't need it in the main configuration file. But you might have
-difficulty setting server wide configuration inside a included-file from
-conditionals.
-
-Example
--------
-
-::
-
- in lighttpd.conf:
- server.modules = ()
- $HTTP["host"] == "www.example.org" {
- include "incl-php.conf"
- }
-
- in incl-php.conf:
- global {
- server.modules += ("mod_fastcgi")
- static-file.exclude-extensions += (".php")
- }
- fastcgi.server = "..."
+ }
Options
=======
@@ -258,75 +178,72 @@ server.document-root
might have specified with one of the above conditionals.
Default: no default, required
-
+
server.bind
- IP address, hostname or absolute path to the unix-domain socket the server
- listen on.
-
+ hostname of the server
+
Default: bind to all interfaces
-
- Example: ::
-
- server.bind = "127.0.0.1"
- server.bind = "www.example.org"
- server.bind = "/tmp/lighttpd.socket"
-
+
server.port
tcp-port to bind the server to
-
+
.. note:: port belows 1024 require root-permissions
-
+
Default: 80 (443 if ssl is enabled)
-
+
server.use-ipv6
bind to the IPv6 socket
-
-server.defer-accept
- set TCP_DEFER_ACCEPT to the specified value on the socket if the value is > 0
- and TCP_DEFER_ACCEPT is available on the platform (linux2.4+)
-
- default: 0
-
-server.tag
- set the string returned by the Server: response header
-
- Default: lighttpd <current-version>
-
+
server.errorlog
pathname of the error-log
-
+
Default: either STDERR or ``server.errorlog-use-syslog``
-
+
server.errorlog-use-syslog
send errorlog to syslog
-
+
Default: disabled
-
+
server.chroot
root-directory of the server
-
- NOTE: requires root-permissions
-
+
server.username
username used to run the server
-
+
NOTE: requires root-permissions
server.groupname
groupname used to run the server
-
+
NOTE: requires root-permissions
+dir-listing.activate
+ enables virtual directory listings if a directory is requested no
+ index-file was found
+
+dir-listing.hide-dotfiles
+ if enabled, does not list hidden files in directory listings generated
+ by the dir-listing option.
+
+ Default: enabled
+
+dir-listing.external-css
+ path to an external css stylesheet for the directory listing
+
+dir-listing.exclude
+ list of regular expressions. Files that match any of the specified regular
+ expressions will be excluded from directory listings.
+
server.follow-symlink
allow to follow-symlinks
-
+
Default: enabled
index-file.names
list of files to search for if a directory is requested
e.g.: ::
- index-file.names = ( "index.php", "index.html",
+ index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )
if a name starts with slash this file will be used a index generator
@@ -334,119 +251,105 @@ index-file.names
server.modules
modules to load
-
-.. note:: the order of the modules is important.
-
- The modules are executed in the order as they are specified. Loading
- mod_auth AFTER mod_fastcgi might disable authentication for fastcgi
- backends (if check-local is disabled).
-
- As auth should be done first, move it before all executing modules (like
- proxy, fastcgi, scgi and cgi).
-
- rewrites, redirects and access should be first, followed by auth and
- the docroot plugins.
-
- Afterwards the external handlers like fastcgi, cgi, scgi and proxy and
- at the bottom the post-processing plugins like mod_accesslog.
-
+
+.. note:: the order of the modules is somewhat important as the modules are
+ handled in the way they are specified. mod_rewrite should always be
+ the first module, mod_accesslog always the last.
+
e.g.: ::
- server.modules = ( "mod_rewrite",
- "mod_redirect",
+ server.modules = ( "mod_rewrite",
+ "mod_redirect",
"mod_alias",
- "mod_access",
- "mod_auth",
- "mod_status",
+ "mod_access",
+ "mod_auth",
+ "mod_status",
+ "mod_fastcgi",
+ "mod_proxy",
"mod_simple_vhost",
"mod_evhost",
"mod_userdir",
- "mod_secdownload",
- "mod_fastcgi",
- "mod_proxy",
"mod_cgi",
- "mod_ssi",
"mod_compress",
+ "mod_ssi",
"mod_usertrack",
"mod_expire",
+ "mod_secdownload",
"mod_rrdtool",
"mod_accesslog" )
Starting with lighttpd 1.4.0 three default modules are loaded automaticly:
- - mod_indexfile
+ - mod_indexfiles
- mod_dirlisting
- mod_staticfile
server.event-handler
- set the event handler
-
+ set the event handler
+
Default: "poll"
server.pid-file
- set the name of the .pid-file where the PID of the server should be placed.
- This option is used in combination with a start-script and the daemon mode
-
+ set the name of the .pid-file where the PID of the server should be placed.
+ This option is used in combination with a start-script and the deamon mode
+
Default: not set
-
+
server.max-request-size
- maximum size in kbytes of the request (header + body). Only applies to POST
- requests.
-
- Default: 2097152 (2GB)
+ maximum size in kbytes of the request (header + body)
+
+ Default: 2Gb
server.max-worker
- number of worker processes to spawn. This is usually only needed on servers
- which are fairly loaded and the network handler calls delay often (e.g. new
- requests are not handled instantaneously).
-
+ number of worker processes to spawn (works but has no benefit)
+
Default: 0
-
+
server.name
name of the server/virtual server
-
+
Default: hostname
server.max-keep-alive-requests
- maximum number of request within a keep-alive session before the server
+ maximum number of request within a keep-alive session before the server
terminates the connection
-
+
Default: 128
server.max-keep-alive-idle
maximum number of seconds until a idling keep-alive connection is droped
-
+
Default: 30
server.max-read-idle
- maximum number of seconds until a waiting, non keep-alive read times out
+ maximum number of seconds until a waiting, non keep-alive read times out
and closes the connection
-
+
Default: 60
server.max-write-idle
maximum number of seconds until a waiting write call times out and closes
the connection
-
+
Default: 360
server.error-handler-404
uri to call if the requested file results in a 404
Default: not set
-
+
Example: ::
-
+
server.error-handler-404 = "/error-404.php"
server.protocol-http11
defines if HTTP/1.1 is allowed or not.
-
+
Default: enabled
server.range-requests
defines if range requests are allowed or not.
-
+
Default: enabled
@@ -461,9 +364,9 @@ debugging
debug.dump-unknown-headers
enables listing of internally unhandled HTTP-headers
-
+
e.g. ::
-
+
debug.dump-unknown-headers = "enable"
mimetypes
@@ -472,20 +375,20 @@ mimetypes
mimetype.assign
list of known mimetype mappings
NOTE: if no mapping is given "application/octet-stream" is used
-
+
e.g.: ::
-
- mimetype.assign = ( ".png" => "image/png",
+
+ mimetype.assign = ( ".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".html" => "text/html",
".txt" => "text/plain" )
- The list is compared top down and the first match is taken. This is
+ The list is compared top down and the first match is taken. This is
important if you have matches like: ::
".tar.gz" => "application/x-tgz",
- ".gz" => "application/x-gzip",
+ ".gz" => "application/x-gzip",
If you want to set another default mimetype use: ::
@@ -499,17 +402,17 @@ mimetype.use-xattr
retrieve the "Content-Type" attribute on each file, and use that as the
mime type. If it's not defined or not available, fall back to the
mimetype.assign assignment.
-
+
e.g.: ::
-
+
mimetype.use-xattr = "enable"
-
+
on shell use:
-
+
$ attr -s Content-Type -V image/svg svgfile.svg
-
+
or
-
+
$ attr -s Content-Type -V text/html indexfile
@@ -517,16 +420,17 @@ debugging
`````````
debug.log-request-header
- default: disabled
+ default: disabled
+
debug.log-response-header
- default: disabled
+
+ default: disabled
debug.log-file-not-found
- default: disabled
+
+ default: disabled
debug.log-request-handling
- default: disabled
-debug.log-ssl-noise
- default: disabled
+ default: disabled
diff --git a/doc/outdated/expire.txt b/doc/expire.txt
index ca59c42..2aee938 100644
--- a/doc/outdated/expire.txt
+++ b/doc/expire.txt
@@ -12,17 +12,17 @@ Module: mod_expire
:abstract:
mod_expire controls the setting of the the Expire Response header
-
+
.. meta::
:keywords: lighttpd, expire
-
+
.. contents:: Table of Contents
Description
===========
mod_expire controls the Expire header in the Response Header of HTTP/1.0
-messages. It is usefull to set it for static files which should be cached
+messages. It is usefull to set it for static files which should be cached
aggressivly like images, stylesheets or similar.
Options
@@ -35,8 +35,8 @@ expire.url
<access|modification> <number> <years|months|days|hours|minutes|seconds>
following the syntax used by mod_expire in Apache 1.3.x and later.
-
+
Example: ::
-
+
expire.url = ( "/images/" => "access 1 hour" )
-
+
diff --git a/doc/outdated/fastcgi-state.dot b/doc/fastcgi-state.dot
index 8e3068c..8e3068c 100644
--- a/doc/outdated/fastcgi-state.dot
+++ b/doc/fastcgi-state.dot
diff --git a/doc/outdated/fastcgi-state.txt b/doc/fastcgi-state.txt
index a05d2c2..9e76a6f 100644
--- a/doc/outdated/fastcgi-state.txt
+++ b/doc/fastcgi-state.txt
@@ -11,13 +11,13 @@ Module: fastcgi
:Revision: $Revision: 1.1 $
:abstract:
- This is a short summary of the state-engine which is driving the FastCGI
+ This is a short summary of the state-engine which is driving the FastCGI
module. It describes the basic concepts and the way the different parts
of the module are connected.
-
+
.. meta::
:keywords: lighttpd, state-engine, fastcgi
-
+
.. contents:: Table of Contents
Description
@@ -27,7 +27,7 @@ States
------
The state-engine is currently made of 6 states which are walk-through on
-the way each connection.
+the way each connection.
:init:
prepare fastcgi-connection
@@ -41,7 +41,7 @@ the way each connection.
read fastcgi-response from network and push it to the write-queue
:close:
terminate the connection
-
+
.. image:: fastcgi-state.png
Delays
diff --git a/doc/fastcgi.txt b/doc/fastcgi.txt
new file mode 100644
index 0000000..a9ab948
--- /dev/null
+++ b/doc/fastcgi.txt
@@ -0,0 +1,637 @@
+=====================
+the FastCGI Interface
+=====================
+
+-------------------
+Module: mod_fastcgi
+-------------------
+
+:Author: Jan Kneschke
+:Date: $Date: 2004/11/03 22:26:05 $
+:Revision: $Revision: 1.3 $
+
+:abstract:
+ The FastCGI interface is the fastest and most secure way
+ to interface external process-handlers like Perl, PHP and
+ your self-written applications.
+
+.. meta::
+ :keywords: lighttpd, FastCGI
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+lighttpd provides an interface to a external programs that
+support the FastCGI interface. The FastCGI Interface is
+defined by http://www.fastcgi.com/ and is a
+platform-independent and server independent interface between
+a web-application and a webserver.
+
+This means that FastCGI programs that run with the Apache
+Webserver will run seamlessly with lighttpd and vice versa.
+
+
+FastCGI
+-------
+
+FastCGI is removes a lot of the limitations of CGI programs.
+CGI programs have the problem that they have to be restarted
+by the webserver for every request which leads to really bad
+performance values.
+
+FastCGI removes this limitation by keeping the process running
+and handling the requests by this always running process. This
+removes the time used for the fork() and the overall startup
+and cleanup time which is necessary to create and destroy a
+process.
+
+While CGI programs communicate to the server over pipes,
+FastCGI processes use Unix-Domain-Sockets or TCP/IP to talk
+with the webserver. This gives you the second advantage over
+simple CGI programs: FastCGI don't have to run on the Webserver
+itself but everywhere in the network.
+
+lighttpd takes it a little bit further by providing a internal
+FastCGI load-balancer which can be used to balance the load
+over multiple FastCGI Servers. In contrast to other solutions
+only the FastCGI process has to be on the cluster and not the
+whole webserver. That gives the FastCGI process more resources
+than a e.g. load-balancer+apache+mod_php solution.
+
+If you compare FastCGI against a apache+mod_php solution you
+should note that FastCGI provides additional security as the
+FastCGI process can be run under different permissions that
+the webserver and can also live a chroot which might be
+different than the one the webserver is running in.
+
+Options
+=======
+
+lighttpd provides the FastCGI support via the fastcgi-module
+(mod_fastcgi) which provides 2 options in the config-file:
+
+fastcgi.debug
+ a value between 0 and 65535 to set the debug-level in the
+ FastCGI module. Currently only 0 and 1 are used. Use 1 to
+ enable some debug output, 0 to disable it.
+
+fastcgi.server
+ tell the module where to send FastCGI requests to. Every
+ file-extension can have it own handler. Load-Balancing is
+ done by specifying multiple handles for the same extension.
+
+ structure of fastcgi.server section: ::
+
+ ( <extension> =>
+ (
+ ( "host" => <string> ,
+ "port" => <integer> ,
+ "socket" => <string>, # either socket
+ # or host+port
+ "bin-path" => <string>, # OPTIONAL
+ "bin-environment" => <array>, # OPTIONAL
+ "bin-copy-environment" => <array>, # OPTIONAL
+ "mode" => <string>, # OPTIONAL
+ "docroot" => <string> , # OPTIONAL if "mode"
+ # is not "authorizer"
+ "check-local" => <string>, # OPTIONAL
+ "min-procs" => <integer>, # OPTIONAL
+ "max-procs" => <integer>, # OPTIONAL
+ "max-load-per-proc" => <integer>, # OPTIONAL
+ "idle-timeout" => <integer>, # OPTIONAL
+ "broken-scriptfilename" => <boolean>, # OPTIONAL
+ "disable-time" => <integer>, # optional
+ "allow-x-send-file" => <boolean> # optional
+ ),
+ ( "host" => ...
+ )
+ )
+ )
+
+ :<extension>: is the file-extension or prefix
+ (if started with "/")
+ :"host": is hostname/ip of the FastCGI process
+ :"port": is tcp-port on the "host" used by the FastCGI
+ process
+ :"bin-path": path to the local FastCGI binary which should be
+ started if no local FastCGI is running
+ :"socket": path to the unix-domain socket
+ :"mode": is the FastCGI protocol mode.
+ Default is "responder", also "authorizer"
+ mode is implemented.
+ :"docroot": is optional and is the docroot on the remote
+ host for default "responder" mode. For
+ "authorizer" mode it is MANDATORY and it points
+ to docroot for authorized requests. For security
+ reasons it is recommended to keep this docroot
+ outside of server.document-root tree.
+ :"check-local": is optional and may be "enable" (default) or
+ "disable". If enabled the server first check
+ for a file in local server.document-root tree
+ and return 404 (Not Found) if no such file.
+ If disabled, the server forward request to
+ FastCGI interface without this check.
+ :"broken-scriptfilename": breaks SCRIPT_FILENAME in a wat that
+ PHP can extract PATH_INFO from it (default: disabled)
+ :"disable-time": time to wait before a disabled backend is checked
+ again
+ :"allow-x-send-file": controls if X-LIGHTTPD-send-file headers
+ are allowed
+
+ If bin-path is set:
+
+ :"min-procs": sets the minium processes to start
+ :"max-procs": the upper limit of the processess to start
+ :"max-load-per-proc": maximum number of waiting processes on
+ average per process before a new process is
+ spawned
+ :"idle-timeout": number of seconds before a unused process
+ gets terminated
+ :"bin-environment": put an entry into the environment of
+ the started process
+ :"bin-copy-environement": clean up the environment and copy
+ only the specified entries into the fresh
+ environment of the spawn process
+
+
+Examples
+--------
+
+ Multiple extensions for the same host ::
+
+ fastcgi.server = ( ".php" =>
+ ( "grisu" =>
+ (
+ "host" => "127.0.0.1",
+ "port" => 1026,
+ "bin-path" => "/usr/local/bin/php"
+ )
+ ),
+ ".php4" =>
+ ( "grisu" =>
+ (
+ "host" => "127.0.0.1",
+ "port" => 1026
+ )
+ )
+ )
+
+ Example with prefix: ::
+
+ fastcgi.server = ( "/remote_scripts/" =>
+ ( "fcg" =>
+ (
+ "host" => "192.168.0.3",
+ "port" => 9000,
+ "check-local" => "disable",
+ "docroot" => "/" # remote server may use
+ # it's own docroot
+ )
+ )
+ )
+
+ The request `http://my.host.com/remote_scripts/test.cgi` will
+ be forwarded to fastcgi server at 192.168.0.3 and the value
+ "/remote_scripts/test.cgi" will be used for the SCRIPT_NAME
+ variable. Remote server may prepend it with its own
+ document root. The handling of index files si also the
+ resposibility of remote server for this case.
+
+ In the case that the prefix is not terminated with a slash
+ the prefix will be handled as file and /test.cgi would become
+ a PATH_INFO instead of part of SCRIPT_NAME.
+
+
+ Example for "authorizer" mode: ::
+
+ fastcgi.server = ( "/remote_scripts/" =>
+ ( "auth" =>
+ (
+ "host" => "10.0.0.2",
+ "port" => 9000,
+ "docroot" => "/path_to_private_docs",
+ "mode" => "authorizer"
+ )
+ )
+ )
+
+ Note that if "docroot" is specified then its value will be
+ used in DOCUMENT_ROOT and SCRIPT_FILENAME variables passed
+ to FastCGI server.
+
+Load-Balancing
+==============
+
+The FastCGI plugin provides automaticly a load-balancing between
+multiple FastCGI servers. ::
+
+ fastcgi.server = ( ".php" =>
+ ( "server1" =>
+ ( "host" => "10.0.0.3",
+ "port" => 1030 ),
+ "server2" =>
+ ( "host" => "10.0.0.3",
+ "port" => 1030 )
+ )
+ )
+
+
+
+
+To understand how the load-balancing works you can enable the
+fastcgi.debug option and will get a similar output as here: ::
+
+ proc: 127.0.0.1 1031 1 1 1 31454
+ proc: 127.0.0.1 1028 1 1 1 31442
+ proc: 127.0.0.1 1030 1 1 1 31449
+ proc: 127.0.0.1 1029 1 1 2 31447
+ proc: 127.0.0.1 1026 1 1 2 31438
+ got proc: 34 31454
+ release proc: 40 31438
+ proc: 127.0.0.1 1026 1 1 1 31438
+ proc: 127.0.0.1 1028 1 1 1 31442
+ proc: 127.0.0.1 1030 1 1 1 31449
+ proc: 127.0.0.1 1031 1 1 2 31454
+ proc: 127.0.0.1 1029 1 1 2 31447
+
+Even if this for multiple FastCGI children on the local machine
+the following explaination is valid for remote connections too.
+
+The output shows:
+
+- IP, port, unix-socket (is empty here)
+- is-local, state (0 - unset, 1 - running, ... )
+- active connections (load)
+- PID
+
+As you can see the list is always sorted by the load field.
+
+When ever a new connection is requested, the first entry (the one
+with the lowest load) is selected, the load is increase (got proc: ...)
+and the list is sorted again.
+
+If a FastCGI request is done or the connection is drop, the load on the
+FastCGI proc decreases and the list is sorted again (release proc: ...)
+
+This behaviour is very light-weight in code and still very efficient
+as it keeps the fastcgi-servers equally loaded even if they have different
+CPUs.
+
+Adaptive Process Spawning
+=========================
+
+.. note:: This feature is disabled in 1.3.14 again. min-procs is
+ ignored in that release
+
+Starting with 1.3.8 lighttpd can spawn processes on demand if
+a bin-path is specified and the FastCGI process runs locally.
+
+If you want to have a least one FastCGI process running and
+more of the number of requests increases you can use min-procs
+and max-procs.
+
+A new process is spawned as soon as the average number of
+requests waiting to be handle by a single process increases the
+max-load-per-proc setting.
+
+The idle-timeout specifies how long a fastcgi-process should wait
+for a new request before it kills itself.
+
+Example
+-------
+::
+
+ fastcgi.server = ( ".php" => ( "localhost" =>
+ ( "socket" => "/tmp/php.socket",
+ "bin-path" => "/usr/local/bin/php",
+ "min-procs" => 1,
+ "max-procs" => 32,
+ "max-load-per-proc" => 4,
+ "idle-timeout" => 20 )
+ ) )
+
+Disabling Adaptive Spawning
+---------------------------
+
+Adaptive Spawning is a quite new feature and it might misbehave
+for your setup. There are several ways to control how the spawing
+is done:
+
+1. ``"max-load-per-proc" => 1``
+ if that works for you, great.
+
+2. If not set ``min-procs == max-procs``.
+
+3. For PHP you can also use: ::
+
+ $ PHP_FCGI_CHILDREN=384 ./lighttpd -f ./lighttpd.conf
+
+ fastcgi.server = ( ".php" => ( "localhost" =>
+ ( "socket" => "/tmp/php.socket",
+ "bin-path" => "/usr/local/bin/php",
+ "min-procs" => 1,
+ "max-procs" => 1,
+ "max-load-per-proc" => 4,
+ "idle-timeout" => 20 )
+ ) )
+
+ It will create one socket and let's PHP create the 384 processes itself.
+
+4. If you don't want lighttpd to manage the fastcgi processes, remove the
+ bin-path and use spawn-fcgi to spawn them itself.
+
+
+FastCGI and Programming Languages
+=================================
+
+Preparing PHP as a FastCGI program
+----------------------------------
+
+One of the most important application that has a FastCGI
+interface is php which can be downloaded from
+http://www.php.net/ . You have to recompile the php from
+source to enable the FastCGI interface as it is normally
+not enabled by default in the distributions.
+
+If you already have a working installation of PHP on a
+webserver execute a small script which just contains ::
+
+ <?php phpinfo(); ?>
+
+and search for the line in that contains the configure call.
+You can use it as the base for the compilation.
+
+You have to remove all occurences of `--with-apxs`, `--with-apxs2`
+and the like which would build PHP with Apache support. Add the
+next three switches to compile PHP with FastCGI support::
+
+ $ ./configure \
+ --enable-fastcgi \
+ --enable-force-cgi-redirect \
+ ...
+
+After compilation and installation check that your PHP
+binary contains FastCGI support by calling: ::
+
+ $ php -v
+ PHP 4.3.3RC2-dev (cgi-fcgi) (built: Oct 19 2003 23:19:17)
+
+The important part is the (cgi-fcgi).
+
+
+Starting a FastCGI-PHP
+----------------------
+
+Starting with version 1.3.6 lighttpd can spawn the FastCGI
+processes locally itself if necessary: ::
+
+ fastcgi.server = ( ".php" =>
+ ( "localhost" =>
+ ( "socket" => "/tmp/php-fastcgi.socket",
+ "bin-path" => "/usr/local/bin/php"
+ )
+ )
+ )
+
+PHP provides 2 special environment variables which control the number of
+spawned workes under the control of a single watching process
+(PHP_FCGI_CHILDREN) and the number of requests what a single worker
+handles before it kills itself. ::
+
+ fastcgi.server = ( ".php" =>
+ ( "localhost" =>
+ ( "socket" => "/tmp/php-fastcgi.socket",
+ "bin-path" => "/usr/local/bin/php",
+ "bin-environment" => (
+ "PHP_FCGI_CHILDREN" => "16",
+ "PHP_FCGI_MAX_REQUESTS" => "10000"
+ )
+ )
+ )
+ )
+
+To increase the security of the started process you should only pass
+the necessary environment variables to the FastCGI process. ::
+
+ fastcgi.server = ( ".php" =>
+ ( "localhost" =>
+ ( "socket" => "/tmp/php-fastcgi.socket",
+ "bin-path" => "/usr/local/bin/php",
+ "bin-environment" => (
+ "PHP_FCGI_CHILDREN" => "16",
+ "PHP_FCGI_MAX_REQUESTS" => "10000"
+ ),
+ "bin-copy-environment" => (
+ "PATH", "SHELL", "USER"
+ )
+ )
+ )
+ )
+
+Configuring PHP
+---------------
+
+If you want to use PATH_INFO and PHP_SELF in you PHP scripts you have to
+configure php and lighttpd. The php.ini needs the option: ::
+
+ cgi.fix_pathinfo = 1
+
+and the option ``broken-scriptfilename`` in your fastcgi.server config: ::
+
+ fastcgi.server = ( ".php" =>
+ ( "localhost" =>
+ ( "socket" => "/tmp/php-fastcgi.socket",
+ "bin-path" => "/usr/local/bin/php",
+ "bin-environment" => (
+ "PHP_FCGI_CHILDREN" => "16",
+ "PHP_FCGI_MAX_REQUESTS" => "10000"
+ ),
+ "bin-copy-environment" => (
+ "PATH", "SHELL", "USER"
+ ),
+ "broken-scriptfilename" => "enable"
+ )
+ )
+ )
+
+Why this ? the ``cgi.fix_pathinfo = 0`` would give you a working ``PATH_INFO``
+but no ``PHP_SELF``. If you enable it, it turns around. To fix the
+``PATH_INFO`` `--enable-discard-path` needs a SCRIPT_FILENAME which is against the CGI spec, a
+broken-scriptfilename. With ``cgi.fix_pathinfo = 1`` in php.ini and
+``broken-scriptfilename => "enable"`` you get both.
+
+
+External Spawning
+-----------------
+
+Spawning FastCGI processes directly in the webserver has some
+disadvantages like
+
+- FastCGI process can only run locally
+- has the same permissions as the webserver
+- has the same base-dir as the webserver
+
+As soon as you are using a seperate FastCGI Server to
+take off some load from the webserver you have to control
+the FastCGI process by a external program like spawn-fcgi.
+
+spawn-fcgi is used to start a FastCGI process in its own
+environment and set the user-id, group-id and change to
+another root-directory (chroot).
+
+For convenience a wrapper script should be used which takes
+care of all the necessary option. Such a script in included
+in the lighttpd distribution and is call spawn-php.sh.
+
+The script has a set of config variables you should take
+a look at: ::
+
+ ## ABSOLUTE path to the spawn-fcgi binary
+ SPAWNFCGI="/usr/local/sbin/spawn-fcgi"
+
+ ## ABSOLUTE path to the PHP binary
+ FCGIPROGRAM="/usr/local/bin/php"
+
+ ## bind to tcp-port on localhost
+ FCGIPORT="1026"
+
+ ## bind to unix domain socket
+ # FCGISOCKET="/tmp/php.sock"
+
+ ## number of PHP childs to spawn
+ PHP_FCGI_CHILDREN=10
+
+ ## number of request server by a single php-process until
+ ## is will be restarted
+ PHP_FCGI_MAX_REQUESTS=1000
+
+ ## IP adresses where PHP should access server connections
+ ## from
+ FCGI_WEB_SERVER_ADDRS="127.0.0.1,192.168.0.1"
+
+ # allowed environment variables sperated by spaces
+ ALLOWED_ENV="ORACLE_HOME PATH USER"
+
+ ## if this script is run as root switch to the following user
+ USERID=wwwrun
+ GROUPID=wwwrun
+
+If you have set the variables to values that fit to your
+setup you can start it by calling: ::
+
+ $ spawn-php.sh
+ spawn-fcgi.c.136: child spawned successfully: PID: 6925
+
+If you get "child spawned successfully: PID:" the php
+processes could be started successfully. You should see them
+in your processlist: ::
+
+ $ ps ax | grep php
+ 6925 ? S 0:00 /usr/local/bin/php
+ 6928 ? S 0:00 /usr/local/bin/php
+ ...
+
+The number of processes should be PHP_FCGI_CHILDREN + 1.
+Here the process 6925 is the master of the slaves which
+handle the work in parallel. Number of parallel workers can
+be set by PHP_FCGI_CHILDREN. A worker dies automaticly of
+handling PHP_FCGI_MAX_REQUESTS requests as PHP might have
+memory leaks.
+
+If you start the script as user root php processes will be
+running as the user USERID and group GROUPID to drop the
+root permissions. Otherwise the php processes will run as
+the user you started script as.
+
+As the script might be started from a unknown stage or even
+directly from the command-line it cleans the environment
+before starting the processes. ALLOWED_ENV contains all
+the external environement variables that should be available
+to the php-process.
+
+
+
+
+Perl
+----
+
+For Perl you have to install the FCGI module from CPAN.
+
+TCL
+---
+
+For TCL ...
+
+
+
+Skeleton for remote authorizer
+==============================
+
+The basic functionality of authorizer is as follows (see
+http://www.fastcgi.com/devkit/doc/fcgi-spec.html, 6.3 for
+details). ::
+
+ #include <fcgi_stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+ int main () {
+ char* p;
+
+ while (FCGI_Accept() >= 0) {
+ /* wait for fastcgi authorizer request */
+
+ printf("Content-type: text/html\r\n");
+
+ if ((p = getenv("QUERY_STRING")) == NULL) ||
+ <QUERY_STRING is unauthorized>)
+ printf("Status: 403 Forbidden\r\n\r\n");
+
+ else printf("\r\n");
+ /* default Status is 200 - allow access */
+ }
+
+ return 0;
+ }
+
+It is possible to use any other variables provided by
+FastCGI interface for authorization check. Here is only an
+example.
+
+
+Troubleshooting
+===============
+
+fastcgi.debug should be enabled for troubleshooting.
+
+If you get: ::
+
+ (fcgi.c.274) connect delayed: 8
+ (fcgi.c.289) connect succeeded: 8
+ (fcgi.c.745) unexpected end-of-file (perhaps the fastcgi
+ process died): 8
+
+the fastcgi process accepted the connection but closed it
+right away. This happens if FCGI_WEB_SERVER_ADDRS doesn't
+include the host where you are connection from.
+
+If you get ::
+
+ (fcgi.c.274) connect delayed: 7
+ (fcgi.c.1107) error: unexpected close of fastcgi connection
+ for /peterp/seite1.php (no fastcgi process on host/port ?)
+ (fcgi.c.1015) emergency exit: fastcgi: connection-fd: 5
+ fcgi-fd: 7
+
+the fastcgi process is not running on the host/port you are
+connection to. Check your configuration.
+
+If you get ::
+
+ (fcgi.c.274) connect delayed: 7
+ (fcgi.c.289) connect succeeded: 7
+
+everything is fine. The connect() call just was delayed a
+little bit and is completly normal.
+
diff --git a/doc/outdated/features.txt b/doc/features.txt
index f45fe08..b588546 100644
--- a/doc/outdated/features.txt
+++ b/doc/features.txt
@@ -7,12 +7,12 @@ progress report
:Revision: $Revision: 1.2 $
:abstract:
- This document tries to track the requested features and
+ This document tries to track the requested features and
the release when they have been implemented.
-
+
.. meta::
:keywords: lighttpd, features
-
+
.. contents:: Table of Contents
Description
@@ -29,55 +29,55 @@ It is used to see what is still missing and what is already done. ::
> considering installing and testing the latest version. From a
> quick glance, it seems to support most/all of the features of
> Premium thttpd and Zeus.
-
+
If you think it compares to Zeus, then you've obviously never used Zeus.
-
+
lighttpd is currently the only non-blocking open source web server to
support FastCGI responders and that's worthwhile.
-
+
The documentation is lacking. Comments in the configuration file do not
make up for a complete manual.
-
+
Constantly improving. ::
-
- The configuration syntax is overly complex, like Apache. There is no .htaccess
+
+ The configuration syntax is overly complex, like Apache. There no .htaccess
support.
.htaccess support is not planed yet. ::
There is only one server. You cannot have a separate configuration for each
- virtual server. This would seem to be especially problematic when doing
+ virtual server. This would seem to be especially problamatic when doing
SSL.
Works since 1.3.0. ::
-
+
There is no SSI support. Zeus has full recursive SSI support. Output from
a FastCGI program can get run through the SSI interpreter. SSI can also do
virtual includes recursively.
-
+
SSI works since 1.2.4. ::
-
+
Request logging is not configurable. Zeus supports fully configurable
access logging, plus a binary version of CLF that save space.
-
+
1.2.6 adds Apache-like logfile config. ::
-
+
Access control only allows authentication via username and password. There
is no way to allow or deny based in IP address.
-
+
planed for 1.3.x ::
-
+
The request rewriting appears to only allow regex substitutions. Zeus has a
simple, yet powerful, request rewrite language.
+
-
-
+
There is no support for FastCGI authorizers. These are very useful for high
traffic sites that require complex authentication schemes or that store
authorization information in a central database.
-
+
since 1.1.9. ::
-
+
There is no bandwidth throttling support. Zeus does bandwidth throttling
correctly (i.e. unlike past versions of thttpd) and can throttle on a
per-subserver (thttpd-style virtual hosts) basis.
@@ -88,29 +88,29 @@ since 1.3.8. ::
modification of web server behavior. While it isn't strictly necessary for
an open source web server, it nice to have a documented, consistent API,
rather than having to manually patch the server.
-
+
If someone requests it it might be implemented. ::
-
+
There is no web based interface. Zeus has a complete web based interface
for everything, including a powerful feature of configuring multiple virtual
servers at once.
-
+
That is something that should be a special feature of Zeus. :) ::
-
+
There is no support for mapping certain URLs to specific filesystem paths.
-
+
since 1.2.6 ::
-
+
There is no referring checking. This is incredibly important to prevent
hotlinking of bandwidth intensive media types (images, movies, etc.).
-
+
we have something better: mod_secdownload. And if someone wants referer
checking we have a condition in the config for it since 1.2.9 ::
-
+
Zeus has a lot of features that lighttpd doesn't have, but I only mentioned
the ones I care about and use.
-
- --
+
+ --
David Phillips <david@acz.org>
http://david.acz.org/
diff --git a/doc/initscripts/Makefile.am b/doc/initscripts/Makefile.am
deleted file mode 100644
index dfed858..0000000
--- a/doc/initscripts/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST=rc.lighttpd rc.lighttpd.redhat sysconfig.lighttpd
diff --git a/doc/initscripts/Makefile.in b/doc/initscripts/Makefile.in
deleted file mode 100644
index af8b522..0000000
--- a/doc/initscripts/Makefile.in
+++ /dev/null
@@ -1,401 +0,0 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = doc/initscripts
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-SOURCES =
-DIST_SOURCES =
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ATTR_LIB = @ATTR_LIB@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BZ_LIB = @BZ_LIB@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CRYPT_LIB = @CRYPT_LIB@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FAM_CFLAGS = @FAM_CFLAGS@
-FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
-GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LBER_LIB = @LBER_LIB@
-LD = @LD@
-LDAP_LIB = @LDAP_LIB@
-LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LUA_CFLAGS = @LUA_CFLAGS@
-LUA_LIBS = @LUA_LIBS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
-MYSQL_CONFIG = @MYSQL_CONFIG@
-MYSQL_INCLUDE = @MYSQL_INCLUDE@
-MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PCRECONFIG = @PCRECONFIG@
-PCRE_LIB = @PCRE_LIB@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SENDFILE_LIB = @SENDFILE_LIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SQLITE_CFLAGS = @SQLITE_CFLAGS@
-SQLITE_LIBS = @SQLITE_LIBS@
-SSL_LIB = @SSL_LIB@
-STRIP = @STRIP@
-U = @U@
-UUID_LIBS = @UUID_LIBS@
-VERSION = @VERSION@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-EXTRA_DIST = rc.lighttpd rc.lighttpd.redhat sysconfig.lighttpd
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/initscripts/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign doc/initscripts/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-tags: TAGS
-TAGS:
-
-ctags: CTAGS
-CTAGS:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- distclean distclean-generic distclean-libtool distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/doc/lighttpd.1 b/doc/lighttpd.1
new file mode 100644
index 0000000..308ed96
--- /dev/null
+++ b/doc/lighttpd.1
@@ -0,0 +1,18 @@
+.TH LIGHTTPD 1 2003-12-21
+.SH NAME
+lighttpd - a fast, secure and flexible webserver
+.SH SYNOPSIS
+lighttpd -D -f <configfile>
+.SH DESCRIPTION
+.SH FILES
+/etc/lighttpd/lighttpd.conf
+.SH CONFORMING TO
+HTTP/1.0
+HTTP/1.0
+HTTP-Authentification - Basic, Digest
+FastCGI
+CGI/1.1
+.SH SEE ALSO
+spawn-fcgi(1)
+.SH AUTHOR
+jan@kneschke.de
diff --git a/doc/lighttpd.8 b/doc/lighttpd.8
deleted file mode 100644
index a5954ed..0000000
--- a/doc/lighttpd.8
+++ /dev/null
@@ -1,70 +0,0 @@
-.TH LIGHTTPD "8" "2009-03-07" "" ""
-.
-.SH NAME
-lighttpd \- a fast, secure and flexible web server
-.
-.SH SYNOPSIS
-\fBlighttpd\fP [\fB\-ptDvVh\fP] \fB\-f\fP \fIconfigfile\fP [\fB\-m\fP \fImoduledir\fP]
-.
-.SH DESCRIPTION
-\fBlighttpd\fP (pronounced 'lighty') is an advanced HTTP daemon that aims
-to be secure, fast, compliant and very flexible. It has been optimized for
-high performance. Its feature set includes, but is not limited to, FastCGI,
-CGI, basic and digest HTTP authentication, output compression, URL rewriting.
-.PP
-This manual page only lists the command line arguments. For details
-on how to configure \fBlighttpd\fP and its modules see the files in the
-doc-directory.
-.
-.SH OPTIONS
-The following options are supported:
-.TP 8
-\fB\-f\ \fP \fIconfigfile\fP
-Load configuration file \fIconfigfile\fP.
-.TP 8
-\fB\-m\ \fP \fImoduledir\fP
-Use
-\fImoduledir\fP
-as the directory that contains modules, instead of the default.
-.TP 8
-\fB\-p\fP
-Print the parsed configuration file in its internal form and exit.
-.TP 8
-\fB\-t\fP
-Test the configuration file for syntax errors and exit.
-.TP 8
-\fB\-D\fP
-Do not daemonize (go into background). The default is to daemonize.
-.TP 8
-\fB\-v\fP
-Show version and exit.
-.TP 8
-\fB\-V\fP
-Show compile-time features and exit.
-.TP 8
-\fB\-h\fP
-Show a brief help message and exit.
-.
-.SH FILES
-.TP 8
-/etc/lighttpd/lighttpd.conf
-The standard location for the configuration file.
-.TP 8
-/var/run/lighttpd.pid
-The standard location for the PID of the running \fBlighttpd\fP process.
-.
-.SH SEE ALSO
-Online Documentation: http://wiki.lighttpd.net/
-.PP
-spawn-fcgi(1)
-.PP
-\fIHypertext Transfer Protocol -- HTTP/1.1\fP, RFC 2616.
-.PP
-\fIHTTP Authentication: Basic and Digest Access Authentication\fP, RFC 2617.
-.PP
-\fIThe Common Gateway Interface Version 1.1\fP, RFC 3875.
-.PP
-\fIThe FastCGI specification\fP.
-.
-.SH AUTHOR
-Jan Kneschke <jan@kneschke.de>
diff --git a/doc/lighttpd.conf b/doc/lighttpd.conf
new file mode 100644
index 0000000..0601841
--- /dev/null
+++ b/doc/lighttpd.conf
@@ -0,0 +1,321 @@
+# lighttpd configuration file
+#
+# use a it as base for lighttpd 1.0.0 and above
+#
+# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $
+
+############ Options you really have to take care of ####################
+
+## modules to load
+# at least mod_access and mod_accesslog should be loaded
+# all other module should only be loaded if really neccesary
+# - saves some time
+# - saves memory
+server.modules = (
+# "mod_rewrite",
+# "mod_redirect",
+# "mod_alias",
+ "mod_access",
+# "mod_cml",
+# "mod_trigger_b4_dl",
+# "mod_auth",
+# "mod_status",
+# "mod_setenv",
+# "mod_fastcgi",
+# "mod_proxy",
+# "mod_simple_vhost",
+# "mod_evhost",
+# "mod_userdir",
+# "mod_cgi",
+# "mod_compress",
+# "mod_ssi",
+# "mod_usertrack",
+# "mod_expire",
+# "mod_secdownload",
+# "mod_rrdtool",
+ "mod_accesslog" )
+
+## a static document-root, for virtual-hosting take look at the
+## server.virtual-* options
+server.document-root = "/www/pages/"
+
+## where to send error-messages to
+server.errorlog = "/www/logs/lighttpd.error.log"
+
+# files to check for if .../ is requested
+index-file.names = ( "index.php", "index.html",
+ "index.htm", "default.htm" )
+
+## set the event-handler (read the performance section in the manual)
+# server.event-handler = "freebsd-kqueue" # needed on OS X
+
+# mimetype mapping
+mimetype.assign = (
+ ".pdf" => "application/pdf",
+ ".sig" => "application/pgp-signature",
+ ".spl" => "application/futuresplash",
+ ".class" => "application/octet-stream",
+ ".ps" => "application/postscript",
+ ".torrent" => "application/x-bittorrent",
+ ".dvi" => "application/x-dvi",
+ ".gz" => "application/x-gzip",
+ ".pac" => "application/x-ns-proxy-autoconfig",
+ ".swf" => "application/x-shockwave-flash",
+ ".tar.gz" => "application/x-tgz",
+ ".tgz" => "application/x-tgz",
+ ".tar" => "application/x-tar",
+ ".zip" => "application/zip",
+ ".mp3" => "audio/mpeg",
+ ".m3u" => "audio/x-mpegurl",
+ ".wma" => "audio/x-ms-wma",
+ ".wax" => "audio/x-ms-wax",
+ ".ogg" => "application/ogg",
+ ".wav" => "audio/x-wav",
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".xbm" => "image/x-xbitmap",
+ ".xpm" => "image/x-xpixmap",
+ ".xwd" => "image/x-xwindowdump",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".asc" => "text/plain",
+ ".c" => "text/plain",
+ ".cpp" => "text/plain",
+ ".log" => "text/plain",
+ ".conf" => "text/plain",
+ ".text" => "text/plain",
+ ".txt" => "text/plain",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml",
+ ".mpeg" => "video/mpeg",
+ ".mpg" => "video/mpeg",
+ ".mov" => "video/quicktime",
+ ".qt" => "video/quicktime",
+ ".avi" => "video/x-msvideo",
+ ".asf" => "video/x-ms-asf",
+ ".asx" => "video/x-ms-asf",
+ ".wmv" => "video/x-ms-wmv",
+ ".bz2" => "application/x-bzip",
+ ".tbz" => "application/x-bzip-compressed-tar",
+ ".tar.bz2" => "application/x-bzip-compressed-tar"
+ )
+
+# Use the "Content-Type" extended attribute to obtain mime type if possible
+#mimetype.use-xattr = "enable"
+
+
+## send a different Server: header
+## be nice and keep it at lighttpd
+# server.tag = "lighttpd"
+
+#### accesslog module
+accesslog.filename = "/www/logs/access.log"
+
+## deny access the file-extensions
+#
+# ~ is for backupfiles from vi, emacs, joe, ...
+# .inc is often used for code includes which should in general not be part
+# of the document-root
+url.access-deny = ( "~", ".inc" )
+
+$HTTP["url"] =~ "\.pdf$" {
+ server.range-requests = "disable"
+}
+
+##
+# which extensions should not be handle via static-file transfer
+#
+# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
+static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
+
+######### Options that are good to be but not neccesary to be changed #######
+
+## bind to port (default: 80)
+#server.port = 81
+
+## bind to localhost (default: all interfaces)
+#server.bind = "grisu.home.kneschke.de"
+
+## error-handler for status 404
+#server.error-handler-404 = "/error-handler.html"
+#server.error-handler-404 = "/error-handler.php"
+
+## to help the rc.scripts
+#server.pid-file = "/var/run/lighttpd.pid"
+
+
+###### virtual hosts
+##
+## If you want name-based virtual hosting add the next three settings and load
+## mod_simple_vhost
+##
+## document-root =
+## virtual-server-root + virtual-server-default-host + virtual-server-docroot
+## or
+## virtual-server-root + http-host + virtual-server-docroot
+##
+#simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
+#simple-vhost.default-host = "grisu.home.kneschke.de"
+#simple-vhost.document-root = "/pages/"
+
+
+##
+## Format: <errorfile-prefix><status-code>.html
+## -> ..../status-404.html for 'File not found'
+#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-"
+
+## virtual directory listings
+#dir-listing.activate = "enable"
+
+## enable debugging
+#debug.log-request-header = "enable"
+#debug.log-response-header = "enable"
+#debug.log-request-handling = "enable"
+#debug.log-file-not-found = "enable"
+
+### only root can use these options
+#
+# chroot() to directory (default: no chroot() )
+#server.chroot = "/"
+
+## change uid to <uid> (default: don't care)
+#server.username = "wwwrun"
+
+## change uid to <uid> (default: don't care)
+#server.groupname = "wwwrun"
+
+#### compress module
+#compress.cache-dir = "/tmp/lighttpd/cache/compress/"
+#compress.filetype = ("text/plain", "text/html")
+
+#### proxy module
+## read proxy.txt for more info
+#proxy.server = ( ".php" =>
+# ( "localhost" =>
+# (
+# "host" => "192.168.0.101",
+# "port" => 80
+# )
+# )
+# )
+
+#### fastcgi module
+## read fastcgi.txt for more info
+#fastcgi.server = ( ".php" =>
+# ( "localhost" =>
+# (
+# "socket" => "/tmp/php-fastcgi.socket",
+# "bin-path" => "/usr/local/bin/php"
+# )
+# )
+# )
+
+#### CGI module
+#cgi.assign = ( ".pl" => "/usr/bin/perl",
+# ".cgi" => "/usr/bin/perl" )
+#
+
+#### SSL engine
+#ssl.engine = "enable"
+#ssl.pemfile = "server.pem"
+
+#### status module
+#status.status-url = "/server-status"
+#status.config-url = "/server-config"
+
+#### auth module
+## read authentication.txt for more info
+#auth.backend = "plain"
+#auth.backend.plain.userfile = "lighttpd.user"
+#auth.backend.plain.groupfile = "lighttpd.group"
+
+#auth.backend.ldap.hostname = "localhost"
+#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
+#auth.backend.ldap.filter = "(uid=$)"
+
+#auth.require = ( "/server-status" =>
+# (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "user=jan"
+# ),
+# "/server-info" =>
+# (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "valid-user"
+# )
+# )
+
+#### url handling modules (rewrite, redirect, access)
+#url.rewrite = ( "^/$" => "/server-status" )
+#url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
+#### both rewrite/redirect support back reference to regex conditional using %n
+#$HTTP["host"] =~ "^www\.(.*)" {
+# url.redirect = ( "^/(.*)" => "http://%1/$1" )
+#}
+
+#
+# define a pattern for the host url finding
+# %% => % sign
+# %0 => domain name + tld
+# %1 => tld
+# %2 => domain name without tld
+# %3 => subdomain 1 name
+# %4 => subdomain 2 name
+#
+#evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
+
+#### expire module
+#expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
+
+#### ssi
+#ssi.extension = ( ".shtml" )
+
+#### rrdtool
+#rrdtool.binary = "/usr/bin/rrdtool"
+#rrdtool.db-name = "/var/www/lighttpd.rrd"
+
+#### setenv
+#setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
+#setenv.add-response-header = ( "X-Secret-Message" => "42" )
+
+## for mod_trigger_b4_dl
+# trigger-before-download.gdbm-filename = "/home/weigon/testbase/trigger.db"
+# trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" )
+# trigger-before-download.trigger-url = "^/trigger/"
+# trigger-before-download.download-url = "^/download/"
+# trigger-before-download.deny-url = "http://127.0.0.1/index.html"
+# trigger-before-download.trigger-timeout = 10
+
+## for mod_cml
+## don't forget to add index.cml to server.indexfiles
+# cml.extension = ".cml"
+# cml.memcache-hosts = ( "127.0.0.1:11211" )
+
+#### variable usage:
+## variable name without "." is auto prefixed by "var." and becomes "var.bar"
+#bar = 1
+#var.mystring = "foo"
+
+## integer add
+#bar += 1
+## string concat, with integer cast as string, result: "www.foo1.com"
+#server.name = "www." + mystring + var.bar + ".com"
+## array merge
+#index-file.names = (foo + ".php") + index-file.names
+#index-file.names += (foo + ".php")
+
+#### include
+#include /etc/lighttpd/lighttpd-inc.conf
+## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
+#include "lighttpd-inc.conf"
+
+#### include_shell
+#include_shell "echo var.a=1"
+## the above is same as:
+#var.a=1
diff --git a/doc/lighttpd.user b/doc/lighttpd.user
new file mode 100644
index 0000000..727e9c3
--- /dev/null
+++ b/doc/lighttpd.user
@@ -0,0 +1 @@
+dummy:test123
diff --git a/doc/outdated/mysqlvhost.txt b/doc/mysqlvhost.txt
index 9a869a1..93a08dc 100644
--- a/doc/outdated/mysqlvhost.txt
+++ b/doc/mysqlvhost.txt
@@ -1,5 +1,6 @@
+
====================
-MySQL-based vhosting
+MySQL based vhosting
====================
-----------------------
@@ -11,20 +12,20 @@ Module: mod_mysql_vhost
:Revision: $Revision: 1.1 $
:abstract:
- This module provides virtual hosts (vhosts) based on a MySQL table
-
+ This module provides virtual hosts (vhosts) based on a MySQL table
+
.. meta::
:keywords: lighttpd, mysql, vhost
-
+
.. contents:: Table of Contents
Description
===========
-With MySQL-based vhosting you can store the path to a given host's
-document root in a MySQL database.
+With MySQL based vhosting you can put the information where to look for a
+document-root of a given host into a MySQL database.
-.. note:: Keep in mind that only one vhost module should be active at a time.
+.. note:: Keep in mind that only one vhost-module should be active at a time.
Don't mix mod_simple_vhost with mod_mysql_vhost.
Options
@@ -37,8 +38,8 @@ Example: ::
mysql-vhost.pass = "secret"
mysql-vhost.sock = "/var/mysql.lighttpd.sock"
mysql-vhost.sql = "SELECT docroot FROM domains WHERE domain='?'"
-
-
+
+
MySQL setup: ::
GRANT SELECT ON lighttpd.* TO lighttpd@localhost IDENTIFIED BY 'secret';
diff --git a/doc/outdated/Makefile.am b/doc/outdated/Makefile.am
deleted file mode 100644
index 861a6fd..0000000
--- a/doc/outdated/Makefile.am
+++ /dev/null
@@ -1,96 +0,0 @@
-DOCS=accesslog.txt \
-authentication.txt \
-cgi.txt \
-compress.txt \
-configuration.txt \
-extforward.txt \
-fastcgi-state.txt \
-fastcgi.txt \
-features.txt \
-performance.txt \
-plugins.txt \
-proxy.txt \
-redirect.txt \
-rewrite.txt \
-secdownload.txt \
-security.txt \
-simple-vhost.txt \
-skeleton.txt \
-ssi.txt \
-ssl.txt \
-state.txt \
-rrdtool.txt \
-alias.txt \
-userdir.txt \
-mysqlvhost.txt \
-access.txt \
-traffic-shaping.txt \
-setenv.txt \
-status.txt \
-scgi.txt \
-cml.txt \
-trigger_b4_dl.txt \
-webdav.txt \
-expire.txt \
-dirlisting.txt \
-evhost.txt \
-magnet.txt
-
-HTMLDOCS=accesslog.html \
- authentication.html \
- cgi.html \
- compress.html \
- configuration.html \
- extforward.html \
- fastcgi-state.html \
- fastcgi.html \
- features.html \
- performance.html \
- plugins.html \
- proxy.html \
- redirect.html \
- rewrite.html \
- secdownload.html \
- security.html \
- simple-vhost.html \
- skeleton.html \
- ssi.html \
- ssl.html \
- state.html \
- rrdtool.html \
- alias.html \
- userdir.html \
- mysqlvhost.html \
- access.html \
- traffic-shaping.html \
- setenv.html \
- status.html \
- scgi.html \
- cml.html \
- trigger_b4_dl.html \
- webdav.html \
- expire.html \
- dirlisting.html \
- evhost.html \
- magnet.html
-
-EXTRA_DIST= \
- state.dot fastcgi-state.dot \
- $(DOCS)
-
-.txt.html:
- rst2html $^ > $@
-
-
-html-local: $(HTMLDOCS)
-
-#%.ps.gz: %.ps
-# gzip $^
-
-#%.ps: %.dot
-# dot -Tps -o $@ $^
-
-clean-local:
- rm -f *.html
-
-
diff --git a/doc/outdated/Makefile.in b/doc/outdated/Makefile.in
deleted file mode 100644
index 1f56f68..0000000
--- a/doc/outdated/Makefile.in
+++ /dev/null
@@ -1,496 +0,0 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = doc/outdated
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-SOURCES =
-DIST_SOURCES =
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ATTR_LIB = @ATTR_LIB@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BZ_LIB = @BZ_LIB@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CRYPT_LIB = @CRYPT_LIB@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FAM_CFLAGS = @FAM_CFLAGS@
-FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
-GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LBER_LIB = @LBER_LIB@
-LD = @LD@
-LDAP_LIB = @LDAP_LIB@
-LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LUA_CFLAGS = @LUA_CFLAGS@
-LUA_LIBS = @LUA_LIBS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
-MYSQL_CONFIG = @MYSQL_CONFIG@
-MYSQL_INCLUDE = @MYSQL_INCLUDE@
-MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PCRECONFIG = @PCRECONFIG@
-PCRE_LIB = @PCRE_LIB@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SENDFILE_LIB = @SENDFILE_LIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SQLITE_CFLAGS = @SQLITE_CFLAGS@
-SQLITE_LIBS = @SQLITE_LIBS@
-SSL_LIB = @SSL_LIB@
-STRIP = @STRIP@
-U = @U@
-UUID_LIBS = @UUID_LIBS@
-VERSION = @VERSION@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-DOCS = accesslog.txt \
-authentication.txt \
-cgi.txt \
-compress.txt \
-configuration.txt \
-extforward.txt \
-fastcgi-state.txt \
-fastcgi.txt \
-features.txt \
-performance.txt \
-plugins.txt \
-proxy.txt \
-redirect.txt \
-rewrite.txt \
-secdownload.txt \
-security.txt \
-simple-vhost.txt \
-skeleton.txt \
-ssi.txt \
-ssl.txt \
-state.txt \
-rrdtool.txt \
-alias.txt \
-userdir.txt \
-mysqlvhost.txt \
-access.txt \
-traffic-shaping.txt \
-setenv.txt \
-status.txt \
-scgi.txt \
-cml.txt \
-trigger_b4_dl.txt \
-webdav.txt \
-expire.txt \
-dirlisting.txt \
-evhost.txt \
-magnet.txt
-
-HTMLDOCS = accesslog.html \
- authentication.html \
- cgi.html \
- compress.html \
- configuration.html \
- extforward.html \
- fastcgi-state.html \
- fastcgi.html \
- features.html \
- performance.html \
- plugins.html \
- proxy.html \
- redirect.html \
- rewrite.html \
- secdownload.html \
- security.html \
- simple-vhost.html \
- skeleton.html \
- ssi.html \
- ssl.html \
- state.html \
- rrdtool.html \
- alias.html \
- userdir.html \
- mysqlvhost.html \
- access.html \
- traffic-shaping.html \
- setenv.html \
- status.html \
- scgi.html \
- cml.html \
- trigger_b4_dl.html \
- webdav.html \
- expire.html \
- dirlisting.html \
- evhost.html \
- magnet.html
-
-EXTRA_DIST = \
- state.dot fastcgi-state.dot \
- $(DOCS)
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .html .txt
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/outdated/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign doc/outdated/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-tags: TAGS
-TAGS:
-
-ctags: CTAGS
-CTAGS:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-local mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am: html-local
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- clean-local distclean distclean-generic distclean-libtool \
- distdir dvi dvi-am html html-am html-local info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- uninstall uninstall-am
-
-
-.txt.html:
- rst2html $^ > $@
-
-html-local: $(HTMLDOCS)
-
-#%.ps.gz: %.ps
-# gzip $^
-
-#%.ps: %.dot
-# dot -Tps -o $@ $^
-
-clean-local:
- rm -f *.html
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/doc/outdated/compress.txt b/doc/outdated/compress.txt
deleted file mode 100644
index 14fbc2d..0000000
--- a/doc/outdated/compress.txt
+++ /dev/null
@@ -1,192 +0,0 @@
-==================
-Output Compression
-==================
-
---------------------
-Module: mod_compress
---------------------
-
-
-.. meta::
- :keywords: lighttpd, compress
-
-.. contents:: Table of Contents
-
-Description
-===========
-
-Output compression reduces the network load and can improve the overall
-throughput of the webserver. All major http-clients support compression by
-announcing it in the Accept-Encoding header. This is used to negotiate the
-most suitable compression method. We support deflate, gzip and bzip2.
-
-deflate (RFC1950, RFC1951) and gzip (RFC1952) depend on zlib while bzip2
-depends on libbzip2. bzip2 is only supported by lynx and some other console
-text-browsers.
-
-We currently limit to compression support to static files.
-
-Caching
--------
-
-mod_compress can store compressed files on disk to optimize the compression
-on a second request away. As soon as compress.cache-dir is set the files are
-compressed.
-
-(You will need to create the cache directory if it doesn't already exist. The web server will not do this for you. The directory will also need the proper ownership. For Debian/Ubuntu the user and group ids should both be www-data.)
-
-The names of the cache files are made of the filename, the compression method
-and the etag associated to the file.
-
-Cleaning the cache is left to the user. A cron job deleting files older than
-10 days could do it: ::
-
- find /var/www/cache -type f -mtime +10 | xargs -r rm
-
-Limitations
------------
-
-The module limits the compression of files to files smaller than 128 MByte and
-larger than 128 Byte.
-
-The lower limit is set as small files tend to become larger by compressing due
-to the compression headers, the upper limit is set to work sensibly with
-memory and cpu-time.
-
-Directories containing a tilde ('~') are not created automatically (See ticket
-#113). To enable compression for user dirs you have to create the directories
-by hand in the cache directory.
-
-Options
-=======
-
-compress.allowed-encodings
- override default set of allowed encodings
-
- e.g.: ::
-
- compress.allowed-encodings = ("bzip2", "gzip", "deflate")
-
-compress.cache-dir
- name of the directory where compressed content will be cached
-
- e.g.: ::
-
- compress.cache-dir = "/var/www/cache/"
-
- # even better with virt-hosting
- $HTTP["host"] == "docs.example.org" {
- compress.cache-dir = "/var/www/cache/docs.example.org/"
- }
-
- Default: not set, compress the file for every request
-
-compress.filetype
- mimetypes which might get compressed
-
- e.g.: ::
-
- compress.filetype = ("text/plain", "text/html")
-
- Keep in mind that compressed JavaScript and CSS files are broken in some
- browsers. Not setting any filetypes will result in no files being compressed.
-
- NOTE: You have to specify the full mime-type! If you also define a charset, for example, you have to use "text/plain; charset=utf-8" instead of just "text/plain".
-
- Default: not set
-
-compress.max-filesize
- maximum size of the original file to be compressed kBytes.
-
- This is meant to protect the server against DoSing as compressing large
- (let's say 1Gbyte) takes a lot of time and would delay the whole operation
- of the server.
-
- There is a hard upper limit of 128Mbyte.
-
- Default: unlimited (== hard-limit of 128MByte)
-
-Display compressed files
-========================
-
-If you enable mod_compress, and you want to force clients to uncompress and display compressed text files, please force mimetype to nothing.
-Exemple :
-If you want to add headers for uncompress and display diff.gz files , add this section in your conf : ::
-
- $HTTP["url"] =~ "\.diff\.gz" {
- setenv.add-response-header = ( "Content-Encoding" => "gzip" )
- mimetype.assign = ()
- }
-
-
-Compressing Dynamic Content
-===========================
-
-PHP
----
-
-To compress dynamic content with PHP please enable ::
-
- zlib.output_compression = 1
- zlib.output_handler = On
-
-in the php.ini as PHP provides compression support by itself.
-
-mod_compress of lighttpd 1.5 r1992 may not set correct Content-Encoding with php-fcgi. A solution to that problem would be:
-
-1.disable mod_compress when request a php file::
-
- $HTTP["url"] !~ "\.php$" {
- compress.filetype = ("text/plain", "text/html", "text/javascript", "text/css", "text/xml")
- }
-
-2.enable mod_setenv of your lighttpd::
-
- server.modules += ( "mod_setenv" )
-
-3.manually set Content-Encoding::
-
- $HTTP["url"] =~ "\.php$" {
- setenv.add-response-header = ( "Content-Encoding" => "gzip")
- }
-
-
-TurboGears
-----------
-
-To compress dynamic content with TurboGears please enable ::
-
- [/]
- gzip_filter.on = True
- gzip_filter.mime_types = ["application/x-javascript", "text/javascript", "text/html", "text/css", "text/plain"]
-
-in the config/app.cfg file in your TurboGears application. The above lines should already be in the file. You just need to remove the comment symbol in front of the lines to make them active.
-
-Django
-------
-
-To compress dynamic content with Django please enable the GZipMiddleware ::
-
- MIDDLEWARE_CLASSES = (
- 'django.middleware.gzip.GZipMiddleware',
- ...
- )
-
-in the settings.py file in your Django project.
-
-Catalyst
---------
-
-To compress dynamic content with Perl/Catalyst, simply use the Catalyst::Plugin::Compress::Gzip module available on CPAN ::
-
- use Catalyst qw(
- Compress::Gzip
- ...
- );
-
-in your main package (MyApp.pm). Further configuration is not required.
-
-}}}
-
-
-
diff --git a/doc/outdated/dirlisting.txt b/doc/outdated/dirlisting.txt
deleted file mode 100644
index 5dd6873..0000000
--- a/doc/outdated/dirlisting.txt
+++ /dev/null
@@ -1,126 +0,0 @@
-==================
-Directory Listings
-==================
-
-----------------------
-Module: mod_dirlisting
-----------------------
-
-:Author: Jan Kneschke
-:Date: $Date: 2004/11/03 22:26:05 $
-:Revision: $Revision: 1.2 $
-
-:abstract:
- mod_dirlisting generates HTML based directory listings with full CSS
- control
-
-.. meta::
- :keywords: lighttpd, directory listings, dirlisting
-
-.. contents:: Table of Contents
-
-Description
-===========
-
-mod_dirlisting is one of the modules which is loaded by default and don't have to
-be specified on server.modules to work.
-
-A directory listing is generated if a directory is requested and no index-file
-was found in that directory.
-
-To enable directory listings globally: ::
-
- dir-listing.activate = "enable"
-
-If you need it only for a directory, use conditionals: ::
-
- $HTTP["url"] =~ "^/download($|/)" {
- dir-listing.activate = "enable"
- }
-
-You can also use a external generator for directory listings if you use
-mod_indexfile. ::
-
- index-file.names = ( "/dir-generator.php" )
-
-If a directory is requested the dir-generator.php is called instead which can
-take the REQUEST_URI to see which directory was requested.
-
-For large folders this is highly recommend.
-
-Options
-=======
-
-dir-listing.activate
- enables virtual directory listings if a directory is requested no
- index-file was found
-
- Default: disabled
-
-dir-listing.hide-dotfiles
- if enabled, does not list hidden files in directory listings generated
- by the dir-listing option.
-
- Default: enabled
-
-dir-listing.external-css
- path to an external css stylesheet for the directory listing
-
-dir-listing.exclude
- list of regular expressions. Files that match any of the specified regular
- expressions will be excluded from directory listings.
-
-dir-listing.encoding
- set a encoding for the generated directory listing
-
- If you file-system is not using ASCII you have to set the encoding of
- the filenames as they are put into the HTML listing AS IS (with XML
- encoding)
-
- Example: ::
-
- dir-listing.encoding = "utf-8"
-
-dir-listing.show-readme
- shows README.txt after the dirlisting if it exists in the directory
-
- Default: disabled
-
-dir-listing.hide-readme-file
- hides README.txt in the dirlisting
-
- Default: disabled
-
-dir-listing.show-header
- shows HEADER.txt before the dirlisting if it exists in the directory
-
- Default: disabled
-
-dir-listing.hide-header-file
- hides HEADER.txt in the dirlisting
-
- Default: disabled
-
-dir-listing.set-footer
-
- Default: empty, uses server.tag instead
-
-dir-listing.encode-readme
- encodes all control characers, '&', '<', '>' and '\x7f' as &#x**;
-
- Default: enabled
-
-dir-listing.encode-header
- encodes all control characers, '&', '<', '>' and '\x7f' as &#x**;
-
- Default: enabled
-
-dir-listing.auto-layout
- Disable this if you want your own html header and footer; specify
- them in HEADER.txt and README.txt
-
- you have to enable dir-list.show-readme/header for this of course
-
- .external-css and .set-footer will be ignored if this is disabled
-
- Default: enabled
diff --git a/doc/outdated/evhost.txt b/doc/outdated/evhost.txt
deleted file mode 100644
index c69cc72..0000000
--- a/doc/outdated/evhost.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-========================
-Enhanced Virtual-Hosting
-========================
-
-------------------
-Module: mod_evhost
-------------------
-
-:Author: Jan Kneschke
-:Date: $Date: 2004/08/29 09:43:49 $
-:Revision: $Revision: 1.1 $
-
-:abstract:
- virtual hosting
-
-.. meta::
- :keywords: lighttpd, virtual hosting
-
-.. contents:: Table of Contents
-
-Description
-===========
-
-mod_evhost builds the document-root based on a pattern which contains
-wildcards. Those wildcards can represent parts if the submitted hostname
-
-
-::
-
- %% => % sign
- %0 => domain name + tld
- %1 => tld
- %2 => domain name without tld
- %3 => subdomain 1 name
- %4 => subdomain 2 name
- %_ => the complete hostname (without port info)
-
- evhost.path-pattern = "/home/www/servers/%3/pages/"
-
-Options
-=======
-
-evhost.path-pattern
- pattern with wildcards to be replace to build a documentroot
-
-
diff --git a/doc/outdated/extforward.txt b/doc/outdated/extforward.txt
deleted file mode 100644
index 3d0c57c..0000000
--- a/doc/outdated/extforward.txt
+++ /dev/null
@@ -1,105 +0,0 @@
-==============
-mod_extforward
-==============
-
-.. contents::
-
-Overview
-========
-
-Comman Kang <comman.kang at gmail.com> sent me: ::
-
- Hello jan.
-
- I've made something rough but similar to mod_extract_forwarded for
- Apache. This module will extract the client's "real" ip from
- X-Forwarded-For header which is added by squid or other proxies. It might be
- useful for servers behind reverse proxy servers.
-
- However, this module is causing segfault with mod_ssl or
- $HTTP{''socket"} directive, crashing in config_check_cond while patching
- connection , I do not understand architecture of the lighttpd well, does it
- need to call patch_connection in either handle_request_done and
- connection_reset ?
-
-Lionel Elie Mamane <lionel@mamane.lu> improved the patch: ::
-
- I've taken lighttpd-1.4.10-mod_extforward.c from the wiki and I've
- extended it. Here is the result.
-
- Major changes:
-
- - IPv6 support
-
- - Fixed at least one segfault with SERVER['socket']
-
- - Arrange things so that a url.access-deny under scope of a
- HTTP['remoteip'] condition works well :)
-
- I've commented the code in some places, mostly where I wasn't sure
- what was going on, or I didn't see what the original author meant to
- do.
-
-Options
-=======
-
-extforward.forwarder
- Sets trust level of proxy IP's.
-
- Default: empty
-
- Example: ::
-
- extforward.forwarder = ("10.0.0.232" => "trust")
-
- will translate ip addresses coming from 10.0.0.232 to real ip addresses extracted from "X-Forwarded-For" or "Forwarded-For" HTTP request header.
-
-extforward.headers
- Sets headers to search for finding the originl addresses.
-
- Example (for use with a Zeus ZXTM loadbalancer): ::
-
- extforward.headers = ("X-Cluster-Client-Ip")
-
- Default: empty, results in searching for "X-Forwarded-For" and "Forwarded-For"
-
-Note
-=======
-
-The effect of this module is variable on $HTTP["remotip"] directives and other module's remote ip dependent actions.
-Things done by modules before we change the remoteip or after we reset it will match on the proxy's IP.
-Things done in between these two moments will match on the real client's IP.
-The moment things are done by a module depends on in which hook it does things and within the same hook
-on whether they are before/after us in the module loading order
-(order in the server.modules directive in the config file).
-
-Tested behaviours:
-
- mod_access: Will match on the real client.
-
- mod_accesslog:
- In order to see the "real" ip address in access log ,
- you'll have to load mod_extforward after mod_accesslog.
- like this: ::
-
- server.modules = (
- .....
- mod_accesslog,
- mod_extforward
- )
-
-Samples
-=======
-
-Trust proxy 10.0.0.232 and 10.0.0.232 ::
-
- extforward.forwarder = (
- "10.0.0.232" => "trust",
- "10.0.0.233" => "trust",
- )
-
-Trust all proxies (NOT RECOMMENDED!) ::
-
- extforward.forwarder = ( "all" => "trust")
-
-Note that "all" has precedence over specific entries, so "all except" setups will not work.
diff --git a/doc/outdated/fastcgi.txt b/doc/outdated/fastcgi.txt
deleted file mode 100644
index eee5f79..0000000
--- a/doc/outdated/fastcgi.txt
+++ /dev/null
@@ -1,601 +0,0 @@
-=====================
-the FastCGI Interface
-=====================
-
--------------------
-Module: mod_fastcgi
--------------------
-
-:Author: Jan Kneschke
-:Date: $Date: 2004/11/03 22:26:05 $
-:Revision: $Revision: 1.3 $
-
-:abstract:
- The FastCGI interface is the fastest and most secure way
- to interface external process-handlers like Perl, PHP and
- your self-written applications.
-
-.. meta::
- :keywords: lighttpd, FastCGI
-
-.. contents:: Table of Contents
-
-Description
-===========
-
-lighttpd provides an interface to a external programs that
-support the FastCGI interface. The FastCGI Interface is
-defined by http://www.fastcgi.com/ and is a
-platform-independent and server independent interface between
-a web-application and a webserver.
-
-This means that FastCGI programs that run with the Apache
-Webserver will run seamlessly with lighttpd and vice versa.
-
-
-FastCGI
--------
-
-FastCGI is removes a lot of the limitations of CGI programs.
-CGI programs have the problem that they have to be restarted
-by the webserver for every request which leads to really bad
-performance values.
-
-FastCGI removes this limitation by keeping the process running
-and handling the requests by this always running process. This
-removes the time used for the fork() and the overall startup
-and cleanup time which is necessary to create and destroy a
-process.
-
-While CGI programs communicate to the server over pipes,
-FastCGI processes use Unix-Domain-Sockets or TCP/IP to talk
-with the webserver. This gives you the second advantage over
-simple CGI programs: FastCGI don't have to run on the Webserver
-itself but everywhere in the network.
-
-lighttpd takes it a little bit further by providing a internal
-FastCGI load-balancer which can be used to balance the load
-over multiple FastCGI Servers. In contrast to other solutions
-only the FastCGI process has to be on the cluster and not the
-whole webserver. That gives the FastCGI process more resources
-than a e.g. load-balancer+apache+mod_php solution.
-
-If you compare FastCGI against a apache+mod_php solution you
-should note that FastCGI provides additional security as the
-FastCGI process can be run under different permissions that
-the webserver and can also live a chroot which might be
-different than the one the webserver is running in.
-
-Options
-=======
-
-lighttpd provides the FastCGI support via the fastcgi-module
-(mod_fastcgi) which provides 2 options in the config-file:
-
-fastcgi.debug
- a value between 0 and 65535 to set the debug-level in the
- FastCGI module. Currently only 0 and 1 are used. Use 1 to
- enable some debug output, 0 to disable it.
-
-fastcgi.map-extensions
- map multiple extensions to the same fastcgi server
-
- Example: ::
-
- fastcgi.map-extensions = ( ".php3" => ".php" )
-
-fastcgi.server
- tell the module where to send FastCGI requests to. Every
- file-extension can have it own handler. Load-Balancing is
- done by specifying multiple handles for the same extension.
-
- structure of fastcgi.server section: ::
-
- ( <extension> =>
- (
- ( "host" => <string> ,
- "port" => <integer> ,
- "socket" => <string>, # either socket
- # or host+port
- "bin-path" => <string>, # OPTIONAL
- "bin-environment" => <array>, # OPTIONAL
- "bin-copy-environment" => <array>, # OPTIONAL
- "mode" => <string>, # OPTIONAL
- "docroot" => <string> , # OPTIONAL if "mode"
- # is not "authorizer"
- "check-local" => <string>, # OPTIONAL
- "max-procs" => <integer>, # OPTIONAL
- "broken-scriptfilename" => <boolean>, # OPTIONAL
- "disable-time" => <integer>, # optional
- "allow-x-send-file" => <boolean>, # optional
- "kill-signal" => <integer>, # OPTIONAL
- "fix-root-scriptname" => <boolean>,
- # OPTIONAL
- ( "host" => ...
- )
- )
- )
-
- :<extension>: is the file-extension or prefix
- (if started with "/")
- :"host": is hostname/ip of the FastCGI process
- :"port": is tcp-port on the "host" used by the FastCGI
- process
- :"bin-path": path to the local FastCGI binary which should be
- started if no local FastCGI is running
- :"socket": path to the unix-domain socket
- :"mode": is the FastCGI protocol mode.
- Default is "responder", also "authorizer"
- mode is implemented.
- :"docroot": is optional and is the docroot on the remote
- host for default "responder" mode. For
- "authorizer" mode it is MANDATORY and it points
- to docroot for authorized requests. For security
- reasons it is recommended to keep this docroot
- outside of server.document-root tree.
- :"check-local": is optional and may be "enable" (default) or
- "disable". If enabled the server first check
- for a file in local server.document-root tree
- and return 404 (Not Found) if no such file.
- If disabled, the server forward request to
- FastCGI interface without this check.
- :"broken-scriptfilename": breaks SCRIPT_FILENAME in a wat that
- PHP can extract PATH_INFO from it (default: disabled)
- :"disable-time": time to wait before a disabled backend is checked
- again
- :"allow-x-send-file": controls if X-LIGHTTPD-send-file headers
- are allowed
- :"fix-root-scriptname": fix broken path-info split for "/" extension ("prefix")
-
- If bin-path is set:
-
- :"max-procs": the upper limit of the processess to start
- :"bin-environment": put an entry into the environment of
- the started process
- :"bin-copy-environement": clean up the environment and copy
- only the specified entries into the fresh
- environment of the spawn process
- :"kill-signal": signal to terminate the FastCGI process with,
- defauls to SIGTERM
-
-Examples
---------
-
- Multiple extensions for the same host ::
-
- fastcgi.server = ( ".php" =>
- (( "host" => "127.0.0.1",
- "port" => 1026,
- "bin-path" => "/usr/local/bin/php"
- )),
- ".php4" =>
- (( "host" => "127.0.0.1",
- "port" => 1026
- ))
- )
-
- Example with prefix: ::
-
- fastcgi.server = ( "/remote_scripts/" =>
- (( "host" => "192.168.0.3",
- "port" => 9000,
- "check-local" => "disable",
- "docroot" => "/" # remote server may use
- # it's own docroot
- ))
- )
-
- The request `http://my.host.com/remote_scripts/test.cgi` will
- be forwarded to fastcgi server at 192.168.0.3 and the value
- "/remote_scripts/test.cgi" will be used for the SCRIPT_NAME
- variable. Remote server may prepend it with its own
- document root. The handling of index files is also the
- resposibility of remote server for this case.
-
- In the case that the prefix is not terminated with a slash
- the prefix will be handled as file and /test.cgi would become
- a PATH_INFO instead of part of SCRIPT_NAME.
-
-
- Example for "authorizer" mode: ::
-
- fastcgi.server = ( "/remote_scripts/" =>
- (( "host" => "10.0.0.2",
- "port" => 9000,
- "docroot" => "/path_to_private_docs",
- "mode" => "authorizer"
- ))
- )
-
- Note that if "docroot" is specified then its value will be
- used in DOCUMENT_ROOT and SCRIPT_FILENAME variables passed
- to FastCGI server.
-
-Load-Balancing
-==============
-
-The FastCGI plugin provides automaticly a load-balancing between
-multiple FastCGI servers. ::
-
- fastcgi.server = ( ".php" =>
- (( "host" => "10.0.0.2", "port" => 1030 ),
- ( "host" => "10.0.0.3", "port" => 1030 ))
- )
-
-
-To understand how the load-balancing works you can enable the
-fastcgi.debug option and will get a similar output as here: ::
-
- proc: 127.0.0.1 1031 1 1 1 31454
- proc: 127.0.0.1 1028 1 1 1 31442
- proc: 127.0.0.1 1030 1 1 1 31449
- proc: 127.0.0.1 1029 1 1 2 31447
- proc: 127.0.0.1 1026 1 1 2 31438
- got proc: 34 31454
- release proc: 40 31438
- proc: 127.0.0.1 1026 1 1 1 31438
- proc: 127.0.0.1 1028 1 1 1 31442
- proc: 127.0.0.1 1030 1 1 1 31449
- proc: 127.0.0.1 1031 1 1 2 31454
- proc: 127.0.0.1 1029 1 1 2 31447
-
-Even if this for multiple FastCGI children on the local machine
-the following explaination is valid for remote connections too.
-
-The output shows:
-
-- IP, port, unix-socket (is empty here)
-- is-local, state (0 - unset, 1 - running, ... )
-- active connections (load)
-- PID
-
-As you can see the list is always sorted by the load field.
-
-Whenever a new connection is requested, the first entry (the one
-with the lowest load) is selected, the load is increased (got proc: ...)
-and the list is sorted again.
-
-If a FastCGI request is done or the connection is dropped, the load on the
-FastCGI proc decreases and the list is sorted again (release proc: ...)
-
-This behaviour is very light-weight in code and still very efficient
-as it keeps the fastcgi-servers equally loaded even if they have different
-CPUs.
-
-Adaptive Process Spawning
-=========================
-
-.. note:: This feature is disabled in 1.3.14 again. min-procs is
- ignored in that release
-
-Starting with 1.3.8 lighttpd can spawn processes on demand if
-a bin-path is specified and the FastCGI process runs locally.
-
-If you want to have a least one FastCGI process running and
-more of the number of requests increases you can use min-procs
-and max-procs.
-
-A new process is spawned as soon as the average number of
-requests waiting to be handle by a single process increases the
-max-load-per-proc setting.
-
-The idle-timeout specifies how long a fastcgi-process should wait
-for a new request before it kills itself.
-
-Example
--------
-::
-
- fastcgi.server = ( ".php" =>
- (( "socket" => "/tmp/php.socket",
- "bin-path" => "/usr/local/bin/php",
- "min-procs" => 1,
- "max-procs" => 32,
- "max-load-per-proc" => 4,
- "idle-timeout" => 20
- ))
- )
-
-Disabling Adaptive Spawning
----------------------------
-
-Adaptive Spawning is a quite new feature and it might misbehave
-for your setup. There are several ways to control how the spawing
-is done:
-
-1. ``"max-load-per-proc" => 1``
- if that works for you, great.
-
-2. If not set ``min-procs == max-procs``.
-
-3. For PHP you can also use: ::
-
- $ PHP_FCGI_CHILDREN=384 ./lighttpd -f ./lighttpd.conf
-
- fastcgi.server = ( ".php" =>
- (( "socket" => "/tmp/php.socket",
- "bin-path" => "/usr/local/bin/php",
- "min-procs" => 1,
- "max-procs" => 1,
- "max-load-per-proc" => 4,
- "idle-timeout" => 20
- ))
- )
-
- It will create one socket and let's PHP create the 384 processes itself.
-
-4. If you don't want lighttpd to manage the fastcgi processes, remove the
- bin-path and use spawn-fcgi to spawn them itself.
-
-
-FastCGI and Programming Languages
-=================================
-
-Preparing PHP as a FastCGI program
-----------------------------------
-
-One of the most important application that has a FastCGI
-interface is php which can be downloaded from
-http://www.php.net/ . You have to recompile the php from
-source to enable the FastCGI interface as it is normally
-not enabled by default in the distributions.
-
-If you already have a working installation of PHP on a
-webserver execute a small script which just contains ::
-
- <?php phpinfo(); ?>
-
-and search for the line in that contains the configure call.
-You can use it as the base for the compilation.
-
-You have to remove all occurences of `--with-apxs`, `--with-apxs2`
-and the like which would build PHP with Apache support. Add the
-next three switches to compile PHP with FastCGI support::
-
- $ ./configure \
- --enable-fastcgi \
- --enable-force-cgi-redirect \
- ...
-
-After compilation and installation check that your PHP
-binary contains FastCGI support by calling: ::
-
- $ php -v
- PHP 4.3.3RC2-dev (cgi-fcgi) (built: Oct 19 2003 23:19:17)
-
-The important part is the (cgi-fcgi).
-
-
-Starting a FastCGI-PHP
-----------------------
-
-Starting with version 1.3.6 lighttpd can spawn the FastCGI
-processes locally itself if necessary: ::
-
- fastcgi.server = ( ".php" =>
- (( "socket" => "/tmp/php-fastcgi.socket",
- "bin-path" => "/usr/local/bin/php"
- ))
- )
-
-PHP provides 2 special environment variables which control the number of
-spawned workes under the control of a single watching process
-(PHP_FCGI_CHILDREN) and the number of requests what a single worker
-handles before it kills itself. ::
-
- fastcgi.server = ( ".php" =>
- (( "socket" => "/tmp/php-fastcgi.socket",
- "bin-path" => "/usr/local/bin/php",
- "bin-environment" => (
- "PHP_FCGI_CHILDREN" => "16",
- "PHP_FCGI_MAX_REQUESTS" => "10000"
- )
- ))
- )
-
-To increase the security of the started process you should only pass
-the necessary environment variables to the FastCGI process. ::
-
- fastcgi.server = ( ".php" =>
- (( "socket" => "/tmp/php-fastcgi.socket",
- "bin-path" => "/usr/local/bin/php",
- "bin-environment" => (
- "PHP_FCGI_CHILDREN" => "16",
- "PHP_FCGI_MAX_REQUESTS" => "10000" ),
- "bin-copy-environment" => (
- "PATH", "SHELL", "USER" )
- ))
- )
-
-Configuring PHP
----------------
-
-If you want to use PATH_INFO and PHP_SELF in you PHP scripts you have to
-configure php and lighttpd. The php.ini needs the option: ::
-
- cgi.fix_pathinfo = 1
-
-and the option ``broken-scriptfilename`` in your fastcgi.server config: ::
-
- fastcgi.server = ( ".php" =>
- (( "socket" => "/tmp/php-fastcgi.socket",
- "bin-path" => "/usr/local/bin/php",
- "bin-environment" => (
- "PHP_FCGI_CHILDREN" => "16",
- "PHP_FCGI_MAX_REQUESTS" => "10000" ),
- "bin-copy-environment" => (
- "PATH", "SHELL", "USER" ),
- "broken-scriptfilename" => "enable"
- ))
- )
-
-Why this ? the ``cgi.fix_pathinfo = 0`` would give you a working ``PATH_INFO``
-but no ``PHP_SELF``. If you enable it, it turns around. To fix the
-``PATH_INFO`` `--enable-discard-path` needs a SCRIPT_FILENAME which is against the CGI spec, a
-broken-scriptfilename. With ``cgi.fix_pathinfo = 1`` in php.ini and
-``broken-scriptfilename => "enable"`` you get both.
-
-
-External Spawning
------------------
-
-Spawning FastCGI processes directly in the webserver has some
-disadvantages like
-
-- FastCGI process can only run locally
-- has the same permissions as the webserver
-- has the same base-dir as the webserver
-
-As soon as you are using a seperate FastCGI Server to
-take off some load from the webserver you have to control
-the FastCGI process by a external program like spawn-fcgi.
-
-spawn-fcgi is used to start a FastCGI process in its own
-environment and set the user-id, group-id and change to
-another root-directory (chroot).
-
-For convenience a wrapper script should be used which takes
-care of all the necessary option. Such a script in included
-in the lighttpd distribution and is call spawn-php.sh.
-
-The script has a set of config variables you should take
-a look at: ::
-
- ## ABSOLUTE path to the spawn-fcgi binary
- SPAWNFCGI="/usr/local/sbin/spawn-fcgi"
-
- ## ABSOLUTE path to the PHP binary
- FCGIPROGRAM="/usr/local/bin/php"
-
- ## bind to tcp-port on localhost
- FCGIPORT="1026"
-
- ## bind to unix domain socket
- # FCGISOCKET="/tmp/php.sock"
-
- ## number of PHP childs to spawn
- PHP_FCGI_CHILDREN=10
-
- ## number of request server by a single php-process until
- ## is will be restarted
- PHP_FCGI_MAX_REQUESTS=1000
-
- ## IP adresses where PHP should access server connections
- ## from
- FCGI_WEB_SERVER_ADDRS="127.0.0.1,192.168.0.1"
-
- # allowed environment variables sperated by spaces
- ALLOWED_ENV="ORACLE_HOME PATH USER"
-
- ## if this script is run as root switch to the following user
- USERID=wwwrun
- GROUPID=wwwrun
-
-If you have set the variables to values that fit to your
-setup you can start it by calling: ::
-
- $ spawn-php.sh
- spawn-fcgi.c.136: child spawned successfully: PID: 6925
-
-If you get "child spawned successfully: PID:" the php
-processes could be started successfully. You should see them
-in your processlist: ::
-
- $ ps ax | grep php
- 6925 ? S 0:00 /usr/local/bin/php
- 6928 ? S 0:00 /usr/local/bin/php
- ...
-
-The number of processes should be PHP_FCGI_CHILDREN + 1.
-Here the process 6925 is the master of the slaves which
-handle the work in parallel. Number of parallel workers can
-be set by PHP_FCGI_CHILDREN. A worker dies automaticly of
-handling PHP_FCGI_MAX_REQUESTS requests as PHP might have
-memory leaks.
-
-If you start the script as user root php processes will be
-running as the user USERID and group GROUPID to drop the
-root permissions. Otherwise the php processes will run as
-the user you started script as.
-
-As the script might be started from a unknown stage or even
-directly from the command-line it cleans the environment
-before starting the processes. ALLOWED_ENV contains all
-the external environement variables that should be available
-to the php-process.
-
-
-Perl
-----
-
-For Perl you have to install the FCGI module from CPAN.
-
-Skeleton for remote authorizer
-==============================
-
-The basic functionality of authorizer is as follows (see
-http://www.fastcgi.com/devkit/doc/fcgi-spec.html, 6.3 for
-details). ::
-
- #include <fcgi_stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- int main () {
- char* p;
-
- while (FCGI_Accept() >= 0) {
- /* wait for fastcgi authorizer request */
-
- printf("Content-type: text/html\r\n");
-
- if ((p = getenv("QUERY_STRING")) == NULL) ||
- <QUERY_STRING is unauthorized>)
- printf("Status: 403 Forbidden\r\n\r\n");
-
- else printf("\r\n");
- /* default Status is 200 - allow access */
- }
-
- return 0;
- }
-
-It is possible to use any other variables provided by
-FastCGI interface for authorization check. Here is only an
-example.
-
-
-Troubleshooting
-===============
-
-fastcgi.debug should be enabled for troubleshooting.
-
-If you get: ::
-
- (fcgi.c.274) connect delayed: 8
- (fcgi.c.289) connect succeeded: 8
- (fcgi.c.745) unexpected end-of-file (perhaps the fastcgi
- process died): 8
-
-the fastcgi process accepted the connection but closed it
-right away. This happens if FCGI_WEB_SERVER_ADDRS doesn't
-include the host where you are connection from.
-
-If you get ::
-
- (fcgi.c.274) connect delayed: 7
- (fcgi.c.1107) error: unexpected close of fastcgi connection
- for /peterp/seite1.php (no fastcgi process on host/port ?)
- (fcgi.c.1015) emergency exit: fastcgi: connection-fd: 5
- fcgi-fd: 7
-
-the fastcgi process is not running on the host/port you are
-connection to. Check your configuration.
-
-If you get ::
-
- (fcgi.c.274) connect delayed: 7
- (fcgi.c.289) connect succeeded: 7
-
-everything is fine. The connect() call just was delayed a
-little bit and is completly normal.
-
diff --git a/doc/outdated/magnet.txt b/doc/outdated/magnet.txt
deleted file mode 100644
index 0559174..0000000
--- a/doc/outdated/magnet.txt
+++ /dev/null
@@ -1,429 +0,0 @@
-{{{
-#!rst
-==============
-a power-magnet
-==============
-
-------------------
-Module: mod_magnet
-------------------
-
-
-
-.. contents:: Table of Contents
-
-Requirements
-============
-
-:Version: lighttpd 1.4.12 or higher
-:Packages: lua >= 5.1
-
-Overview
-========
-
-mod_magnet is a module to control the request handling in lighty.
-
-.. note::
-
- Keep in mind that the magnet is executed in the core of lighty. EVERY long-running operation is blocking
- ALL connections in the server. You are warned. For time-consuming or blocking scripts use mod_fastcgi and friends.
-
-For performance reasons mod_magnet caches the compiled script. For each script-run the script itself is checked for
-freshness and recompile if neccesary.
-
-
-Installation
-============
-
-mod_magnet needs a lighty which is compiled with the lua-support ( --with-lua). Lua 5.1 or higher are required by
-the module. Use "--with-lua=lua5.1" to install on Debian and friends. ::
-
- server.modules = ( ..., "mod_magnet", ... )
-
-Options
-=======
-
-mod_magnet can attract a request in several stages in the request-handling.
-
-* either at the same level as mod_rewrite, before any parsing of the URL is done
-* or at a later stage, when the doc-root is known and the physical-path is already setup
-
-It depends on the purpose of the script which stage you want to intercept. Usually you want to use
-the 2nd stage where the physical-path which relates to your request is known. At this level you
-can run checks against lighty.env["physical.path"].
-
-::
-
- magnet.attract-raw-url-to = ( ... )
- magnet.attract-physical-path-to = ( ... )
-
-You can define multiple scripts when separated by a semicolon. The scripts are executed in the specified
-order. If one of them a returning a status-code, the following scripts will not be executed.
-
-Tables
-======
-
-Most of the interaction between between mod_magnet and lighty is done through tables. Tables in lua are hashes (Perl), dictionaries (Java), arrays (PHP), ...
-
-Request-Environment
--------------------
-
-Lighttpd has its internal variables which are exported as read/write to the magnet.
-
-If "http://example.org/search.php?q=lighty" is requested this results in a request like ::
-
- GET /search.php?q=lighty HTTP/1.1
- Host: example.org
-
-When you are using ``attract-raw-url-to`` you can access the following variables:
-
-* parts of the request-line
-
- * lighty.env["request.uri"] = "/search.php?q=lighty"
-
-* HTTP request-headers
-
- * lighty.request["Host"] = "example.org"
-
-Later in the request-handling, the URL is splitted, cleaned up and turned into a physical path name:
-
-* parts of the URI
-
- * lighty.env["uri.path"] = "/search.php"
- * lighty.env["uri.path-raw"] = "/search.php"
- * lighty.env["uri.scheme"] = "http"
- * lighty.env["uri.authority"] = "example.org"
- * lighty.env["uri.query"] = "q=lighty"
-
-* filenames, pathnames
-
- * lighty.env["physical.path"] = "/my-docroot/search.php"
- * lighty.env["physical.rel-path"] = "/search.php"
- * lighty.env["physical.doc-root"] = "/my-docroot"
-
-All of them are readable, not all of the are writable (or don't have an effect if you write to them).
-
-As a start, you might want to use those variables for writing: ::
-
- -- 1. simple rewriting is done via the request.uri
- lighty.env["request.uri"] = ...
- return lighty.RESTART_REQUEST
-
- -- 2. changing the physical-path
- lighty.env["physical.path"] = ...
-
- -- 3. changing the query-string
- lighty.env["uri.query"] = ...
-
-Response Headers
-----------------
-
-If you want to set a response header for your request, you can add a field to the lighty.header[] table: ::
-
- lighty.header["Content-Type"] = "text/html"
-
-Sending Content
-===============
-
-You can generate your own content and send it out to the clients. ::
-
- lighty.content = { "<pre>", { filename = "/etc/passwd" }, "</pre>" }
- lighty.header["Content-Type"] = "text/html"
-
- return 200
-
-The lighty.content[] table is executed when the script is finished. The elements of the array are processed left to right and the elements can either be a string or a table. Strings are included AS IS into the output of the request.
-
-* Strings
-
- * are included as is
-
-* Tables
-
- * filename = "<absolute-path>" is required
- * offset = <number> [default: 0]
- * length = <number> [default: size of the file - offset]
-
-Internally lighty will use the sendfile() call to send out the static files at full speed.
-
-Status Codes
-============
-
-You might have seen it already in other examples: In case you are handling the request completly in the magnet you
-can return your own status-codes. Examples are: Redirected, Input Validation, ... ::
-
- if (lighty.env["uri.scheme"] == "http") then
- lighty.header["Location"] = "https://" .. lighty.env["uri.authority"] .. lighty.env["request.uri"]
- return 302
- end
-
-You every number above and equal to 100 is taken as final status code and finishes the request. No other modules are
-executed after this return.
-
-A special return-code is lighty.RESTART_REQUEST (currently equal to 99) which is usually used in combination with
-changing the request.uri in a rewrite. It restarts the splitting of the request-uri again.
-
-If you return nothing (or nil) the request-handling just continues.
-
-Debugging
-=========
-
-To easy debugging we overloaded the print()-function in lua and redirect the output of print() to the error-log. ::
-
- print("Host: " .. lighty.request["Host"])
- print("Request-URI: " .. lighty.env["request.uri"])
-
-
-Examples
-========
-
-Sending text-files as HTML
---------------------------
-
-This is a bit simplistic, but it illustrates the idea: Take a text-file and cover it in a <pre> tag.
-
-Config-file ::
-
- magnet.attract-physical-path-to = server.docroot + "/readme.lua"
-
-readme.lua ::
-
- lighty.content = { "<pre>", { filename = "/README" }, "</pre>" }
- lighty.header["Content-Type"] = "text/html"
-
- return 200
-
-Maintainance pages
-------------------
-
-Your side might be on maintainance from time to time. Instead of shutting down the server confusing all
-users, you can just send a maintainance page.
-
-Config-file ::
-
- magnet.attract-physical-path-to = server.docroot + "/maintainance.lua"
-
-maintainance.lua ::
-
- require "lfs"
-
- if (nil == lfs.attributes(lighty.env["physical.doc-root"] .. "/maintainance.html")) then
- lighty.content = ( lighty.env["physical.doc-root"] .. "/maintainance.html" )
-
- lighty.header["Content-Type"] = "text/html"
-
- return 200
- end
-
-mod_flv_streaming
------------------
-
-Config-file ::
-
- magnet.attract-physical-path-to = server.docroot + "/flv-streaming.lua"
-
-flv-streaming.lua::
-
- if (lighty.env["uri.query"]) then
- -- split the query-string
- get = {}
- for k, v in string.gmatch(lighty.env["uri.query"], "(%w+)=(%w+)") do
- get[k] = v
- end
-
- if (get["start"]) then
- -- missing: check if start is numeric and positive
-
- -- send te FLV header + a seek into the file
- lighty.content = { "FLV\x1\x1\0\0\0\x9\0\0\0\x9",
- { filename = lighty.env["physical.path"], offset = get["start"] } }
- lighty.header["Content-Type"] = "video/x-flv"
-
- return 200
- end
- end
-
-
-selecting a random file from a directory
-----------------------------------------
-
-Say, you want to send a random file (ad-content) from a directory.
-
-To simplify the code and to improve the performance we define:
-
-* all images have the same format (e.g. image/png)
-* all images use increasing numbers starting from 1
-* a special index-file names the highest number
-
-Config ::
-
- server.modules += ( "mod_magnet" )
- magnet.attract-physical-path-to = "random.lua"
-
-random.lua ::
-
- dir = lighty.env["physical.path"]
-
- f = assert(io.open(dir .. "/index", "r"))
- maxndx = f:read("*all")
- f:close()
-
- ndx = math.random(maxndx)
-
- lighty.content = { { filename = dir .. "/" .. ndx }}
- lighty.header["Content-Type"] = "image/png"
-
- return 200
-
-denying illegal character sequences in the URL
-----------------------------------------------
-
-Instead of implementing mod_security, you might just want to apply filters on the content
-and deny special sequences that look like SQL injection.
-
-A common injection is using UNION to extend a query with another SELECT query.
-
-::
-
- if (string.find(lighty.env["request.uri"], "UNION%s")) then
- return 400
- end
-
-Traffic Quotas
---------------
-
-If you only allow your virtual hosts a certain amount for traffic each month and want to
-disable them if the traffic is reached, perhaps this helps: ::
-
- host_blacklist = { ["www.example.org"] = 0 }
-
- if (host_blacklist[lighty.request["Host"]]) then
- return 404
- end
-
-Just add the hosts you want to blacklist into the blacklist table in the shown way.
-
-Complex rewrites
-----------------
-
-If you want to implement caching on your document-root and only want to regenerate
-content if the requested file doesn't exist, you can attract the physical.path: ::
-
- magnet.attract-physical-path-to = ( server.document-root + "/rewrite.lua" )
-
-rewrite.lua ::
-
- require "lfs"
-
- attr = lfs.attributes(lighty.env["physical.path"])
-
- if (not attr) then
- -- we couldn't stat() the file for some reason
- -- let the backend generate it
-
- lighty.env["uri.path"] = "/dispatch.fcgi"
- lighty.env["physical.rel-path"] = lighty.env["uri.path"]
- lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"]
- fi
-
-luafilesystem
-+++++++++++++
-
-We are requiring the lua-module 'lfs' (http://www.keplerproject.org/luafilesystem/).
-
-I had to compile lfs myself for lua-5.1 which required a minor patch as compat-5.1 is not needed::
-
- $ wget http://luaforge.net/frs/download.php/1487/luafilesystem-1.2.tar.gz
- $ wget http://www.lighttpd.net/download/luafilesystem-1.2-lua51.diff
- $ gzip -cd luafilesystem-1.2.tar.gz | tar xf -
- $ cd luafilesystem-1.2
- $ patch -ls -p1 < ../luafilesystem-1.2-lua51.diff
- $ make install
-
-It will install lfs.so into /usr/lib/lua/5.1/ which is where lua expects the extensions on my system.
-
-SuSE and Gentoo are known to have their own lfs packages and don't require a compile.
-
-Usertracking
-------------
-
-... or how to store data globally in the script-context:
-
-Each script has its own script-context. When the script is started it only contains the lua-functions
-and the special lighty.* name-space. If you want to save data between script runs, you can use the global-script
-context:
-
-::
-
- if (nil == _G["usertrack"]) then
- _G["usertrack"] = {}
- end
- if (nil == _G["usertrack"][lighty.request["Cookie"]]) then
- _G["usertrack"][lighty.request["Cookie"]]
- else
- _G["usertrack"][lighty.request["Cookie"]] = _G["usertrack"][lighty.request["Cookie"]] + 1
- end
-
- print _G["usertrack"][lighty.request["Cookie"]]
-
-The global-context is per script. If you update the script without restarting the server, the context will still be maintained.
-
-Counters
---------
-
-mod_status support a global statistics page and mod_magnet allows to add and update values in the status page:
-
-Config ::
-
- status.statistics-url = "/server-counters"
- magnet.attract-raw-url-to = server.docroot + "/counter.lua"
-
-counter.lua ::
-
- lighty.status["core.connections"] = lighty.status["core.connections"] + 1
-
-Result::
-
- core.connections: 7
- fastcgi.backend.php-foo.0.connected: 0
- fastcgi.backend.php-foo.0.died: 0
- fastcgi.backend.php-foo.0.disabled: 0
- fastcgi.backend.php-foo.0.load: 0
- fastcgi.backend.php-foo.0.overloaded: 0
- fastcgi.backend.php-foo.1.connected: 0
- fastcgi.backend.php-foo.1.died: 0
- fastcgi.backend.php-foo.1.disabled: 0
- fastcgi.backend.php-foo.1.load: 0
- fastcgi.backend.php-foo.1.overloaded: 0
- fastcgi.backend.php-foo.load: 0
-
-Porting mod_cml scripts
------------------------
-
-mod_cml got replaced by mod_magnet.
-
-A CACHE_HIT in mod_cml::
-
- output_include = { "file1", "file2" }
-
- return CACHE_HIT
-
-becomes::
-
- content = { { filename = "/path/to/file1" }, { filename = "/path/to/file2"} }
-
- return 200
-
-while a CACHE_MISS like (CML) ::
-
- trigger_handler = "/index.php"
-
- return CACHE_MISS
-
-becomes (magnet) ::
-
- lighty.env["request.uri"] = "/index.php"
-
- return lighty.RESTART_REQUEST
-
-}}}
diff --git a/doc/outdated/performance.txt b/doc/outdated/performance.txt
deleted file mode 100644
index 04d48a1..0000000
--- a/doc/outdated/performance.txt
+++ /dev/null
@@ -1,239 +0,0 @@
-========================
-Performance Improvements
-========================
-
-------------
-Module: core
-------------
-
-:Author: Jan Kneschke
-:Date: $Date: 2004/11/03 22:26:05 $
-:Revision: $Revision: 1.3 $
-
-:abstract:
- handling performance issues in lighttpd
-
-.. meta::
- :keywords: lighttpd, performance
-
-.. contents:: Table of Contents
-
-Description
-===========
-
-Performance Issues
-------------------
-
-lighttpd is optimized into varying directions. The most important direction is
-performance. The operation system has two major facilities to help lighttpd
-a deliver its best performance.
-
-HTTP Keep-Alive
----------------
-
-Disabling keep-alive might help your server if you suffer from a large
-number of open file descriptors.
-
-The defaults for the server are: ::
-
- server.max-keep-alive-requests = 128
- server.max-keep-alive-idle = 30
- server.max-read-idle = 60
- server.max-write-idle = 360
-
-handling 128 keep-alive requests in a row on a single connection, waiting 30 seconds
-before an unused keep-alive connection gets dropped by lighttpd.
-
-If you handle several connections at once under a high load (let's assume 500 connections
-in parallel for 24h) you might run into the out-of-fd problem described below. ::
-
- server.max-keep-alive-requests = 4
- server.max-keep-alive-idle = 4
-
-would release the connections earlier and would free file descriptors without a
-detrimental performance loss.
-
-Disabling keep-alive completely is the last resort if you are still short on file descriptors: ::
-
- server.max-keep-alive-requests = 0
-
-Event Handlers
---------------
-
-The first one is the Event Handler which takes care of notifying the server
-that one of the connections is ready to send or receive. As you can see,
-every OS has at least the select() call which has some limitations.
-
-============ ========== ===============
-OS Method Config Value
-============ ========== ===============
-all select select
-Unix poll poll
-Linux 2.4+ rt-signals linux-rtsig
-Linux 2.6+ epoll linux-sysepoll
-Solaris /dev/poll solaris-devpoll
-FreeBSD, ... kqueue freebsd-kqueue
-============ ========== ===============
-
-
-For more information on this topic take a look at http://www.kegel.com/c10k.html
-
-Configuration
-`````````````
-
-The event handler can be set by specifying the 'Config Value' from above
-in the ``server.event-handler`` variable
-
-e.g.: ::
-
- server.event-handler = "linux-sysepoll"
-
-Network Handlers
-----------------
-
-The basic network interface for all platforms at the syscalls read() and
-write(). Every modern OS provides its own syscall to help network servers
-transfer files as fast as possible.
-
-If you want to send out a file from the webserver, it doesn't make any sense
-to copy the file into the webserver just to write() it back into a socket
-in the next step.
-
-sendfile() minimizes the work in the application and pushes a file directly
-into the network card (ideally).
-
-lighttpd supports all major platform-specific calls:
-
-========== ==========
-OS Method
-========== ==========
-all write
-Unix writev
-Linux 2.4+ sendfile
-Linux 2.6+ sendfile64
-Solaris sendfilev
-FreeBSD sendfile
-========== ==========
-
-The best backend is selected at compile time. In case you want to use
-another backend set: ::
-
- server.network-backend = "writev"
-
-You can find more information about network backend in:
-
- http://blog.lighttpd.net/articles/2005/11/11/optimizing-lighty-for-high-concurrent-large-file-downloads
-
-
-Max Connections
----------------
-
-As lighttpd is a single-threaded server, its main resource limit is the
-number of file descriptors, which is set to 1024 by default (on most systems).
-
-If you are running a high-traffic site you might want to increase this limit
-by setting ::
-
- server.max-fds = 2048
-
-This only works if lighttpd is started as root.
-
-Out-of-fd condition
--------------------
-
-Since file descriptors are used for TCP/IP sockets, files and directories,
-a simple request for a PHP page might result in using 3 file descriptors:
-
-1. the TCP/IP socket to the client
-2. the TCP/IP and Unix domain socket to the FastCGI process
-3. the filehandle to the file in the document root to check if it exists
-
-If lighttpd runs out of file descriptors, it will stop accepting new
-connections for awhile to use the existing file descriptors to handle the
-currently-running requests.
-
-If more than 90% of the file descriptors are used then the handling of new
-connections is disabled. If it drops below 80% again new connections will
-be accepted again.
-
-Under some circumstances you will see ::
-
- ... accept() failed: Too many open files
-
-in the error log. This tells you there were too many new requests at once
-and lighttpd could not disable the incoming connections soon enough. The
-connection was dropped and the client received an error message like 'connection
-failed'. This is very rare and might only occur in test setups.
-
-Increasing the ``server.max-fds`` limit will reduce the probability of this
-problem.
-
-stat() cache
-============
-
-A stat(2) can be expensive; caching it saves time and context switches.
-
-Instead of using stat() every time to check for the existence of a file
-you can stat() it once and monitor the directory the file is in for
-modifications. As long as the directory doesn't change, the files in it
-must all still be the same.
-
-With the help of FAM or gamin you can use kernel events to assure that
-your stat cache is up to date. ::
-
- server.stat-cache-engine = "fam" # either fam, simple or disabled
-
-
-Platform-Specific Notes
-=======================
-
-Linux
------
-
-For Linux 2.4.x you should think about compiling lighttpd with the option
-``--disable-lfs`` to disable the support for files larger than 2GB. lighttpd will
-fall back to the ``writev() + mmap()`` network calls which is ok, but not as
-fast as possible but support files larger than 2GB.
-
-Disabling the TCP options reduces the overhead of each TCP packet and might
-help to get the last few percent of performance out of the server. Be aware that
-disabling these options most likely decreases performance for high-latency and lossy
-links.
-
-- net.ipv4.tcp_sack = 0
-- net.ipv4.tcp_timestamps = 0
-
-Increasing the TCP send and receive buffers will increase the performance a
-lot if (and only if) you have a lot of large files to send.
-
-- net.ipv4.tcp_wmem = 4096 65536 524288
-- net.core.wmem_max = 1048576
-
-If you have a lot of large file uploads, increasing the receive buffers will help.
-
-- net.ipv4.tcp_rmem = 4096 87380 524288
-- net.core.rmem_max = 1048576
-
-Keep in mind that every TCP connection uses the configured amount of memory for socket
-buffers. If you've got many connections this can quickly drain the available memory.
-
-See http://www.acc.umu.se/~maswan/linux-netperf.txt for more information on these parameters.
-
-FreeBSD
--------
-
-On FreeBSD you might gain some performance by enabling accept filters. Just
-compile your kernel with: ::
-
- options ACCEPT_FILTER_HTTP
-
-For more ideas about tuning FreeBSD read: tuning(7)
-
-Reducing the recvspace should always be ok if the server only handles HTTP
-requests without large uploads. Increasing the sendspace would reduce the
-system load if you have a lot of large files to be sent, but keep in mind that
-you have to provide the memory in the kernel for each connection. 1024 * 64KB
-would mean 64MB of kernel RAM. Keep this in mind.
-
-- net.inet.tcp.recvspace = 4096
-
diff --git a/doc/outdated/status.txt b/doc/outdated/status.txt
deleted file mode 100644
index 5312176..0000000
--- a/doc/outdated/status.txt
+++ /dev/null
@@ -1,111 +0,0 @@
-=============
-Server Status
-=============
-
-------------------
-Module: mod_status
-------------------
-
-:Author: Jan Kneschke
-:Date: $Date: 2004/11/03 22:26:05 $
-:Revision: $Revision: 1.2 $
-
-:abstract:
- mod_status displays the server's status and configuration
-
-.. meta::
- :keywords: lighttpd, server status
-
-.. contents:: Table of Contents
-
-Description
-===========
-
-The server status module generates the status overview of the webserver. The
-information covers:
-
-- uptime
-- average throughput
-- current throughput
-- active connections and their state
-
-
-We need to load the module first. ::
-
- server.modules = ( ..., "mod_ssi", ... )
-
-By default the status page is disabled to hide internal information from
-unauthorized users. ::
-
- status.status-url = "/server-status"
-
-If you want to open the status page just for users from the local network
-cover it in a conditional. ::
-
- $HTTP["remoteip"] == "10.0.0.0/8" {
- status.status-url = "/server-status"
- }
-
-Or require authorization: ::
-
- auth.require = ( "/server-status" =>
- ( "realm" ... ) )
-
-
-Please note that when using the server.max-worker directive, the stati of the
-childs are not combined yet, so you're going to see different stats with each
-request.
-
-
-Output Format
--------------
-
-By default a nice looking HTML page is generated. If you append ?auto to the
-status-url you can get a text version which is simpler to parse. ::
-
- Total Accesses: 1234
- Total kBytes: 1043
- Uptime: 1234
- BusyServers: 123
-
-Total Accesses is the number of handled requests, kBytes the overall outgoing
-traffic, Uptime the uptime in seconds and BusyServers the number of currently
-active connections.
-
-The naming is kept compatible to Apache even if we have another concept and
-don't start new servers for each connection.
-
-
-Options
-=======
-
-status.status-url
-
- relative URL which is used to retrieve the status-page
-
- Default: unset
-
- Example: status.status-url = "/server-status"
-
-status.enable-sort
-
- add JavaScript which allows client-side sorting for the connection overview
-
- Default: enable
-
-status.config-url
-
- relative URL for the config page which displays the loaded modules
-
- Default: unset
-
- Example: status.config-url = "/server-config"
-
-status.statistics-url
-
- relative URL for a plain-text page containing the internal statistics
-
- Default: unset
-
- Example: status.statistics-url = "/server-statistics"
-
diff --git a/doc/performance.txt b/doc/performance.txt
new file mode 100644
index 0000000..06a767b
--- /dev/null
+++ b/doc/performance.txt
@@ -0,0 +1,226 @@
+========================
+Performance Improvements
+========================
+
+------------
+Module: core
+------------
+
+:Author: Jan Kneschke
+:Date: $Date: 2004/11/03 22:26:05 $
+:Revision: $Revision: 1.3 $
+
+:abstract:
+ handling performance issues in lighttpd
+
+.. meta::
+ :keywords: lighttpd, performance
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+Performance Issues
+------------------
+
+lighttpd is optimized into various directions. The most important is
+performance. The operation system has two major facalities to help lighttpd
+a deliver it best performance.
+
+HTTP Keep-Alive
+---------------
+
+Disabling keep-alive might help your server if you suffer from a large
+number of open file-descriptors.
+
+The defaults fo the server is: ::
+
+ server.max-keep-alive-requests = 128
+ server.max-keep-alive-idle = 30
+ server.max-read-idle = 60
+ server.max-write-idle = 360
+
+handling 128 keep-alive requests in a row on a single connection, waiting 30 seconds
+before a unused keep-alive connection get dropped by lighttpd.
+
+If you handle several connections at once under a high load (let's assume 500 connections
+in parallel for 24h) you might run into the out-of-fd problem described below. ::
+
+ server.max-keep-alive-requests = 4
+ server.max-keep-alive-idle = 4
+
+would release the connections earlier and would free file-descriptors without a to large
+performance loss.
+
+Disabling keep-alive completly is the last choice if you are still short in filedescriptors: ::
+
+ server.max-keep-alive-requests = 0
+
+Event Handlers
+--------------
+
+The first one is the Event Handler which cares about notifying the server
+that one of the connections is ready to send or to recieve. As you can see
+every OS has at least the select() call which has some limitations.
+
+============ ========== ===============
+OS Method Config-Value
+============ ========== ===============
+all select select
+Unix poll poll
+Linux 2.4+ rt-signals linux-rtsig
+Linux 2.6+ epoll linux-sysepoll
+Solaris /dev/poll solaris-devpoll
+FreeBSD, ... kqueue freebsd-kqueue
+============ ========== ===============
+
+
+For more infomation in this topic take a look at http://www.kegel.com/c10k.html
+
+Configuration
+`````````````
+
+The event-handler can be set by specifying the 'Config-Value' from above
+in the ``server.event-handler`` variable
+
+e.g.: ::
+
+ server.event-handler = "linux-sysepoll"
+
+Network Handlers
+----------------
+
+The basic network interface for all platforms at the syscalls read() and
+write(). Each modern OS provides its own syscall to help network servers
+to transfer files as fast as possible.
+
+If you want to send out a file from the webserver it does make any sense
+to copy the file into the webserver just to write() it back into a socket
+in the next step.
+
+sendfile() minimizes the work in the application and pushes a file directly
+into the network card (idealy spoken).
+
+lighttpd supports all major platform specific calls:
+
+========== ==========
+OS Method
+========== ==========
+all write
+Unix writev
+Linux 2.4+ sendfile
+Linux 2.6+ sendfile64
+Solaris sendfilev
+FreeBSD sendfile
+========== ==========
+
+They are selected automaticly on compile-time. If you have problems check
+./src/network_backend.h and disable the corresponding USE\_... define.
+
+Max Connections
+---------------
+
+As lighttpd is a single-threaded server its main resource limit is the
+number of file-descriptors which is (on most systems) set to 1024 by default.
+
+If you are running a high-traffic site you might want to increase this limit
+by setting ::
+
+ server.max-fds = 2048
+
+This only works if lighttpd is started as root.
+
+Out-of-fd condition
+-------------------
+
+As fds are used for tcp/ip sockets, files, directories, ... a simple request
+for a PHP page might result in using 3 fds:
+
+1. the TCP/IP socket to the client
+2. the TCP/IP and Unix domain socket to the FastCGI process
+3. the filehandle to the file in the document-root to check if it is really existing
+
+If lighttpd runs out of file-descriptors it will stop accepting new
+connections for while to use the currently available fds (file-descriptors)
+to handle the currently running requests.
+
+If more than 90% of the fds are used the the handling of new connections is
+disabled, if it dropes below 80% again new connection will accepted again.
+
+Under some circumstances you will see ::
+
+ ... accept() failed: Too many open files
+
+in the error-log. This tells you the you had to many new requests at once
+and lighttpd could not disable the incomming connections soon enough. The
+connection is drop and the client will get a error-message like 'connection
+failed'. This is very rare and might only occur in test-setups.
+
+Increasing the ``server.max-fds`` limit will reduce the propability of this
+problem.
+
+stat() cache
+============
+
+A stat(2) can be expensive, caching it saves time adn context-switches..
+
+Instead of stat() for the existence of the file you can stat() it once and
+monitor the directory the file is in for modifications. As long as the
+directiry doesn't change, the files in it are all the same.
+
+With the help of FAM or gamin you can use kernel events to assure that
+your stat-cache is up to date. ::
+
+ server.stat-cache-engine = "fam" # either fam, simple or disabled
+
+
+Plattform Specific Notes
+========================
+
+Linux
+-----
+
+For Linux 2.4.x should should think about compiling lighttpd with the option
+``--disable-lfs`` to disable the support for files larger than 2Gb. lighttpd will
+fall back to the ``writev() + mmap()`` network calls which is ok, but not as
+fast as possible but support files larger than 2Gb.
+
+Disabling the TCP options reduces the overhead of each TCP packet and might
+help to get the last few percent of performance out of the server.
+
+- net.ipv4.tcp_sack = 0
+- net.ipv4.tcp_timestamps = 0
+
+Increasing the TCP send and receive buffers will increase the performance a
+lot if (and only if) you have a lot large files to send.
+
+- net.ipv4.tcp_wmem = 4096 65536 524288
+- net.core.wmem_max = 1048576
+
+If you have a lot large file uploads increasing the receive buffers will help.
+
+- net.ipv4.tcp_rmem = 4096 87380 524288
+- net.core.rmem_max = 1048576
+
+Keep in mind that the buffers have to multiplied by server.max-fds and be
+allocated in the Kernel area. Be carefull with that.
+
+FreeBSD
+-------
+
+On FreeBSD you might gain some performance by enabling accept-filters. Just
+compile your kernel with: ::
+
+ options ACCEPT_FILTER_HTTP
+
+For more ideas in tuning FreeBSD read: tuning(7)
+
+Reducing the recvspace should always be ok if the server only handles HTTP
+requests without large uploads. Increasing the sendspace would reduce the
+system-load if you have a lot large files to be sent, but keep in mind that
+you to provide the memory in kernel for each connection. 1024 * 64k would mean
+64M of kernel-ram. Keep this in mind.
+
+- net.inet.tcp.recvspace = 4096
+
diff --git a/doc/outdated/plugins.txt b/doc/plugins.txt
index 22dee40..8a755fe 100644
--- a/doc/outdated/plugins.txt
+++ b/doc/plugins.txt
@@ -11,25 +11,25 @@ Module: core
:Revision: $Revision: 1.1 $
:abstract:
- The plugin interface is an integral part of lighttpd which
- provides a flexible way to add specific functionality to lighttpd.
-
+ The plugin interface is the integral part of lighttpd provide
+ a flexible way to add specific functionality to lighttpd.
+
.. meta::
:keywords: lighttpd, plugins
-
+
.. contents:: Table of Contents
Description
===========
-Plugins allow you to enhance the functionality of lighttpd without
-changing the core of the webserver. They can be loaded at startup time
-and can change virtually any aspect of the behaviour of the webserver.
+Plugins allow you to enhance to functionality of lighttpd without
+changing the core of the webserver. They can be loaded at startup-time
+and can change hardly any aspect of the behaviour of the webserver.
Plugin Entry Points
-------------------
-lighttpd has 16 hooks which are used in different states of the
+lighttpd has 16 hooks which are used in different states of the
execution of the request:
Serverwide hooks
@@ -49,21 +49,21 @@ Serverwide hooks
Connectionwide hooks
````````````````````
-Most of these hooks are called in ``http_response_prepare()`` after some
-fields in the connection structure are set.
+Most of these hooks are call in ``http_response_prepare()`` after some
+field in the connection structure are set.
:handle_uri_raw_:
called after uri.path_raw, uri.authority and uri.scheme are set
:handle_uri_clean_:
- called after uri.path (a clean URI without .. and %20) is set
+ called after uri.path (a clean uri without .. and %20) is set
:handle_docroot_:
- called at the end of the logical path handle to get a docroot
+ called at the end of the logical path handle to get a docroot
:handle_subrequest_start_:
- called if the physical path is set up and checked
+ called if the physical path is setup and checked
:handle_subrequest_:
called at the end of ``http_response_prepare()``
:handle_physical_path_:
- called after the physical path is created and no other handler is
+ called after the physical path is created and no other handler is
found for this request
:handle_request_done_:
called when the request is done
@@ -73,7 +73,7 @@ fields in the connection structure are set.
called after the connection_state_engine is left again and plugin
internal handles have to be called
:connection_reset_:
- called if the connection structure has to be cleaned up
+ called if the connection structure has to be cleaned up
Plugin Interface
@@ -82,14 +82,14 @@ Plugin Interface
\*_plugin_init
``````````````
-Every plugin has a uniquely-named function which is called after the
-plugin is loaded. It is used to set up the ``plugin`` structure with
-some useful data:
+Every plugin has a uniquely named function which is called after the
+plugin is loaded. It is used to setup the ``plugin`` structure with
+some usefull data:
- name of the plugin ``name``
-- all hooks
+- all hooks
-The field ``data`` and ``lib`` should not be touched in the init function.
+The field ``data`` and ``lib`` should not be touched in the init function.
``lib`` is the library handler from dlopen and ``data`` will be the storage
of the internal plugin data.
@@ -99,9 +99,9 @@ of the internal plugin data.
init
````
-The first real call of a plugin function is the init hook which is used
-to set up the internal plugin data. The internal plugin is assigned the
-``data`` field mentioned in the \*_plugin_init description.
+The first real call of a plugin function is the init-hook which is used
+to set up the internal plugin data. The internal plugin is assigned the
+``data`` field mentioned in the \*_plugin_init description.
:returns:
a pointer to the internal plugin data.
@@ -109,7 +109,7 @@ to set up the internal plugin data. The internal plugin is assigned the
cleanup
```````
-The cleanup hook is called just before the plugin is unloaded. It is meant
+The cleanup hook is called just before the plugin is unloaded. It is meant
to free all buffers allocated in ``init`` or somewhere else in the plugin
which are still not freed and to close all handles which were opened and
are not closed yet.
@@ -120,16 +120,16 @@ are not closed yet.
set_defaults
````````````
-set_defaults is your entry point into the configfile parsing. It should
+set_defaults is your entry point into the configfile parsing. It should
pass a list of options to ``config_insert_values`` and check if
-the plugin configuration is valid. If it is not valid yet, it should
-set useful defaults or return with HANDLER_ERROR and an error message.
+the plugin configuration is valid. If it is not valid yet, it should
+set usefull defaults or return with HANDLER_ERROR and an error message.
:returns:
HANDLER_GO_ON if ok
-
- HANDLER_ERROR will terminate lighttpd
-
+
+ HANDLER_ERROR will terminated lighttpd
+
connection_reset
````````````````
@@ -137,9 +137,9 @@ called at the end of each request
:returns:
HANDLER_GO_ON if ok
-
+
HANDLER_ERROR on error
-
+
handle_trigger
``````````````
@@ -147,9 +147,9 @@ called once a second
:returns:
HANDLER_GO_ON if ok
-
+
HANDLER_ERROR on error
-
+
handle_sighup
`````````````
@@ -157,9 +157,9 @@ called if a SIGHUP is received (cycling logfiles, ...)
:returns:
HANDLER_GO_ON if ok
-
+
HANDLER_ERROR on error
-
+
handle_uri_raw
``````````````
@@ -168,9 +168,9 @@ called after uri_raw is set
:returns:
HANDLER_GO_ON if ok
HANDLER_FINISHED if the final output is prepared
-
+
HANDLER_ERROR on error
-
+
handle_uri_clean
````````````````
@@ -179,9 +179,9 @@ called after uri.path is set
:returns:
HANDLER_GO_ON if ok
HANDLER_FINISHED if the final output is prepared
-
+
HANDLER_ERROR on error
-
+
handle_docroot
``````````````
@@ -190,9 +190,9 @@ called when a docroot is needed
:returns:
HANDLER_GO_ON if ok
HANDLER_FINISHED if the final output is prepared
-
+
HANDLER_ERROR on error
-
+
handle_subrequest_start
```````````````````````
@@ -201,9 +201,9 @@ called after physical.path is set
:returns:
HANDLER_GO_ON if ok
HANDLER_FINISHED if the final output is prepared
-
+
HANDLER_ERROR on error
-
+
handle_subrequest
`````````````````
@@ -212,9 +212,9 @@ called if subrequest_start requested a COMEBACK or a WAIT_FOR_EVENT
:returns:
HANDLER_GO_ON if ok
HANDLER_FINISHED if the final output is prepared
-
+
HANDLER_ERROR on error
-
+
handle_physical_path
````````````````````
@@ -223,9 +223,9 @@ called after physical.path is set
:returns:
HANDLER_GO_ON if ok
HANDLER_FINISHED if the final output is prepared
-
+
HANDLER_ERROR on error
-
+
handle_request_done
```````````````````
@@ -234,9 +234,9 @@ called at the end of the request (logging, statistics, ...)
:returns:
HANDLER_GO_ON if ok
-
+
HANDLER_ERROR on error
-
+
handle_connection_close
```````````````````````
@@ -244,9 +244,9 @@ called if the connection is terminated
:returns:
HANDLER_GO_ON if ok
-
+
HANDLER_ERROR on error
-
+
handle_joblist
``````````````
@@ -254,7 +254,7 @@ called if the state of the connection has changed
:returns:
HANDLER_GO_ON if ok
-
+
HANDLER_ERROR on error
-
+
diff --git a/doc/outdated/proxy.txt b/doc/proxy.txt
index b8a3997..8ff5c3e 100644
--- a/doc/outdated/proxy.txt
+++ b/doc/proxy.txt
@@ -11,12 +11,12 @@ Module: mod_proxy
:Revision: $Revision: 1.1 $
:abstract:
- The proxy module a simplest way to connect lighttpd to
+ The proxy module a simplest way to connect lighttpd to
java servers which have a HTTP-interface.
-
+
.. meta::
:keywords: lighttpd, Proxy
-
+
.. contents:: Table of Contents
Description
@@ -27,17 +27,17 @@ Description
Options
=======
-lighttpd provides the Proxy support via the proxy-module
+lighttpd provides the Proxy support via the proxy-module
(mod_proxy) which provides 2 options in the config-file:
:proxy.debug:
- a value between 0 and 65535 to set the debug-level in the
- Proxy module. Currently only 0 and 1 are used. Use 1 to
+ a value between 0 and 65535 to set the debug-level in the
+ Proxy module. Currently only 0 and 1 are used. Use 1 to
enable some debug output, 0 to disable it.
:proxy.balance:
might be one of 'hash', 'round-robin' or 'fair' (default).
-
+
'round-robin' choses another host for each request, 'hash'
is generating a hash over the request-uri and makes sure
that the same request URI is sent to always the same host.
@@ -46,22 +46,22 @@ lighttpd provides the Proxy support via the proxy-module
load-based, passive balancing.
:proxy.server:
- tell the module where to send Proxy requests to. Every
- file-extension can have its own handler. Load-Balancing is
+ tell the module where to send Proxy requests to. Every
+ file-extension can have its own handler. Load-Balancing is
done by specifying multiple handles for the same extension.
-
+
structure of proxy.server section: ::
-
- ( <extension> =>
- (
+
+ ( <extension> =>
+ (
( "host" => <string> ,
"port" => <integer> ),
( "host" => <string> ,
"port" => <integer> )
),
- <extension> => ...
+ <extension> => ...
)
-
+
:<extension>: is the file-extension or prefix (if started with "/")
might empty to match all requests
:"host": is ip of the proxy server
@@ -69,9 +69,9 @@ lighttpd provides the Proxy support via the proxy-module
server (default: 80)
e.g.: ::
-
+
proxy.server = ( ".jsp" =>
- ( (
+ ( (
"host" => "10.0.0.242",
"port" => 81
) )
@@ -80,8 +80,8 @@ lighttpd provides the Proxy support via the proxy-module
Example:
========
-Using lighttpd + mod_proxy in front of 8 Squids which handle the
-caching of dynamic content for you. All requests for the host
+Using lighttpd + mod_proxy in front of 8 Squids which handle the
+caching of dynamic content for you. All requests for the host
www.example.org should be forwarded to the proxy. All proxies
listen on port 80 for requests. ::
@@ -97,7 +97,7 @@ listen on port 80 for requests. ::
( "host" => "10.0.0.17" ) ) )
}
-If one of the hosts goes down the all requests for this one server are
+If one of the hosts goes down the all requests for this one server are
moved equally to the other servers. If you want to know more about
the algorithm used here google for 'Microsoft CARP'.
diff --git a/doc/initscripts/rc.lighttpd b/doc/rc.lighttpd
index da0d244..91accdd 100755
--- a/doc/initscripts/rc.lighttpd
+++ b/doc/rc.lighttpd
@@ -11,7 +11,7 @@
# /(usr/)sbin/rcFOO
#
# LSB compliant service control script; see http://www.linuxbase.org/spec/
-#
+#
# System startup script for some example service or daemon FOO (template)
#
### BEGIN INIT INFO
@@ -23,7 +23,7 @@
# Description: Start FOO to allow XY and provide YZ
# continued on second line by '#<TAB>'
### END INIT INFO
-#
+#
# Note on Required-Start: It does specify the init script ordering,
# not real dependencies. Depencies have to be handled by admin
# resp. the configuration tools (s)he uses.
@@ -64,7 +64,7 @@ rc_reset
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
-#
+#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
@@ -76,7 +76,7 @@ case "$1" in
## Start daemon with startproc(8). If this fails
## the echo return value is set appropriate.
- # NOTE: startproc returns 0, even if service is
+ # NOTE: startproc returns 0, even if service is
# already running to match LSB spec.
startproc $LIGHTTPD_BIN -f $LIGHTTPD_CONF_PATH
@@ -94,7 +94,7 @@ case "$1" in
rc_status -v
;;
try-restart)
- ## Stop the service and if this succeeds (i.e. the
+ ## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
$0 status >/dev/null && $0 restart
@@ -111,7 +111,8 @@ case "$1" in
# Remember status and be quiet
rc_status
;;
- force-reload|reload)
+ force-reload)
+ reload)
## Like force-reload, but if daemon does not support
## signalling, do nothing (!)
@@ -121,7 +122,7 @@ case "$1" in
$0 start
touch /var/run/lighttpd.pid
rc_status -v
-
+
## Otherwise if it does not support reload:
#rc_failed 3
#rc_status -v
diff --git a/doc/initscripts/rc.lighttpd.redhat b/doc/rc.lighttpd.redhat
index e22d551..e22d551 100755
--- a/doc/initscripts/rc.lighttpd.redhat
+++ b/doc/rc.lighttpd.redhat
diff --git a/doc/outdated/redirect.txt b/doc/redirect.txt
index ec54731..118ea8e 100644
--- a/doc/outdated/redirect.txt
+++ b/doc/redirect.txt
@@ -12,10 +12,10 @@ Module: mod_redirect
:abstract:
url redirection
-
+
.. meta::
:keywords: lighttpd, redirect
-
+
.. contents:: Table of Contents
Description
@@ -28,9 +28,9 @@ Options
url.redirect
redirects a set of URLs externally
-
+
e.g. ::
-
+
url.redirect = ( "^/show/([0-9]+)/([0-9]+)$" => "http://www.example.org/show.php?isdn=$1&page$2",
"^/get/([0-9]+)/([0-9]+)$" => "http://www.example.org/get.php?isdn=$1&page$2" )
@@ -39,9 +39,3 @@ url.redirect
$HTTP["host"] =~ "^www\.(.*)" {
url.redirect = ( "^/(.*)" => "http://%1/$1" )
}
-
-Warning
-=======
-
-Do NOT use mod_redirect to protect specific urls, as the original url passed from the client
-is matched against your rules, for example strings like "/abc/../xyz%2f/path".
diff --git a/doc/outdated/rewrite.txt b/doc/rewrite.txt
index a139069..aed31c6 100644
--- a/doc/outdated/rewrite.txt
+++ b/doc/rewrite.txt
@@ -12,10 +12,10 @@ Module: mod_rewrite
:abstract:
url rewrite
-
+
.. meta::
:keywords: lighttpd, rewrite
-
+
.. contents:: Table of Contents
Description
@@ -28,50 +28,53 @@ Options
url.rewrite-once
rewrites a set of URLs interally in the webserver BEFORE they are handled.
-
+
e.g. ::
-
+
url.rewrite-once = ( "<regex>" => "<relative-uri>" )
-
+
url.rewrite-repeat
rewrites a set of URLs interally in the webserver BEFORE they are handled
-
+
e.g. ::
-
+
url.rewrite-repeat = ( "<regex>" => "<relative-uri>" )
-The options ``url.rewrite`` and ``url.rewrite-final`` were mapped to ``url.rewrite-once``
+The options ``url.rewrite`` and ``url.rewrite-final`` were mapped to ``url.rewrite-once``
in 1.3.16.
-Warning
-=======
-
-Do NOT use mod_rewrite to protect specific urls, as the original url passed from the client
-is matched against your rules, for example strings like "/abc/../xyz%2f/path".
-
Examples
========
-The regex is matching the full REQUEST_URI which is supplied by the user including
+The regex is matching the full REQUEST_URI which is supplied by the user including
query-string.::
url.rewrite-once = ( "^/id/([0-9]+)$" => "/index.php?id=$1",
"^/link/([a-zA-Z]+)" => "/index.php?link=$1" )
-
- # the following example, is, however just simulating vhost by rewrite
- # * you can never change document-root by mod_rewrite
- # use mod_*host instead to make real mass-vhost
-
- # request: http://any.domain.com/url/
- # before rewrite: REQUEST_URI="/www/htdocs/url/"
- # and DOCUMENT_ROOT="/www/htdocs/" %0="www.domain.com" $1="url/"
- # after rewrite: REQUEST_URI="/www/htdocs/domain.com/url/"
- # still, you have DOCUMENT_ROOT=/www/htdocs/
-
+ # request: http://www.domain.com/url/
+ # or request: http://any.domain.com/url/
+ # before write: /www/htdocs/url/
+ # after rewrite: /www/htdocs/domain.com/url/
+ # document-root=/www/htdocs/ %0=www.domain.com $1=url/
server.document-root = "/www/htdocs/"
$HTTP["host"] =~ "^.*\.([^.]+\.com)$" {
url.rewrite-once = ( "^/(.*)" => "/%0/$1" )
}
+
+ # request: http://abc.mass-serve-subdomain.com/url/
+ # before rewrite: /www/htdocs/url/
+ # after rewrite: /www/htdocs/mass-serve-subdomain.com/abc/url/
+ $HTTP["host"] =~ "^([^.]+)\.mass-subdomain\.com" {
+ server.document-root = "/www/htdocs/mass-subdomain.com"
+ url.rewrite-once = ( "^/(.*)" => "/%1/$1" )
+ }
+
+
+ # similar effect as above, except that you have multiply mass-subdomain now
+ server.document-root = "/www/htdocs/"
+ $HTTP["host"] =~ "^([^.]+)\.(mass-subdomain\.com|mass-subdomain\.net)" {
+ url.rewrite-once = ( "^/(.*)" => "/%2/%1/$1" )
+ }
diff --git a/doc/scripts/rrdtool-graph.sh b/doc/rrdtool-graph.sh
index 1157a28..1157a28 100755
--- a/doc/scripts/rrdtool-graph.sh
+++ b/doc/rrdtool-graph.sh
diff --git a/doc/outdated/rrdtool.txt b/doc/rrdtool.txt
index 1ad5543..ce0145c 100644
--- a/doc/outdated/rrdtool.txt
+++ b/doc/rrdtool.txt
@@ -12,17 +12,17 @@ Module: mod_rrdtool
:abstract:
mod_rrdtool is used to monitor the traffic and load on the webserver
-
+
.. meta::
:keywords: lighttpd, skeleton
-
+
.. contents:: Table of Contents
Description
===========
RRD_ is a system to store and display time-series data (i.e. network
-bandwidth, machine-room temperature, server load average).
+bandwidth, machine-room temperature, server load average).
.. _RRD: http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
@@ -33,24 +33,24 @@ rrdtool.binary
path to the rrdtool binary
e.g.: ::
-
+
rrdtool.binary = "/usr/bin/rrdtool"
rrdtool.db-name
- filename of the rrd-database. Make sure that <rrdtool.db-name> doesn't exist
- before the first run, as lighttpd has to create the DB for you.
+ filename of the rrd-database. Make sure that <rrdtool.db-name> doesn't exists
+ before the first run as lighttpd has to create the DB for you.
e.g.: ::
-
+
rrdtool.db-name = "/var/www/lighttpd.rrd"
-
+
Generating Graphs
=================
::
#!/bin/sh
-
+
RRDTOOL=/usr/bin/rrdtool
OUTDIR=/var/www/servers/www.example.org/pages/rrd/
INFILE=/var/www/lighttpd.rrd
diff --git a/doc/outdated/scgi.txt b/doc/scgi.txt
index dbb6371..ff849fe 100644
--- a/doc/outdated/scgi.txt
+++ b/doc/scgi.txt
@@ -13,10 +13,10 @@ Module: mod_scgi
:abstract:
SCGI is a fast and simplified CGI interface. It is mostly
used by Python + WSGI.
-
+
.. meta::
:keywords: lighttpd, FastCGI
-
+
.. contents:: Table of Contents
Description
@@ -24,8 +24,8 @@ Description
The SCGI module is heavily based on the FastCGI when it comes
to configuration. Only the internal protocol between server
-and client has been replaced. Please check the documentation
-of the FastCGI module for more information.
+and client has been replaced. Please check the documentation
+of the fastcgi module for more information.
History
=======
diff --git a/doc/scripts/Makefile.am b/doc/scripts/Makefile.am
deleted file mode 100644
index 08aaa25..0000000
--- a/doc/scripts/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-EXTRA_DIST= \
- rrdtool-graph.sh \
- spawn-php.sh
diff --git a/doc/outdated/secdownload.txt b/doc/secdownload.txt
index bf0a481..fb946ed 100644
--- a/doc/outdated/secdownload.txt
+++ b/doc/secdownload.txt
@@ -11,12 +11,12 @@ Module: mod_secdownload
:Revision: $Revision: 1.1 $
:abstract:
- authenticated file requests and a countermeasure against
+ authenticated file requests and a counter measurement against
deep-linking can be achieved easily by using mod_secdownload
-
+
.. meta::
:keywords: lighttpd, secure, fast, downloads
-
+
.. contents:: Table of Contents
Options
@@ -32,77 +32,77 @@ Options
Description
===========
-there are multiple ways to handle secured download mechanisms:
+there are multiple way to handle secured download mechanisms:
-1. use the webserver and the internal HTTP authentication
-2. use the application to authenticate and send the file
+1. use the webserver and the internal HTTP-authentication
+2. use the application to authenticate and send the file
through the application
-
-Both ways have limitations:
+
+Both way have limitations:
webserver:
-- ``+`` fast download
-- ``+`` no additional system load
-- ``-`` inflexible authentication handling
-
+- ``+`` fast download
+- ``+`` no additional system load
+- ``-`` unflexible authentication handling
+
application:
- ``+`` integrated into the overall layout
- ``+`` very flexible permission management
-- ``-`` the download occupies an application thread/process
-
-A simple way to combine the two ways could be:
+- ``-`` the download occupies a application thread/process
+
+A simple way to combine the two way could be:
1. app authenticates user and checks permissions to
download the file.
-2. app redirects user to the file accessable by the webserver
- for further downloading.
-3. the webserver transfers the file to the user.
+2. app redirectes user the file accessable by the webserver
+ for further downloading
+3. the webserver transfers the file to the user
As the webserver doesn't know anything about the permissions
-used in the app, the resulting URL would be available to every
-user who knows the URL.
-
-mod_secdownload removes this problem by introducing a way to
+used in the app the resulting URL would be available to every
+user who knows the URL.
+
+mod_secdownload removes this problem by introducing a way to
authenticate a URL for a specified time. The application has
to generate a token and a timestamp which are checked by the
-webserver before it allows the file to be downloaded by the
+webserver before it allows the file to be downloaded by the
webserver.
The generated URL has to have the format:
<uri-prefix><token>/<timestamp-in-hex><rel-path>
-<token> is an MD5 of
+<token> is a MD5 of
1. a secret string (user supplied)
-2. <rel-path> (starts with /)
+2. <rel-path> (startes with /)
3. <timestamp-in-hex>
-As you can see, the token is not bound to the user at all. The
-only limiting factor is the timestamp which is used to
+As you can see the token is not bound to the user at all. The
+only limiting factor is the timestamp which is used to
invalidate the URL after a given timeout (secdownload.timeout).
.. Note::
- Be sure to choose a another secret than the one used in the
- examples, as this is the only part of the token that is not
- known to the user.
-
-
-
-If the user tries to fake the URL by choosing a random token,
+ Be sure to choose a another secret then used in the examples
+ as this is the only part of the token that is not known to
+ the user.
+
+
+
+If the user tries to fake the URL by choosing a random token
status 403 'Forbidden' will be sent out.
-If the timeout is reached, status 408 'Request Timeout' will be
-sent. (This does not really conform to the standard, but should
-do the trick).
+If the timeout is reached status 408 'Request Timeout' will be
+sent (this not really standard conforming but should do the
+trick).
-If token and timeout are valid, the <rel-path> is appended to
-the configured (secdownload.document-root) and passed to the
-normal internal file transfer functionality. This might lead to
-status 200 or 404.
+If token and timeout are valid the <rel-path> is taken and
+appended at the configured (secdownload.document-root) and
+passed to the normal internal file transfer functionality.
+This might lead to status 200 or 404.
Example
=======
@@ -114,19 +114,19 @@ Your application has to generate the correct URLs. The following sample
code for PHP should be easily adaptable to any other language: ::
<?php
-
+
$secret = "verysecret";
$uri_prefix = "/dl/";
-
+
# filename
$f = "/secret-file.txt";
-
+
# current timestamp
$t = time();
-
+
$t_hex = sprintf("%08x", $t);
$m = md5($secret.$f.$t_hex);
-
+
# generate link
printf('<a href="%s%s/%s%s">%s</a>',
$uri_prefix, $m, $t_hex, $f, $f);
@@ -135,11 +135,11 @@ code for PHP should be easily adaptable to any other language: ::
Webserver
---------
-The server has to be configured in the same way. The URI prefix and
-secret have to match: ::
+The server has to configured in the same way. The uri-prefix and secret have
+to match: ::
server.modules = ( ..., "mod_secdownload", ... )
-
+
secdownload.secret = "verysecret"
secdownload.document-root = "/home/www/servers/download-area/"
secdownload.uri-prefix = "/dl/"
diff --git a/doc/outdated/security.txt b/doc/security.txt
index 766fd34..d4e9147 100644
--- a/doc/outdated/security.txt
+++ b/doc/security.txt
@@ -12,10 +12,10 @@ Module: core
:abstract:
lighttpd was developed with security in mind ...
-
+
.. meta::
:keywords: lighttpd, security
-
+
.. contents:: Table of Contents
Description
@@ -33,7 +33,7 @@ Limiting POST requests
System Security
---------------
-Running daemons as root with full privileges is a bad idea in general.
+Running daemons as root will full privileges is a bad idea in general.
lighttpd runs best without any extra privileges and runs perfectly in chroot.
Change Root
@@ -41,7 +41,7 @@ Change Root
server.chroot = "..."
-Drop root privileges
+Drop root-privileges
````````````````````
server.username = "..."
diff --git a/doc/outdated/setenv.txt b/doc/setenv.txt
index c03474f..b04b083 100644
--- a/doc/outdated/setenv.txt
+++ b/doc/setenv.txt
@@ -12,10 +12,10 @@ Module: mod_setenv
:abstract:
mod_setenv is used to add request
-
+
.. meta::
:keywords: lighttpd, skeleton
-
+
.. contents:: Table of Contents
Description
@@ -31,7 +31,7 @@ setenv.add-environment
setenv.add-response-header
- adds a header to the HTTP response sent to the client
+ add a header to the HTTP-response sent to the client
setenv.add-request-header
- adds a header to the HTTP request that was received from the client
+ add a header to the HTTP-request that was received by the client
diff --git a/doc/outdated/simple-vhost.txt b/doc/simple-vhost.txt
index 4f8338f..b0776f0 100644
--- a/doc/outdated/simple-vhost.txt
+++ b/doc/simple-vhost.txt
@@ -12,10 +12,10 @@ Module: mod_simple_vhost
:abstract:
virtual hosting
-
+
.. meta::
:keywords: lighttpd, virtual hosting
-
+
.. contents:: Table of Contents
Description
@@ -23,25 +23,25 @@ Description
Simple assumption:
-Every virtual host is in a directory below a base directory in a path that
-is the same as the name of the vhost. Below this vhost path might be an
-extra directory which is the document root of the vhost.
+Every virtual host is in a direction below a base directory in a path that
+is the same as the name of the vhost. Below this vhost-path might be a
+extra directory which is the document-root of the vhost.
-The document root for each vhost is built from three values:
+The document-root for each vhost is build from three values:
- server-root
- hostname
- document-root
-The complete document root is constructed either by ::
+Either the absolute documentroot is build by ::
server-root + hostname + document-root
-
+
or if this path does not exist by ::
server-root + default-host + document-root
-
-A small example should make this idea clear: ::
+
+A small example should make this thinking clean: ::
/var/www/
/var/www/logs/
@@ -52,7 +52,7 @@ A small example should make this idea clear: ::
/var/www/servers/mail.example.org/
/var/www/servers/mail.example.org/lib/
/var/www/servers/mail.example.org/pages/
-
+
simple-vhost.server-root = "/var/www/servers/"
simple-vhost.default-host = "www.example.org"
simple-vhost.document-root = "pages"
@@ -62,8 +62,7 @@ You can use symbolic links to map several hostnames to the same directory.
Conditionals vs. simple-vhost
-----------------------------
-You have to keep in mind that conditionals and simple-vhost interfere
-with one another. ::
+You have to keep in mind that conditionals and simple-vhost interfere. ::
simple-vhost.server-root = "/var/www/servers/"
simple-vhost.default-host = "www.example.org"
@@ -71,17 +70,16 @@ with one another. ::
$HTTP["host"] == "news.example.org" {
server.document-root = "/var/www/servers/news2.example.org/pages/"
- }
+ }
-When ``news.example.org`` is requested, the ``server.document-root``
-will be set to ``/var/www/servers/news2.example.org/pages/``, but
-simple-vhost will overwrite it shortly afterwards.
+Even if the ``server.document-root`` will be set to ``/var/www/servers/news2.example.org/pages/``
+if ``news.example.org`` is requested simple-vhost will overwrite ``server.document-root`` shortly
+afterwards.
-If ``/var/www/servers/news.example.org/pages/`` exists, that will be
-used. If not, ``/var/www/servers/www.example.org/pages/`` will be taken
-because it is the default.
+If ``/var/www/servers/news.example.org/pages/`` exists it will be taken, if not
+``/var/www/servers/www.example.org/pages/`` will be taken as it is the default.
-To use conditionals together with simple-vhost, you should do this: ::
+To get them working in parallel you should use: ::
$HTTP["host"] !~ "^(news\.example\.org)$" {
simple-vhost.server-root = "/var/www/servers/"
@@ -91,19 +89,19 @@ To use conditionals together with simple-vhost, you should do this: ::
$HTTP["host"] == "news.example.org" {
server.document-root = "/var/www/servers/news2.example.org/pages/"
- }
+ }
-It will enable simple vhosting for all hosts other than ``news.example.org``.
+It will enable simple-vhosting for all host with are not named ``news.example.org``.
Options
=======
simple-vhost.server-root
- root of the virtual host
-
+ root of the virtual hosting
+
simple-vhost.default-host
- use this hostname if the requested hostname does not have its own directory
-
+ use this hostname if the
+
simple-vhost.document-root
- path below the vhost directory
-
+ path below the vhost-directory
+
diff --git a/doc/outdated/skeleton.txt b/doc/skeleton.txt
index b1b01e6..13c6881 100644
--- a/doc/outdated/skeleton.txt
+++ b/doc/skeleton.txt
@@ -12,10 +12,10 @@ Module: mod_skeleton
:abstract:
a nice, short abstrace about the module
-
+
.. meta::
:keywords: lighttpd, skeleton
-
+
.. contents:: Table of Contents
Description
diff --git a/doc/spawn-fcgi.1 b/doc/spawn-fcgi.1
new file mode 100644
index 0000000..2ad5bd9
--- /dev/null
+++ b/doc/spawn-fcgi.1
@@ -0,0 +1,13 @@
+.TH SPAWNFCGI 1 2003-12-21
+.SH NAME
+spawn-fcgi \- spawning FastCGI processes
+.SH SYNOPSIS
+spawn-fcgi -f <fastcgi-binary> [-p <port> | -s <socket>] [-C <num-of-php-procs>] [-c <chroot-dir>] [-u <username>] [-g <groupname>]
+spawn-fcgi -v
+spawn-fcgi -h
+.SH DESCRIPTION
+spawn-fcgi is used to spawn remote FastCGI processes.
+.SH SEE ALSO
+lighttpd(1)
+.SH AUTHOR
+jan@kneschke.de
diff --git a/doc/scripts/spawn-php.sh b/doc/spawn-php.sh
index 181eae2..73abf67 100755
--- a/doc/scripts/spawn-php.sh
+++ b/doc/spawn-php.sh
@@ -6,22 +6,22 @@ SPAWNFCGI="/home/weigon/projects/spawn-fcgi/src/spawn-fcgi"
## ABSOLUTE path to the PHP binary
FCGIPROGRAM="/usr/local/bin/php"
-## TCP port to which to bind on localhost
+## bind to tcp-port on localhost
FCGIPORT="1026"
-## number of PHP children to spawn
+## number of PHP childs to spawn
PHP_FCGI_CHILDREN=10
-## maximum number of requests a single PHP process can serve before it is restarted
+## number of request server by a single php-process until is will be restarted
PHP_FCGI_MAX_REQUESTS=1000
-## IP addresses from which PHP should access server connections
+## IP adresses where PHP should access server connections from
FCGI_WEB_SERVER_ADDRS="127.0.0.1,192.168.2.10"
-# allowed environment variables, separated by spaces
+# allowed environment variables sperated by spaces
ALLOWED_ENV="ORACLE_HOME PATH USER"
-## if this script is run as root, switch to the following user
+## if this script is run as root switch to the following user
USERID=wwwrun
GROUPID=wwwrun
@@ -49,6 +49,6 @@ E=
for i in $ALLOWED_ENV; do
E="$E $i=${!i}"
done
-
-# clean the environment and set up a new one
+
+# clean environment and set up a new one
env - $E $EX
diff --git a/doc/outdated/ssi.txt b/doc/ssi.txt
index c65e7e1..c5791a2 100644
--- a/doc/outdated/ssi.txt
+++ b/doc/ssi.txt
@@ -11,12 +11,12 @@ Module: mod_ssi
:Revision: $Revision: 1.2 $
:abstract:
- The module for server-side includes provides a compatability
- layer for NSCA/Apache SSI.
-
+ The module for server-side includes provides a compat layer for
+ NSCA/Apache SSI.
+
.. meta::
:keywords: lighttpd, ssi, Server-Side Includes
-
+
.. contents:: Table of Contents
Description
@@ -60,7 +60,7 @@ Every ''expr'' is interpreted:
Flow Control
------------
-if, elif, else and endif can only be used to insert content under special
+if, elif, else and endif can be used the insert content only under special
conditions.
Unsupported Features
@@ -73,4 +73,4 @@ which are not supported by this module for various reasons:
- nested virtual
- config.errmsg
- echo.encoding
-
+
diff --git a/doc/outdated/ssl.txt b/doc/ssl.txt
index 447da4e..81b9215 100644
--- a/doc/outdated/ssl.txt
+++ b/doc/ssl.txt
@@ -11,30 +11,30 @@ Module: core
:Revision: $Revision: 1.2 $
:abstract:
- How to set up SSL in lighttpd
-
+ How to setup SSL in lighttpd
+
.. meta::
:keywords: lighttpd, ssl
-
+
.. contents:: Table of Contents
Description
===========
-lighttpd supports SSLv2 and SSLv3 if it is compiled against openssl.
+lighttpd support SSLv2 and SSLv3 if it compiled against openssl.
Configuration
-------------
-To enable SSL for the whole server you have to provide a valid
+To enable SSL for the whole server you have to provide a valid
certificate and have to enable the SSL engine.::
ssl.engine = "enable"
ssl.pemfile = "/path/to/server.pem"
-
-The HTTPS protocol does not allow you to use name-based virtual
-hosting with SSL. If you want to run multiple SSL servers with
-one lighttpd instance you must use IP-based virtual hosting: ::
+
+As SSL and named-based virtual hosting can not work together you
+have to use IP-based virtual hosting if you want to run multiple
+SSL-servers with one lighttpd: ::
$SERVER["socket"] == "10.0.0.1:443" {
ssl.engine = "enable"
@@ -44,8 +44,7 @@ one lighttpd instance you must use IP-based virtual hosting: ::
server.document-root = "/www/servers/www.example.org/pages/"
}
-If you have a .crt and a .key file, cat them together into a
-single PEM file:
+If you have a .crt and a .key file cat them together into a single PEM file:
::
$ cat host.key host.crt > host.pem
@@ -54,9 +53,9 @@ single PEM file:
Self-Signed Certificates
------------------------
-A self-signed SSL certificate can be generated like this: ::
-
+A self-signed SSL cerifitcate can be generated with: ::
+
$ openssl req -new -x509 \
-keyout server.pem -out server.pem \
-days 365 -nodes
-
+
diff --git a/doc/outdated/state.dot b/doc/state.dot
index 551b232..551b232 100644
--- a/doc/outdated/state.dot
+++ b/doc/state.dot
diff --git a/doc/outdated/state.txt b/doc/state.txt
index 5e8277b..d0768bc 100644
--- a/doc/outdated/state.txt
+++ b/doc/state.txt
@@ -14,10 +14,10 @@ Module: core
This is a short summary of the state-engine which is driving the lighttpd
webserver. It describes the basic concepts and the way the different parts
of the server are connected.
-
+
.. meta::
:keywords: lighttpd, state-engine
-
+
.. contents:: Table of Contents
Description
@@ -52,72 +52,72 @@ and some may never be hit at all.
reset connection (incl. close())
:close:
close connection (handle lingering close)
-
+
.. image:: state.png
-
+
A simple GET request (green path)
---------------------------------
-
+
The connection is idling in the 'connect' state waiting for a connection.
As soon as the connection is set up we init the read-timer in 'reqstart'
and start to read data from the network. As soon as we get the
HTTP-request terminator (CRLFCRLF) we forward the header to the parser.
-
+
The parsed request is handled by 'handlereq' and as soon as a decision out
the request is made it is sent to 'respstart' to prepare the
HTTP-response header. In the 'write' state the prepare content is sent out
to the network. When everything is sent 'respend' is entered to log the
-request and cleanup the environment. After the close() call the connection
+request and cleanup the environment. After the close() call the connection
is set back to the 'connect' state again.
-
+
Keep-Alive (blue path)
----------------------
-
+
The Keep-Alive handling is implemented by going from the 'respend'
directly to 'reqstart' without the close() and the accept() calls.
-
+
POST requests (grey path)
-------------------------
-
+
As requests might contain a request-body the state 'readpost' entered as
soon as the header is parsed and we know how much data we expect.
-
+
Pipelining
----------
-
+
HTTP/1.1 supportes pipelining (sending multiple requests without waiting
for the response of the first request). This is handled transparently by
the 'read' state.
-
+
Unexpected errors (red path)
----------------------------
-
+
For really hard errors we use the 'error' state which resets the
connection and can be call from every state. It is only use if there is no
other way to handle the issue (e.g. client-side close of the connection).
If possible we should use http-status 500 ('internal server error') and
log the issue in the errorlog.
-
+
If we have to take care of some data which is coming in after we ran into
the error condition the 'close' state is used the init a half-close and
read all the delay packet from the network.
-
+
Sub-Requests (lightblue)
------------------------
-
+
The FastCGI, CGI, ... intergration is done by introducing a loop in
'handlereq' to handle all aspect which are neccesary to find out what has
to be sent back to the client.
-
+
Functions
=========
Important functions used by the state-engine
-
+
:state-engine:
- ``connection_state_machine()``
-
+
:connect:
- (nothing)
diff --git a/doc/status.txt b/doc/status.txt
new file mode 100644
index 0000000..3e0acab
--- /dev/null
+++ b/doc/status.txt
@@ -0,0 +1,35 @@
+=============
+Server Status
+=============
+
+------------------
+Module: mod_status
+------------------
+
+:Author: Jan Kneschke
+:Date: $Date: 2004/11/03 22:26:05 $
+:Revision: $Revision: 1.2 $
+
+:abstract:
+ mod_status displays server-status and server-config
+
+.. meta::
+ :keywords: lighttpd, server status
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+The server status module generates the ...
+
+Options
+=======
+
+status.status-url
+
+ Default: unset
+
+status.config-url
+
+ Default: unset
diff --git a/doc/initscripts/sysconfig.lighttpd b/doc/sysconfig.lighttpd
index c8154c9..c8154c9 100644
--- a/doc/initscripts/sysconfig.lighttpd
+++ b/doc/sysconfig.lighttpd
diff --git a/doc/systemd/Makefile.am b/doc/systemd/Makefile.am
deleted file mode 100644
index 665f164..0000000
--- a/doc/systemd/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST=lighttpd.service
diff --git a/doc/systemd/lighttpd.service b/doc/systemd/lighttpd.service
deleted file mode 100644
index 7f4a611..0000000
--- a/doc/systemd/lighttpd.service
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Lighttpd Daemon
-After=network.target
-
-[Service]
-ExecStartPre=/usr/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf
-ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
-
-[Install]
-WantedBy=multi-user.target
diff --git a/doc/outdated/traffic-shaping.txt b/doc/traffic-shaping.txt
index 1076686..7d16638 100644
--- a/doc/outdated/traffic-shaping.txt
+++ b/doc/traffic-shaping.txt
@@ -11,45 +11,45 @@ Module: core
:Revision: $Revision: 1.2 $
:abstract:
- limiting bandwidth usage
-
+ limiting the bandwith usage
+
.. meta::
:keywords: lighttpd, bandwidth limit, traffic shaping
-
+
.. contents:: Table of Contents
Description
===========
-Starting with 1.3.8, lighttpd supports limiting the bandwidth for
-a single connection or config context like a virtual host or a URL.
+Starting with 1.3.8 lighttpd supports limiting the bandwith for a single connection
+or config-context like virtual-host or URL.
Options
=======
:connection.kbytes-per-second:
- limit the throughput for each single connection to the given
+ limit the through-put for each single connection to the given
limit in kbyte/s
-
+
default: 0 (no limit)
:server.kbytes-per-second:
- limit the throughput for all connections to the given limit
+ limit the through-put for all connections to the given limit
in kbyte/s
-
- if you want to specify a limit for a special virtual server
+
+ if you want to specify a limit for a special virtual server
use: ::
-
+
$HTTP["host"] == "www.example.org" {
server.kbytes-per-second = 128
}
-
- which will override the default for this host.
-
+
+ which will overwrite the default for this host.
+
default: 0 (no limit)
Additional Notes
================
-Keep in mind that a limit below 32kb/s might actually limit the traffic to 32kb/s. This
-is caused by the size of the TCP send buffer.
+Keep in mind that a limit below 32kb/s might actually limit the traffic to 32kb/s. This
+is caused by by the size of the TCP-sendbuffer.
diff --git a/doc/outdated/trigger_b4_dl.txt b/doc/trigger_b4_dl.txt
index f5c9d29..ffdfb53 100644
--- a/doc/outdated/trigger_b4_dl.txt
+++ b/doc/trigger_b4_dl.txt
@@ -11,11 +11,11 @@ Module: mod_trigger_b4_dl
:Revision: $Revision: 1.2 $
:abstract:
- another anti-hot-linking module
-
+ another anti hot-linking module
+
.. meta::
:keywords: lighttpd, hot-linking, deep-linking
-
+
.. contents:: Table of Contents
Description
@@ -23,11 +23,11 @@ Description
Anti Hotlinking:
- * if user requests ''download-url'' directly, the request is denied and he is redirected to ''deny-url'
- * if user visits ''trigger-url'' before requesting ''download-url'', access is granted
- * if user visits ''download-url'' again after ''trigger-timeout'' has elapsed, the request is denied and he is redirected to ''deny-url''
+ * if user requests ''download-url'' directly the request is denied and he is redirected to ''deny-url'
+ * if user visits ''trigger-url'' before requesting ''download-url'' access is granted
+ * if user visits ''download-url'' again after ''trigger-timeout'' has run down to the request is denied and he is redirected to ''deny-url''
-The trigger information is either stored locally in a gdbm file or remotely in memcached.
+The storage for the trigger information is either stored locally in a gdbm file or remotly in memcached.
Requirements
------------
@@ -47,8 +47,8 @@ Options
trigger-before-download.deny-url = "http://192.168.1.5:1025/index.html"
trigger-before-download.trigger-timeout = 10
-If both trigger-before-download.gdbm-filename and
-trigger-before-download.memcache-hosts is set gdbm will take precedence.
+If both trigger-before-download.gdbm-filename and
+trigger-before-download.memcache-hosts is set gdbm will be prefered.
Installation
============
diff --git a/doc/outdated/userdir.txt b/doc/userdir.txt
index 7a62f06..65cc9d0 100644
--- a/doc/outdated/userdir.txt
+++ b/doc/userdir.txt
@@ -11,11 +11,11 @@ Module: mod_userdir
:Revision: $Revision: 1.1 $
:abstract:
- The userdir module ...
-
+ The userdir module ...
+
.. meta::
:keywords: lighttpd, userdir
-
+
.. contents:: Table of Contents
Description
@@ -23,18 +23,18 @@ Description
The userdir module provides a simple way to link user-based directories into the global namespace of the webserver.
-Requests in the form ``/~user/page.html`` are rewritten to take the file ``page.html`` from the home directory of the user.
-If ``userdir.path`` is set, the path will be appended to the home directory
+Requests in the form ``/~user/page.html`` are rewritten to take the file ``page.html`` from the home-directory of the user.
+If ``userdir.path`` is set, the path will be appended at the home-directory
building the classic mapping of: ::
userdir.path = "public_html"
- URL: http://www.example.org/~jan/index.html
+ URL: http://www.example.org/~jan/index.html
Path: /home/jan/public_html/
-To control which users should be able to use this feature you can set a list of usernames to include or exclude.
+To control which users should be able to use this feature you can set a include- or a exclude list for username.
-In case your mapping is independent of /etc/passwd you can use
+In case you mapping is independent of /etc/passwd you can use
``userdir.basepath``: ::
userdir.path = "htdocs"
@@ -46,16 +46,16 @@ In case your mapping is independent of /etc/passwd you can use
Options
=======
-userdir.path (required option)
- usually it should be set to "public_html" to take ~/public_html/ as the document root
-
- Default: unset (mod_userdir disabled; set it to "" if you want the home directory to be the document root as it was the default before 1.4.19)
+userdir.path
+ usually it should set the "public_html" to take ~/public_html/ as the document-root
+
+ Default: empty (document-root is the home-directory)
Example: ::
userdir.path = "public_html"
userdir.exclude-user
- list of usernames which may not use this feature
+ list of usernames which should not be able to use this feature
Default: empty (all users may use it)
Example: ::
@@ -66,7 +66,7 @@ userdir.exclude-user
userdir.include-user
if set, only users from this list may use the feature
- Default: empty (all users may use it)
+ Default: empty (all user may use it)
userdir.basepath
if set, don't check /etc/passwd for homedir
diff --git a/doc/outdated/webdav.txt b/doc/webdav.txt
index 7b5259e..175f33f 100644
--- a/doc/outdated/webdav.txt
+++ b/doc/webdav.txt
@@ -12,17 +12,17 @@ Module: mod_webdav
:abstract:
WebDAV module for lighttpd
-
+
.. meta::
:keywords: lighttpd, webdav
-
+
.. contents:: Table of Contents
Description
===========
The WebDAV module is a very minimalistic implementation of RFC 2518.
-Minimalistic means that not all operations are implemented yet.
+Minimalistic means that not all operations are implementated yet.
So far we have
@@ -32,18 +32,18 @@ So far we have
* DELETE
* PUT
-and the usual GET, POST, HEAD from HTTP/1.1.
+and the usual GET, POST, HEAD from HTTP/1.1.
-So far, mounting a WebDAV resource into Windows XP works and the basic litmus
+So far mounting a webdav resource into Windows XP works and the basic litmus
tests are passed.
Options
=======
webdav.activate
- If you load the webdav module, the WebDAV functionality has to be
- enabled for the directories you want to provide to the user.
-
+ If you load the webdav module the WebDAV functionality has to be
+ enabled for the directories you want to the provide to the user.
+
Default: disable
webdav.is-readonly
@@ -54,9 +54,9 @@ webdav.is-readonly
Examples
========
-To enable WebDAV for the /dav directory, you wrap your webdav options in
-a conditional. You have to use the regex like below as you want to match
-the directory /dav and everything below it, but not e.g. /davos. ::
+To enable WebDAV for the /dav directory you take a conditional and wrap around
+your webdav options. You have to use the regex like below as you want to match
+the directory /dav and everything below it, but not /davos. ::
$HTTP["url"] =~ "^/dav($|/)" {
webdav.activate = "enable"
diff --git a/install-sh b/install-sh
index 6781b98..6ce63b9 100755
--- a/install-sh
+++ b/install-sh
@@ -1,8 +1,7 @@
#!/bin/sh
+#
# install - install a program, script, or datafile
-
-scriptversion=2009-04-28.21; # UTC
-
+#
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
@@ -39,482 +38,257 @@ scriptversion=2009-04-28.21; # UTC
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
-# from scratch.
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
-nl='
-'
-IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
-if test -z "$doit"; then
- doit_exec=exec
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd=$cpprog
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "$0: no input file specified" >&2
+ exit 1
else
- doit_exec=$doit
+ :
fi
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_glob='?'
-initialize_posix_glob='
- test "$posix_glob" != "?" || {
- if (set -f) 2>/dev/null; then
- posix_glob=
- else
- posix_glob=:
- fi
- }
-'
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
-src=
-dst=
-dir_arg=
-dst_arg=
+ if [ -d "$dst" ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=$mkdirprog
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f "$src" ] || [ -d "$src" ]
+ then
+ :
+ else
+ echo "$0: $src does not exist" >&2
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "$0: no destination specified" >&2
+ exit 1
+ else
+ :
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d "$dst" ]
+ then
+ dst=$dst/`basename "$src"`
+ else
+ :
+ fi
+fi
-copy_on_change=false
-no_target_directory=
+## this sed command emulates the dirname command
+dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+ '
+IFS="${IFS-$defaultIFS}"
-Options:
- --help display this help and exit.
- --version display version info and exit.
+oIFS=$IFS
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS=$oIFS
- -c (ignored)
- -C install only if different (preserve the last data modification time)
- -d create directories instead of installing files.
- -g GROUP $chgrpprog installed files to GROUP.
- -m MODE $chmodprog installed files to MODE.
- -o USER $chownprog installed files to USER.
- -s $stripprog installed files.
- -t DIRECTORY install into DIRECTORY.
- -T report an error if DSTFILE is a directory.
+pathcomp=''
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
- RMPROG STRIPPROG
-"
+while [ $# -ne 0 ] ; do
+ pathcomp=$pathcomp$1
+ shift
-while test $# -ne 0; do
- case $1 in
- -c) ;;
+ if [ ! -d "$pathcomp" ] ;
+ then
+ $mkdirprog "$pathcomp"
+ else
+ :
+ fi
- -C) copy_on_change=true;;
+ pathcomp=$pathcomp/
+done
+fi
- -d) dir_arg=true;;
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd "$dst" &&
- -g) chgrpcmd="$chgrpprog $2"
- shift;;
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
+else
- --help) echo "$usage"; exit $?;;
+# If we're going to rename the final executable, determine the name now.
- -m) mode=$2
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename "$dst"`
+ else
+ dstfile=`basename "$dst" $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
- -o) chowncmd="$chownprog $2"
- shift;;
+# don't allow the sed command to completely eliminate the filename
- -s) stripcmd=$stripprog;;
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename "$dst"`
+ else
+ :
+ fi
- -t) dst_arg=$2
- shift;;
+# Make a couple of temp file names in the proper directory.
- -T) no_target_directory=true;;
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
- --version) echo "$0 $scriptversion"; exit $?;;
+# Trap to clean up temp files at exit.
- --) shift
- break;;
+ trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+ trap '(exit $?); exit' 1 2 13 15
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
+# Move or copy the file name to the temp name
- *) break;;
- esac
- shift
-done
+ $doit $instcmd "$src" "$dsttmp" &&
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
- # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dst_arg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dst_arg"
- shift # fnord
- fi
- shift # arg
- dst_arg=$arg
- done
-fi
+# and set any options; do chmod last to preserve setuid bits
-if test $# -eq 0; then
- if test -z "$dir_arg"; then
- echo "$0: no input file specified." >&2
- exit 1
- fi
- # It's OK to call `install-sh -d' without argument.
- # This can happen when creating conditional directories.
- exit 0
-fi
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
-if test -z "$dir_arg"; then
- trap '(exit $?); exit' 1 2 13 15
-
- # Set umask so as not to create temps with too-generous modes.
- # However, 'strip' requires both read and write access to temps.
- case $mode in
- # Optimize common cases.
- *644) cp_umask=133;;
- *755) cp_umask=22;;
-
- *[0-7])
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw='% 200'
- fi
- cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
- *)
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw=,u+rw
- fi
- cp_umask=$mode$u_plus_rw;;
- esac
-fi
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
-for src
-do
- # Protect names starting with `-'.
- case $src in
- -*) src=./$src;;
- esac
-
- if test -n "$dir_arg"; then
- dst=$src
- dstdir=$dst
- test -d "$dstdir"
- dstdir_status=$?
- else
-
- # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
-
- if test -z "$dst_arg"; then
- echo "$0: no destination specified." >&2
- exit 1
- fi
-
- dst=$dst_arg
- # Protect names starting with `-'.
- case $dst in
- -*) dst=./$dst;;
- esac
+# Now remove or move aside any old file at destination location. We try this
+# two ways since rm can't unlink itself on some systems and the destination
+# file might be busy for other reasons. In this case, the final cleanup
+# might fail but the new file should still install successfully.
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
- if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
- fi
- dstdir=$dst
- dst=$dstdir/`basename "$src"`
- dstdir_status=0
- else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
- test -d "$dstdir"
- dstdir_status=$?
- fi
- fi
-
- obsolete_mkdir_used=false
-
- if test $dstdir_status != 0; then
- case $posix_mkdir in
- '')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
+{
+ if [ -f "$dstdir/$dstfile" ]
+ then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
+ $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
+ {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit
+ }
else
- mkdir_mode=
+ :
fi
+} &&
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writeable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
- esac
+# Now rename the file to the real destination.
- if
- $posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
- )
- then :
- else
-
- # The umask is ridiculous, or mkdir does not conform to POSIX,
- # or it failed possibly due to a race condition. Create the
- # directory the slow way, step by step, checking for races as we go.
-
- case $dstdir in
- /*) prefix='/';;
- -*) prefix='./';;
- *) prefix='';;
- esac
-
- eval "$initialize_posix_glob"
-
- oIFS=$IFS
- IFS=/
- $posix_glob set -f
- set fnord $dstdir
- shift
- $posix_glob set +f
- IFS=$oIFS
-
- prefixes=
-
- for d
- do
- test -z "$d" && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
- done
-
- if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
- fi
- fi
- fi
-
- if test -n "$dir_arg"; then
- { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
- { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
- test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
- else
-
- # Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
-
- # Trap to clean up those temp files at exit.
- trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
- # Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
- # and set any options; do chmod last to preserve setuid bits.
- #
- # If any of these fail, we abort the whole thing. If we want to
- # ignore errors from any of these, just make sure not to ignore
- # errors from the above "$doit $cpprog $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
- { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
- { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
- # If -C, don't bother to copy if it wouldn't change the file.
- if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
-
- eval "$initialize_posix_glob" &&
- $posix_glob set -f &&
- set X $old && old=:$2:$4:$5:$6 &&
- set X $new && new=:$2:$4:$5:$6 &&
- $posix_glob set +f &&
-
- test "$old" = "$new" &&
- $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
- then
- rm -f "$dsttmp"
- else
- # Rename the file to the real destination.
- $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
- {
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- fi || exit 1
-
- trap '' 0
- fi
-done
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+
+fi &&
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
+{
+ (exit 0); exit
+}
diff --git a/lighttpd.spec b/lighttpd.spec
new file mode 100644
index 0000000..3dbc637
--- /dev/null
+++ b/lighttpd.spec
@@ -0,0 +1,86 @@
+Summary: A fast webserver with minimal memory-footprint (lighttpd)
+Name: lighttpd
+Version: 1.4.8
+Release: 1
+Source: http://jan.kneschke.de/projects/lighttpd/download/lighttpd-%version.tar.gz
+Packager: Jan Kneschke <jan@kneschke.de>
+License: BSD
+Group: Networking/Daemons
+URL: http://jan.kneschke.de/projects/lighttpd/
+Requires: pcre >= 3.1 zlib
+BuildPrereq: libtool zlib-devel
+BuildRoot: %{_tmppath}/%{name}-root
+
+
+%description
+lighttpd is intented to be a frontend for ad-servers which have to deliver
+small files concurrently to many connections.
+
+Available rpmbuild rebuild options :
+--with : ssl mysql lua memcache
+
+%prep
+
+%setup -q
+
+%build
+rm -rf %{buildroot}
+%configure \
+ %{?_with_mysql: --with-mysql} \
+ %{?_with_lua: --with-lua} \
+ %{?_with_memcache: --with-memcache} \
+ %{?_with_ssl: --with-openssl}
+make
+
+%install
+
+%makeinstall
+
+mkdir -p %{buildroot}%{_sysconfdir}/{init.d,sysconfig}
+if test -f /etc/redhat-release -o -f /etc/fedora-release; then
+ install -m 755 doc/rc.lighttpd.redhat %{buildroot}%{_sysconfdir}/init.d/lighttpd
+else
+ install -m 755 doc/rc.lighttpd %{buildroot}%{_sysconfdir}/init.d/lighttpd
+fi
+install -m 644 doc/sysconfig.lighttpd %{buildroot}%{_sysconfdir}/sysconfig/lighttpd
+
+%clean
+rm -rf %{buildroot}
+
+%post
+
+if test "$1" = "0"; then
+ # real install, not upgrade
+ /sbin/chkconfig --add lighttpd
+fi
+
+%preun
+if test "$1" = "0"; then
+ # real uninstall, not upgrade
+ %{_sysconfdir}/init.d/lighttpd stop
+ /sbin/chkconfig --del lighttpd
+fi
+
+%files
+%defattr(-,root,root)
+%doc doc/lighttpd.conf doc/lighttpd.user README INSTALL ChangeLog COPYING AUTHORS
+%doc doc/*.txt
+%config(noreplace) %attr(0755,root,root) %{_sysconfdir}/init.d/lighttpd
+%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/lighttpd
+%{_mandir}/*
+%{_libdir}/*
+%{_sbindir}/*
+%{_bindir}/*
+
+%changelog
+* Thu Sep 30 2004 12:41 <jan@kneschke.de> 1.3.1
+- upgraded to 1.3.1
+
+* Tue Jun 29 2004 17:26 <jan@kneschke.de> 1.2.3
+- rpmlint'ed the package
+- added URL
+- added (noreplace) to start-script
+- change group to Networking/Daemon (like apache)
+
+* Sun Feb 23 2003 15:04 <jan@kneschke.de>
+- initial version
diff --git a/lighttpd.spec.in b/lighttpd.spec.in
new file mode 100644
index 0000000..2eab259
--- /dev/null
+++ b/lighttpd.spec.in
@@ -0,0 +1,86 @@
+Summary: A fast webserver with minimal memory-footprint (lighttpd)
+Name: lighttpd
+Version: @VERSION@
+Release: 1
+Source: http://jan.kneschke.de/projects/lighttpd/download/lighttpd-%version.tar.gz
+Packager: Jan Kneschke <jan@kneschke.de>
+License: BSD
+Group: Networking/Daemons
+URL: http://jan.kneschke.de/projects/lighttpd/
+Requires: pcre >= 3.1 zlib
+BuildPrereq: libtool zlib-devel
+BuildRoot: %{_tmppath}/%{name}-root
+
+
+%description
+lighttpd is intented to be a frontend for ad-servers which have to deliver
+small files concurrently to many connections.
+
+Available rpmbuild rebuild options :
+--with : ssl mysql lua memcache
+
+%prep
+
+%setup -q
+
+%build
+rm -rf %{buildroot}
+%configure \
+ %{?_with_mysql: --with-mysql} \
+ %{?_with_lua: --with-lua} \
+ %{?_with_memcache: --with-memcache} \
+ %{?_with_ssl: --with-openssl}
+make
+
+%install
+
+%makeinstall
+
+mkdir -p %{buildroot}%{_sysconfdir}/{init.d,sysconfig}
+if test -f /etc/redhat-release -o -f /etc/fedora-release; then
+ install -m 755 doc/rc.lighttpd.redhat %{buildroot}%{_sysconfdir}/init.d/lighttpd
+else
+ install -m 755 doc/rc.lighttpd %{buildroot}%{_sysconfdir}/init.d/lighttpd
+fi
+install -m 644 doc/sysconfig.lighttpd %{buildroot}%{_sysconfdir}/sysconfig/lighttpd
+
+%clean
+rm -rf %{buildroot}
+
+%post
+
+if test "$1" = "0"; then
+ # real install, not upgrade
+ /sbin/chkconfig --add lighttpd
+fi
+
+%preun
+if test "$1" = "0"; then
+ # real uninstall, not upgrade
+ %{_sysconfdir}/init.d/lighttpd stop
+ /sbin/chkconfig --del lighttpd
+fi
+
+%files
+%defattr(-,root,root)
+%doc doc/lighttpd.conf doc/lighttpd.user README INSTALL ChangeLog COPYING AUTHORS
+%doc doc/*.txt
+%config(noreplace) %attr(0755,root,root) %{_sysconfdir}/init.d/lighttpd
+%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/lighttpd
+%{_mandir}/*
+%{_libdir}/*
+%{_sbindir}/*
+%{_bindir}/*
+
+%changelog
+* Thu Sep 30 2004 12:41 <jan@kneschke.de> 1.3.1
+- upgraded to 1.3.1
+
+* Tue Jun 29 2004 17:26 <jan@kneschke.de> 1.2.3
+- rpmlint'ed the package
+- added URL
+- added (noreplace) to start-script
+- change group to Networking/Daemon (like apache)
+
+* Sun Feb 23 2003 15:04 <jan@kneschke.de>
+- initial version
diff --git a/ltmain.sh b/ltmain.sh
index c7d06c3..9be0eb1 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,130 +1,30 @@
-
-# libtool (GNU libtool) 2.4.2
-# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions. There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful, but
+# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-# --config show all configuration variables
-# --debug enable verbose shell tracing
-# -n, --dry-run display commands without modifying any files
-# --features display basic configuration information and exit
-# --mode=MODE use operation mode MODE
-# --preserve-dup-deps don't remove duplicate dependency libraries
-# --quiet, --silent don't print informational messages
-# --no-quiet, --no-silent
-# print informational messages (default)
-# --no-warn don't display warning messages
-# --tag=TAG use configuration variables from tag TAG
-# -v, --verbose print more informational messages than default
-# --no-verbose don't print the extra informational messages
-# --version print version information
-# -h, --help, --help-all print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-# clean remove files from the build directory
-# compile compile a source file into a libtool object
-# execute automatically set library path, then run a program
-# finish complete the installation of libtool libraries
-# install install libraries or executables
-# link create a library or an executable
-# uninstall remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE. When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-# host-triplet: $host
-# shell: $SHELL
-# compiler: $LTCC
-# compiler flags: $LTCFLAGS
-# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1
-# automake: $automake_version
-# autoconf: $autoconf_version
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-# Report bugs to <bug-libtool@gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
-
-PROGRAM=libtool
-PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1"
-TIMESTAMP=""
-package_revision=1.3337
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
- eval "if test \"\${$lt_var+set}\" = set; then
- save_$lt_var=\$$lt_var
- $lt_var=C
- export $lt_var
- lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
- lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
- fi"
-done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
-
-$lt_unset CDPATH
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+basename="s,^.*/,,g"
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
# is ksh but when the shell is invoked as "sh" and the current value of
@@ -133,1238 +33,152 @@ $lt_unset CDPATH
# function.
progpath="$0"
-
-
-: ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
+# The name of this program:
+progname=`echo "$progpath" | $SED $basename`
+modename="$progname"
# Global variables:
EXIT_SUCCESS=0
EXIT_FAILURE=1
-EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-} # func_dirname may be replaced by extended shell implementation
-
-
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-} # func_basename may be replaced by extended shell implementation
-
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
- func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
-} # func_dirname_and_basename may be replaced by extended shell implementation
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-} # func_stripname may be replaced by extended shell implementation
-
-
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
- s@/\./@/@g
- t dotsl
- s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
-
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-# value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
- # Start from root dir and reassemble the path.
- func_normal_abspath_result=
- func_normal_abspath_tpath=$1
- func_normal_abspath_altnamespace=
- case $func_normal_abspath_tpath in
- "")
- # Empty path, that just means $cwd.
- func_stripname '' '/' "`pwd`"
- func_normal_abspath_result=$func_stripname_result
- return
- ;;
- # The next three entries are used to spot a run of precisely
- # two leading slashes without using negated character classes;
- # we take advantage of case's first-match behaviour.
- ///*)
- # Unusual form of absolute path, do nothing.
- ;;
- //*)
- # Not necessarily an ordinary path; POSIX reserves leading '//'
- # and for example Cygwin uses it to access remote file shares
- # over CIFS/SMB, so we conserve a leading double slash if found.
- func_normal_abspath_altnamespace=/
- ;;
- /*)
- # Absolute path, do nothing.
- ;;
- *)
- # Relative path, prepend $cwd.
- func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
- ;;
- esac
- # Cancel out all the simple stuff to save iterations. We also want
- # the path to end with a slash for ease of parsing, so make sure
- # there is one (and only one) here.
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
- while :; do
- # Processed it all yet?
- if test "$func_normal_abspath_tpath" = / ; then
- # If we ascended to the root using ".." the result may be empty now.
- if test -z "$func_normal_abspath_result" ; then
- func_normal_abspath_result=/
- fi
- break
- fi
- func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$pathcar"`
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$pathcdr"`
- # Figure out what to do with it
- case $func_normal_abspath_tcomponent in
- "")
- # Trailing empty path component, ignore it.
- ;;
- ..)
- # Parent dir; strip last assembled component from result.
- func_dirname "$func_normal_abspath_result"
- func_normal_abspath_result=$func_dirname_result
- ;;
- *)
- # Actual path component, append it.
- func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
- ;;
- esac
- done
- # Restore leading double-slash if one was found on entry.
- func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.16
+TIMESTAMP=" (1.1220.2.235 2005/04/25 18:13:26)"
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-# value returned in "$func_relative_path_result"
-func_relative_path ()
-{
- func_relative_path_result=
- func_normal_abspath "$1"
- func_relative_path_tlibdir=$func_normal_abspath_result
- func_normal_abspath "$2"
- func_relative_path_tbindir=$func_normal_abspath_result
-
- # Ascend the tree starting from libdir
- while :; do
- # check if we have found a prefix of bindir
- case $func_relative_path_tbindir in
- $func_relative_path_tlibdir)
- # found an exact match
- func_relative_path_tcancelled=
- break
- ;;
- $func_relative_path_tlibdir*)
- # found a matching prefix
- func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
- func_relative_path_tcancelled=$func_stripname_result
- if test -z "$func_relative_path_result"; then
- func_relative_path_result=.
- fi
- break
- ;;
- *)
- func_dirname $func_relative_path_tlibdir
- func_relative_path_tlibdir=${func_dirname_result}
- if test "x$func_relative_path_tlibdir" = x ; then
- # Have to descend all the way to the root!
- func_relative_path_result=../$func_relative_path_result
- func_relative_path_tcancelled=$func_relative_path_tbindir
- break
- fi
- func_relative_path_result=../$func_relative_path_result
- ;;
- esac
- done
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes.
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
- # Now calculate path; take care to avoid doubling-up slashes.
- func_stripname '' '/' "$func_relative_path_result"
- func_relative_path_result=$func_stripname_result
- func_stripname '/' '/' "$func_relative_path_tcancelled"
- if test "x$func_stripname_result" != x ; then
- func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
- fi
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell, and then maybe $echo will work.
+ exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
- # Normalisation. If bindir is libdir, return empty string,
- # else relative path ending with a slash; either way, target
- # file name can be directly appended.
- if test ! -z "$func_relative_path_result"; then
- func_stripname './' '' "$func_relative_path_result/"
- func_relative_path_result=$func_stripname_result
- fi
-}
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit $EXIT_SUCCESS
+fi
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
-
-# Make sure we have an absolute path for reexecution:
-case $progpath in
- [\\/]*|[A-Za-z]:\\*) ;;
- *[\\/]*)
- progdir=$func_dirname_result
- progdir=`cd "$progdir" && pwd`
- progpath="$progdir/$progname"
- ;;
- *)
- save_IFS="$IFS"
- IFS=${PATH_SEPARATOR-:}
- for progdir in $PATH; do
- IFS="$save_IFS"
- test -x "$progdir/$progname" && break
- done
- IFS="$save_IFS"
- test -n "$progdir" || progdir=`pwd`
- progpath="$progdir/$progname"
- ;;
-esac
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
-
-# Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
-# (escaped) backslashes. A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
- s/$bs4/&\\
-/g
- s/^$bs2$dollar/$bs&/
- s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
- s/\n//g"
-
-# Standard options:
-opt_dry_run=false
-opt_help=false
-opt_quiet=false
-opt_verbose=false
-opt_warning=:
-
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
- $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
-}
-
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
- $opt_verbose && func_echo ${1+"$@"}
-
- # A bug in bash halts the script if the last line of a function
- # fails when set -e is in force, so we need another command to
- # work around that:
- :
-}
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO "$*"
-}
-
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
-{
- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
-}
-
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
-
- # bash bug again:
- :
-}
-
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
- func_error ${1+"$@"}
- exit $EXIT_FAILURE
-}
-
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
- func_error ${1+"$@"}
- func_fatal_error "$help"
-}
-help="Try \`$progname --help' for more information." ## default
-
-
-# func_grep expression filename
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
- $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_mkdir_p directory-path
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
- my_directory_path="$1"
- my_dir_list=
-
- if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
-
- # Protect directory names starting with `-'
- case $my_directory_path in
- -*) my_directory_path="./$my_directory_path" ;;
- esac
-
- # While some portion of DIR does not yet exist...
- while test ! -d "$my_directory_path"; do
- # ...make a list in topmost first order. Use a colon delimited
- # list incase some portion of path contains whitespace.
- my_dir_list="$my_directory_path:$my_dir_list"
-
- # If the last portion added has no slash in it, the list is done
- case $my_directory_path in */*) ;; *) break ;; esac
-
- # ...otherwise throw away the child directory and loop
- my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
- done
- my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
-
- save_mkdir_p_IFS="$IFS"; IFS=':'
- for my_dir in $my_dir_list; do
- IFS="$save_mkdir_p_IFS"
- # mkdir can fail with a `File exist' error if two processes
- # try to create one of the directories concurrently. Don't
- # stop in that case!
- $MKDIR "$my_dir" 2>/dev/null || :
- done
- IFS="$save_mkdir_p_IFS"
-
- # Bail out if we (or some other process) failed to create a directory.
- test -d "$my_directory_path" || \
- func_fatal_error "Failed to create \`$1'"
- fi
-}
-
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible. If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
- my_template="${TMPDIR-/tmp}/${1-$progname}"
-
- if test "$opt_dry_run" = ":"; then
- # Return a directory name, but don't create it in dry-run mode
- my_tmpdir="${my_template}-$$"
- else
-
- # If mktemp works, use that first and foremost
- my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
- if test ! -d "$my_tmpdir"; then
- # Failing that, at least try and use $RANDOM to avoid a race
- my_tmpdir="${my_template}-${RANDOM-0}$$"
-
- save_mktempdir_umask=`umask`
- umask 0077
- $MKDIR "$my_tmpdir"
- umask $save_mktempdir_umask
- fi
-
- # If we're not in dry-run mode, bomb out on failure
- test -d "$my_tmpdir" || \
- func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
- fi
-
- $ECHO "$my_tmpdir"
-}
-
-
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
-{
- case $1 in
- *[\\\`\"\$]*)
- func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
- *)
- func_quote_for_eval_unquoted_result="$1" ;;
- esac
-
- case $func_quote_for_eval_unquoted_result in
- # Double-quote args containing shell metacharacters to delay
- # word splitting, command substitution and and variable
- # expansion for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
- ;;
- *)
- func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
- esac
-}
-
-
-# func_quote_for_expand arg
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
- case $1 in
- *[\\\`\"]*)
- my_arg=`$ECHO "$1" | $SED \
- -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
- *)
- my_arg="$1" ;;
- esac
-
- case $my_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting and command substitution for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- my_arg="\"$my_arg\""
- ;;
- esac
-
- func_quote_for_expand_result="$my_arg"
-}
-
-
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
- my_cmd="$1"
- my_fail_exp="${2-:}"
-
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
-
- if ${opt_dry_run-false}; then :; else
- eval "$my_cmd"
- my_status=$?
- if test "$my_status" -eq 0; then :; else
- eval "(exit $my_status); $my_fail_exp"
- fi
- fi
-}
-
-
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it. Use the saved locale for evaluation.
-func_show_eval_locale ()
-{
- my_cmd="$1"
- my_fail_exp="${2-:}"
-
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
-
- if ${opt_dry_run-false}; then :; else
- eval "$lt_user_locale
- $my_cmd"
- my_status=$?
- eval "$lt_safe_locale"
- if test "$my_status" -eq 0; then :; else
- eval "(exit $my_status); $my_fail_exp"
- fi
- fi
-}
-
-# func_tr_sh
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result. All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
- case $1 in
- [0-9]* | *[!a-zA-Z0-9_]*)
- func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
- ;;
- * )
- func_tr_sh_result=$1
- ;;
- esac
-}
-
-
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
- $opt_debug
-
- $SED -n '/(C)/!b go
- :more
- /\./!{
- N
- s/\n# / /
- b more
- }
- :go
- /^# '$PROGRAM' (GNU /,/# warranty; / {
- s/^# //
- s/^# *$//
- s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
- p
- }' < "$progpath"
- exit $?
-}
-
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
-{
- $opt_debug
-
- $SED -n '/^# Usage:/,/^# *.*--help/ {
- s/^# //
- s/^# *$//
- s/\$progname/'$progname'/
- p
- }' < "$progpath"
- echo
- $ECHO "run \`$progname --help | more' for full usage"
- exit $?
-}
-
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
-func_help ()
-{
- $opt_debug
-
- $SED -n '/^# Usage:/,/# Report bugs to/ {
- :print
- s/^# //
- s/^# *$//
- s*\$progname*'$progname'*
- s*\$host*'"$host"'*
- s*\$SHELL*'"$SHELL"'*
- s*\$LTCC*'"$LTCC"'*
- s*\$LTCFLAGS*'"$LTCFLAGS"'*
- s*\$LD*'"$LD"'*
- s/\$with_gnu_ld/'"$with_gnu_ld"'/
- s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
- s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
- p
- d
- }
- /^# .* home page:/b print
- /^# General help using/b print
- ' < "$progpath"
- ret=$?
- if test -z "$1"; then
- exit $ret
- fi
-}
-
-# func_missing_arg argname
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
- $opt_debug
-
- func_error "missing argument for $1."
- exit_cmd=exit
-}
-
-
-# func_split_short_opt shortopt
-# Set func_split_short_opt_name and func_split_short_opt_arg shell
-# variables after splitting SHORTOPT after the 2nd character.
-func_split_short_opt ()
-{
- my_sed_short_opt='1s/^\(..\).*$/\1/;q'
- my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
-
- func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
- func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
-} # func_split_short_opt may be replaced by extended shell implementation
-
-
-# func_split_long_opt longopt
-# Set func_split_long_opt_name and func_split_long_opt_arg shell
-# variables after splitting LONGOPT at the `=' sign.
-func_split_long_opt ()
-{
- my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
- my_sed_long_arg='1s/^--[^=]*=//'
-
- func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
- func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
-} # func_split_long_opt may be replaced by extended shell implementation
-
-exit_cmd=:
-
-
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII
+case `echo A|tr A '\301'` in
+ A) # EBCDIC based system
+ SP2NL="tr '\100' '\n'"
+ NL2SP="tr '\r\n' '\100\100'"
+ ;;
+ *) # Assume ASCII based system
+ SP2NL="tr '\040' '\012'"
+ NL2SP="tr '\015\012' '\040\040'"
+ ;;
+esac
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+ save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+ save_LANG="$LANG"; LANG=C; export LANG
+fi
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ $echo "$modename: not configured to build any kind of library" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit $EXIT_FAILURE
+fi
# Global variables.
+mode=$default_mode
nonopt=
-preserve_args=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end. This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "${1}=\$${1}\${2}"
-} # func_append may be replaced by extended shell implementation
-
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
-{
- func_quote_for_eval "${2}"
- eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
-} # func_append_quoted may be replaced by extended shell implementation
-
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=`expr "${@}"`
-} # func_arith may be replaced by extended shell implementation
-
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
-} # func_len may be replaced by extended shell implementation
-
-
-# func_lo2o object
-func_lo2o ()
-{
- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-} # func_lo2o may be replaced by extended shell implementation
-
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-} # func_xform may be replaced by extended shell implementation
-
-
-# func_fatal_configuration arg...
-# Echo program name prefixed message to standard error, followed by
-# a configuration failure hint, and exit.
-func_fatal_configuration ()
-{
- func_error ${1+"$@"}
- func_error "See the $PACKAGE documentation for more information."
- func_fatal_error "Fatal configuration error."
-}
-
-
-# func_config
-# Display the configuration for all the tags in this script.
-func_config ()
-{
- re_begincf='^# ### BEGIN LIBTOOL'
- re_endcf='^# ### END LIBTOOL'
-
- # Default configuration.
- $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
-
- # Now print the configurations for the tags.
- for tagname in $taglist; do
- $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
- done
-
- exit $?
-}
-
-# func_features
-# Display the features supported by this script.
-func_features ()
-{
- echo "host: $host"
- if test "$build_libtool_libs" = yes; then
- echo "enable shared libraries"
- else
- echo "disable shared libraries"
- fi
- if test "$build_old_libs" = yes; then
- echo "enable static libraries"
- else
- echo "disable static libraries"
- fi
-
- exit $?
-}
-
-# func_enable_tag tagname
-# Verify that TAGNAME is valid, and either flag an error and exit, or
-# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
-# variable here.
-func_enable_tag ()
-{
- # Global variable:
- tagname="$1"
+quote_scanset='[[~#^*{};<>?'"'"' ]'
- re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
- re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
- sed_extractcf="/$re_begincf/,/$re_endcf/p"
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
- # Validate tagname.
- case $tagname in
- *[!-_A-Za-z0-9,/]*)
- func_fatal_error "invalid tag name: $tagname"
- ;;
- esac
-
- # Don't test for the "default" C tag, as we know it's
- # there but not specially marked.
- case $tagname in
- CC) ;;
- *)
- if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
- taglist="$taglist $tagname"
-
- # Evaluate the configuration. Be careful to quote the path
- # and the sed script, to avoid splitting on whitespace, but
- # also don't use non-portable quotes within backquotes within
- # quotes we have to do it in 2 steps:
- extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
- eval "$extractedcf"
- else
- func_error "ignoring unknown tag $tagname"
- fi
- ;;
- esac
-}
-
-# func_check_version_match
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
{
- if test "$package_revision" != "$macro_revision"; then
- if test "$VERSION" != "$macro_version"; then
- if test -z "$macro_version"; then
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+ win32_nmres=`eval $NM -f posix -A $1 | \
+ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
+ if test "X$win32_nmres" = "Ximport" ; then
+ win32_libid_type="x86 archive import"
else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
+ win32_libid_type="x86 archive static"
fi
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
fi
-
- exit $EXIT_MISMATCH
- fi
-}
-
-
-# Shorthand for --mode=foo, only valid as the first argument
-case $1 in
-clean|clea|cle|cl)
- shift; set dummy --mode clean ${1+"$@"}; shift
- ;;
-compile|compil|compi|comp|com|co|c)
- shift; set dummy --mode compile ${1+"$@"}; shift
- ;;
-execute|execut|execu|exec|exe|ex|e)
- shift; set dummy --mode execute ${1+"$@"}; shift
- ;;
-finish|finis|fini|fin|fi|f)
- shift; set dummy --mode finish ${1+"$@"}; shift
- ;;
-install|instal|insta|inst|ins|in|i)
- shift; set dummy --mode install ${1+"$@"}; shift
- ;;
-link|lin|li|l)
- shift; set dummy --mode link ${1+"$@"}; shift
- ;;
-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
- shift; set dummy --mode uninstall ${1+"$@"}; shift
- ;;
-esac
-
-
-
-# Option defaults:
-opt_debug=:
-opt_dry_run=false
-opt_config=false
-opt_preserve_dup_deps=false
-opt_features=false
-opt_finish=false
-opt_help=false
-opt_help_all=false
-opt_silent=:
-opt_warning=:
-opt_verbose=:
-opt_silent=false
-opt_verbose=false
-
-
-# Parse options once, thoroughly. This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
-{
- # this just eases exit handling
- while test $# -gt 0; do
- opt="$1"
- shift
- case $opt in
- --debug|-x) opt_debug='set -x'
- func_echo "enabling shell trace mode"
- $opt_debug
- ;;
- --dry-run|--dryrun|-n)
- opt_dry_run=:
- ;;
- --config)
- opt_config=:
-func_config
- ;;
- --dlopen|-dlopen)
- optarg="$1"
- opt_dlopen="${opt_dlopen+$opt_dlopen
-}$optarg"
- shift
- ;;
- --preserve-dup-deps)
- opt_preserve_dup_deps=:
- ;;
- --features)
- opt_features=:
-func_features
- ;;
- --finish)
- opt_finish=:
-set dummy --mode finish ${1+"$@"}; shift
- ;;
- --help)
- opt_help=:
- ;;
- --help-all)
- opt_help_all=:
-opt_help=': help-all'
- ;;
- --mode)
- test $# = 0 && func_missing_arg $opt && break
- optarg="$1"
- opt_mode="$optarg"
-case $optarg in
- # Valid mode arguments:
- clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
- # Catch anything else as an error
- *) func_error "invalid argument for $opt"
- exit_cmd=exit
- break
- ;;
-esac
- shift
- ;;
- --no-silent|--no-quiet)
- opt_silent=false
-func_append preserve_args " $opt"
- ;;
- --no-warning|--no-warn)
- opt_warning=false
-func_append preserve_args " $opt"
- ;;
- --no-verbose)
- opt_verbose=false
-func_append preserve_args " $opt"
- ;;
- --silent|--quiet)
- opt_silent=:
-func_append preserve_args " $opt"
- opt_verbose=false
- ;;
- --verbose|-v)
- opt_verbose=:
-func_append preserve_args " $opt"
-opt_silent=false
- ;;
- --tag)
- test $# = 0 && func_missing_arg $opt && break
- optarg="$1"
- opt_tag="$optarg"
-func_append preserve_args " $opt $optarg"
-func_enable_tag "$optarg"
- shift
- ;;
-
- -\?|-h) func_usage ;;
- --help) func_help ;;
- --version) func_version ;;
-
- # Separate optargs to long options:
- --*=*)
- func_split_long_opt "$opt"
- set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
- shift
- ;;
-
- # Separate non-argument short options:
- -\?*|-h*|-n*|-v*)
- func_split_short_opt "$opt"
- set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
- shift
- ;;
-
- --) break ;;
- -*) func_fatal_help "unrecognized option \`$opt'" ;;
- *) set dummy "$opt" ${1+"$@"}; shift; break ;;
- esac
- done
-
- # Validate options:
-
- # save first non-option argument
- if test "$#" -gt 0; then
- nonopt="$opt"
- shift
- fi
-
- # preserve --debug
- test "$opt_debug" = : || func_append preserve_args " --debug"
-
- case $host in
- *cygwin* | *mingw* | *pw32* | *cegcc*)
- # don't eliminate duplications in $postdeps and $predeps
- opt_duplicate_compiler_generated_deps=:
- ;;
- *)
- opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
;;
- esac
-
- $opt_help || {
- # Sanity checks first:
- func_check_version_match
-
- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- func_fatal_configuration "not configured to build any kind of library"
- fi
-
- # Darwin sucks
- eval std_shrext=\"$shrext_cmds\"
-
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
- func_error "unrecognized option \`-dlopen'"
- $ECHO "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Change the help message to a mode-specific one.
- generic_help="$help"
- help="Try \`$progname --help --mode=$opt_mode' for more information."
- }
-
-
- # Bail if the options were screwed
- $exit_cmd $EXIT_FAILURE
-}
-
-
-
-
-## ----------- ##
-## Main. ##
-## ----------- ##
-
-# func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_lalib_p ()
-{
- test -f "$1" &&
- $SED -e 4q "$1" 2>/dev/null \
- | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-}
-
-# func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function implements the same check as func_lalib_p without
-# resorting to external programs. To this end, it redirects stdin and
-# closes it afterwards, without saving the original file descriptor.
-# As a safety measure, use it only where a negative result would be
-# fatal anyway. Works if `file' does not exist.
-func_lalib_unsafe_p ()
-{
- lalib_p=no
- if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
- for lalib_p_l in 1 2 3 4
- do
- read lalib_p_line
- case "$lalib_p_line" in
- \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
- esac
- done
- exec 0<&5 5<&-
- fi
- test "$lalib_p" = yes
-}
-
-# func_ltwrapper_script_p file
-# True iff FILE is a libtool wrapper script
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_script_p ()
-{
- func_lalib_p "$1"
-}
-
-# func_ltwrapper_executable_p file
-# True iff FILE is a libtool wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_executable_p ()
-{
- func_ltwrapper_exec_suffix=
- case $1 in
- *.exe) ;;
- *) func_ltwrapper_exec_suffix=.exe ;;
esac
- $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
-}
-
-# func_ltwrapper_scriptname file
-# Assumes file is an ltwrapper_executable
-# uses $file to determine the appropriate filename for a
-# temporary ltwrapper_script.
-func_ltwrapper_scriptname ()
-{
- func_dirname_and_basename "$1" "" "."
- func_stripname '' '.exe' "$func_basename_result"
- func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
-}
-
-# func_ltwrapper_p file
-# True iff FILE is a libtool wrapper script or wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_p ()
-{
- func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
-}
-
-
-# func_execute_cmds commands fail_cmd
-# Execute tilde-delimited COMMANDS.
-# If FAIL_CMD is given, eval that upon failure.
-# FAIL_CMD may read-access the current command in variable CMD!
-func_execute_cmds ()
-{
- $opt_debug
- save_ifs=$IFS; IFS='~'
- for cmd in $1; do
- IFS=$save_ifs
- eval cmd=\"$cmd\"
- func_show_eval "$cmd" "${2-:}"
- done
- IFS=$save_ifs
-}
-
-
-# func_source file
-# Source FILE, adding directory component if necessary.
-# Note that it is not necessary on cygwin/mingw to append a dot to
-# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
-# behavior happens only for exec(3), not for open(2)! Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
-func_source ()
-{
- $opt_debug
- case $1 in
- */* | *\\*) . "$1" ;;
- *) . "./$1" ;;
- esac
-}
-
-
-# func_resolve_sysroot PATH
-# Replace a leading = in PATH with a sysroot. Store the result into
-# func_resolve_sysroot_result
-func_resolve_sysroot ()
-{
- func_resolve_sysroot_result=$1
- case $func_resolve_sysroot_result in
- =*)
- func_stripname '=' '' "$func_resolve_sysroot_result"
- func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
;;
esac
+ $echo $win32_libid_type
}
-# func_replace_sysroot PATH
-# If PATH begins with the sysroot, replace it with = and
-# store the result into func_replace_sysroot_result.
-func_replace_sysroot ()
-{
- case "$lt_sysroot:$1" in
- ?*:"$lt_sysroot"*)
- func_stripname "$lt_sysroot" '' "$1"
- func_replace_sysroot_result="=$func_stripname_result"
- ;;
- *)
- # Including no sysroot.
- func_replace_sysroot_result=$1
- ;;
- esac
-}
# func_infer_tag arg
# Infer tagged configuration to use if any are available and
@@ -1374,36 +188,39 @@ func_replace_sysroot ()
# arg is usually of the form 'gcc ...'
func_infer_tag ()
{
- $opt_debug
if test -n "$available_tags" && test -z "$tagname"; then
CC_quoted=
for arg in $CC; do
- func_append_quoted CC_quoted "$arg"
+ case $arg in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ arg="\"$arg\""
+ ;;
+ esac
+ CC_quoted="$CC_quoted $arg"
done
- CC_expanded=`func_echo_all $CC`
- CC_quoted_expanded=`func_echo_all $CC_quoted`
case $@ in
# Blanks in the command may have been stripped by the calling shell,
# but not from the CC environment variable when configure was run.
- " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
- " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
# Blanks at the start of $base_compile will cause this to fail
# if we don't check for them as well.
*)
for z in $available_tags; do
- if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
# Evaluate the configuration.
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
CC_quoted=
for arg in $CC; do
- # Double-quote args containing other shell metacharacters.
- func_append_quoted CC_quoted "$arg"
- done
- CC_expanded=`func_echo_all $CC`
- CC_quoted_expanded=`func_echo_all $CC_quoted`
+ # Double-quote args containing other shell metacharacters.
+ case $arg in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ arg="\"$arg\""
+ ;;
+ esac
+ CC_quoted="$CC_quoted $arg"
+ done
case "$@ " in
- " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
- " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
# The compiler in the base compile command matches
# the one in the tagged configuration.
# Assume this is the tagged configuration we want.
@@ -1417,10 +234,11 @@ func_infer_tag ()
# was found and let the user know that the "--tag" command
# line option must be used.
if test -z "$tagname"; then
- func_echo "unable to infer tagged configuration"
- func_fatal_error "specify a tag with \`--tag'"
-# else
-# func_verbose "using $tagname tagged configuration"
+ $echo "$modename: unable to infer tagged configuration"
+ $echo "$modename: specify a tag with \`--tag'" 1>&2
+ exit $EXIT_FAILURE
+# else
+# $echo "$modename: using $tagname tagged configuration"
fi
;;
esac
@@ -1428,528 +246,325 @@ func_infer_tag ()
}
-
-# func_write_libtool_object output_name pic_name nonpic_name
-# Create a libtool object file (analogous to a ".la" file),
-# but don't create it if we're doing a dry run.
-func_write_libtool_object ()
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
{
- write_libobj=${1}
- if test "$build_libtool_libs" = yes; then
- write_lobj=\'${2}\'
- else
- write_lobj=none
- fi
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
- if test "$build_old_libs" = yes; then
- write_oldobj=\'${3}\'
+ $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+ $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
else
- write_oldobj=none
+ $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
+ exit $EXIT_FAILURE
fi
-
- $opt_dry_run || {
- cat >${write_libobj}T <<EOF
-# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-pic_object=$write_lobj
-
-# Name of the non-PIC object
-non_pic_object=$write_oldobj
-
-EOF
- $MV "${write_libobj}T" "${write_libobj}"
- }
}
-
-##################################################
-# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
-##################################################
-
-# func_convert_core_file_wine_to_w32 ARG
-# Helper function used by file name conversion functions when $build is *nix,
-# and $host is mingw, cygwin, or some other w32 environment. Relies on a
-# correctly configured wine environment available, with the winepath program
-# in $build's $PATH.
-#
-# ARG is the $build file name to be converted to w32 format.
-# Result is available in $func_convert_core_file_wine_to_w32_result, and will
-# be empty on error (or when ARG is empty)
-func_convert_core_file_wine_to_w32 ()
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
{
- $opt_debug
- func_convert_core_file_wine_to_w32_result="$1"
- if test -n "$1"; then
- # Unfortunately, winepath does not exit with a non-zero error code, so we
- # are forced to check the contents of stdout. On the other hand, if the
- # command is not found, the shell will set an exit code of 127 and print
- # *an error message* to stdout. So we must check for both error code of
- # zero AND non-empty stdout, which explains the odd construction:
- func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
- if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
- func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
- $SED -e "$lt_sed_naive_backslashify"`
- else
- func_convert_core_file_wine_to_w32_result=
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+ my_status=""
+
+ $show "${rm}r $my_gentop"
+ $run ${rm}r "$my_gentop"
+ $show "$mkdir $my_gentop"
+ $run $mkdir "$my_gentop"
+ my_status=$?
+ if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
+ exit $my_status
fi
- fi
-}
-# end: func_convert_core_file_wine_to_w32
-
-# func_convert_core_path_wine_to_w32 ARG
-# Helper function used by path conversion functions when $build is *nix, and
-# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-# configured wine environment available, with the winepath program in $build's
-# $PATH. Assumes ARG has no leading or trailing path separator characters.
-#
-# ARG is path to be converted from $build format to win32.
-# Result is available in $func_convert_core_path_wine_to_w32_result.
-# Unconvertible file (directory) names in ARG are skipped; if no directory names
-# are convertible, then the result may be empty.
-func_convert_core_path_wine_to_w32 ()
-{
- $opt_debug
- # unfortunately, winepath doesn't convert paths, only file names
- func_convert_core_path_wine_to_w32_result=""
- if test -n "$1"; then
- oldIFS=$IFS
- IFS=:
- for func_convert_core_path_wine_to_w32_f in $1; do
- IFS=$oldIFS
- func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
- if test -n "$func_convert_core_file_wine_to_w32_result" ; then
- if test -z "$func_convert_core_path_wine_to_w32_result"; then
- func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
- else
- func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
- fi
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
+ my_xdir="$my_gentop/$my_xlib"
+
+ $show "${rm}r $my_xdir"
+ $run ${rm}r "$my_xdir"
+ $show "$mkdir $my_xdir"
+ $run $mkdir "$my_xdir"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$my_xdir"; then
+ exit $status
fi
+ case $host in
+ *-darwin*)
+ $show "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ if test -z "$run"; then
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
+ darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ $show "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we have a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+ lipo -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ ${rm}r unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd "$darwin_orig_dir"
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ fi # $run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
done
- IFS=$oldIFS
- fi
-}
-# end: func_convert_core_path_wine_to_w32
-
-
-# func_cygpath ARGS...
-# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
-# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
-# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
-# (2), returns the Cygwin file name or path in func_cygpath_result (input
-# file name or path is assumed to be in w32 format, as previously converted
-# from $build's *nix or MSYS format). In case (3), returns the w32 file name
-# or path in func_cygpath_result (input file name or path is assumed to be in
-# Cygwin format). Returns an empty string on error.
-#
-# ARGS are passed to cygpath, with the last one being the file name or path to
-# be converted.
-#
-# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
-# environment variable; do not put it in $PATH.
-func_cygpath ()
-{
- $opt_debug
- if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
- func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
- if test "$?" -ne 0; then
- # on failure, ensure result is empty
- func_cygpath_result=
- fi
- else
- func_cygpath_result=
- func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
- fi
-}
-#end: func_cygpath
-
-
-# func_convert_core_msys_to_w32 ARG
-# Convert file name or path ARG from MSYS format to w32 format. Return
-# result in func_convert_core_msys_to_w32_result.
-func_convert_core_msys_to_w32 ()
-{
- $opt_debug
- # awkward: cmd appends spaces to result
- func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
-}
-#end: func_convert_core_msys_to_w32
-
-
-# func_convert_file_check ARG1 ARG2
-# Verify that ARG1 (a file name in $build format) was converted to $host
-# format in ARG2. Otherwise, emit an error message, but continue (resetting
-# func_to_host_file_result to ARG1).
-func_convert_file_check ()
-{
- $opt_debug
- if test -z "$2" && test -n "$1" ; then
- func_error "Could not determine host file name corresponding to"
- func_error " \`$1'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback:
- func_to_host_file_result="$1"
- fi
+ func_extract_archives_result="$my_oldobjs"
}
-# end func_convert_file_check
+# End of Shell function definitions
+#####################################
+# Darwin sucks
+eval std_shrext=\"$shrext_cmds\"
-# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
-# Verify that FROM_PATH (a path in $build format) was converted to $host
-# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
-# func_to_host_file_result to a simplistic fallback value (see below).
-func_convert_path_check ()
-{
- $opt_debug
- if test -z "$4" && test -n "$3"; then
- func_error "Could not determine the host path corresponding to"
- func_error " \`$3'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback. This is a deliberately simplistic "conversion" and
- # should not be "improved". See libtool.info.
- if test "x$1" != "x$2"; then
- lt_replace_pathsep_chars="s|$1|$2|g"
- func_to_host_path_result=`echo "$3" |
- $SED -e "$lt_replace_pathsep_chars"`
- else
- func_to_host_path_result="$3"
- fi
- fi
-}
-# end func_convert_path_check
-
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+ arg="$1"
+ shift
-# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
-# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
-# and appending REPL if ORIG matches BACKPAT.
-func_convert_path_front_back_pathsep ()
-{
- $opt_debug
- case $4 in
- $1 ) func_to_host_path_result="$3$func_to_host_path_result"
- ;;
- esac
- case $4 in
- $2 ) func_append func_to_host_path_result "$3"
- ;;
+ case $arg in
+ -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
esac
-}
-# end func_convert_path_front_back_pathsep
-
-
-##################################################
-# $build to $host FILE NAME CONVERSION FUNCTIONS #
-##################################################
-# invoked via `$to_host_file_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# Result will be available in $func_to_host_file_result.
-
-
-# func_to_host_file ARG
-# Converts the file name ARG from $build format to $host format. Return result
-# in func_to_host_file_result.
-func_to_host_file ()
-{
- $opt_debug
- $to_host_file_cmd "$1"
-}
-# end func_to_host_file
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ execute_dlfiles)
+ execute_dlfiles="$execute_dlfiles $arg"
+ ;;
+ tag)
+ tagname="$arg"
+ preserve_args="${preserve_args}=$arg"
+
+ # Check whether tagname contains only valid characters
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ $echo "$progname: invalid tag name: $tagname" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
-# func_to_tool_file ARG LAZY
-# converts the file name ARG from $build format to toolchain format. Return
-# result in func_to_tool_file_result. If the conversion in use is listed
-# in (the comma separated) LAZY, no conversion takes place.
-func_to_tool_file ()
-{
- $opt_debug
- case ,$2, in
- *,"$to_tool_file_cmd",*)
- func_to_tool_file_result=$1
+ case $tagname in
+ CC)
+ # Don't test for the "default" C tag, as we know, it's there, but
+ # not specially marked.
+ ;;
+ *)
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
+ taglist="$taglist $tagname"
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
+ else
+ $echo "$progname: ignoring unknown tag $tagname" 1>&2
+ fi
+ ;;
+ esac
;;
*)
- $to_tool_file_cmd "$1"
- func_to_tool_file_result=$func_to_host_file_result
+ eval "$prev=\$arg"
;;
- esac
-}
-# end func_to_tool_file
-
-
-# func_convert_file_noop ARG
-# Copy ARG to func_to_host_file_result.
-func_convert_file_noop ()
-{
- func_to_host_file_result="$1"
-}
-# end func_convert_file_noop
-
-
-# func_convert_file_msys_to_w32 ARG
-# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper. Returns result in
-# func_to_host_file_result.
-func_convert_file_msys_to_w32 ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- func_convert_core_msys_to_w32 "$1"
- func_to_host_file_result="$func_convert_core_msys_to_w32_result"
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_w32
-
+ esac
-# func_convert_file_cygwin_to_w32 ARG
-# Convert file name ARG from Cygwin to w32 format. Returns result in
-# func_to_host_file_result.
-func_convert_file_cygwin_to_w32 ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
- # LT_CYGPATH in this case.
- func_to_host_file_result=`cygpath -m "$1"`
+ prev=
+ prevopt=
+ continue
fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_cygwin_to_w32
-
-# func_convert_file_nix_to_w32 ARG
-# Convert file name ARG from *nix to w32 format. Requires a wine environment
-# and a working winepath. Returns result in func_to_host_file_result.
-func_convert_file_nix_to_w32 ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- func_convert_core_file_wine_to_w32 "$1"
- func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_w32
+ # Have we seen a non-optional argument yet?
+ case $arg in
+ --help)
+ show_help=yes
+ ;;
+ --version)
+ $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+ $echo
+ $echo "Copyright (C) 2005 Free Software Foundation, Inc."
+ $echo "This is free software; see the source for copying conditions. There is NO"
+ $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+ exit $?
+ ;;
-# func_convert_file_msys_to_cygwin ARG
-# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_file_msys_to_cygwin ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- func_convert_core_msys_to_w32 "$1"
- func_cygpath -u "$func_convert_core_msys_to_w32_result"
- func_to_host_file_result="$func_cygpath_result"
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_cygwin
+ --config)
+ ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
+ done
+ exit $?
+ ;;
+ --debug)
+ $echo "$progname: enabling shell trace mode"
+ set -x
+ preserve_args="$preserve_args $arg"
+ ;;
-# func_convert_file_nix_to_cygwin ARG
-# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
-# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
-# in func_to_host_file_result.
-func_convert_file_nix_to_cygwin ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
- func_convert_core_file_wine_to_w32 "$1"
- func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
- func_to_host_file_result="$func_cygpath_result"
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_cygwin
+ --dry-run | -n)
+ run=:
+ ;;
+ --features)
+ $echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ $echo "enable shared libraries"
+ else
+ $echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ $echo "enable static libraries"
+ else
+ $echo "disable static libraries"
+ fi
+ exit $?
+ ;;
-#############################################
-# $build to $host PATH CONVERSION FUNCTIONS #
-#############################################
-# invoked via `$to_host_path_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# The result will be available in $func_to_host_path_result.
-#
-# Path separators are also converted from $build format to $host format. If
-# ARG begins or ends with a path separator character, it is preserved (but
-# converted to $host format) on output.
-#
-# All path conversion functions are named using the following convention:
-# file name conversion function : func_convert_file_X_to_Y ()
-# path conversion function : func_convert_path_X_to_Y ()
-# where, for any given $build/$host combination the 'X_to_Y' value is the
-# same. If conversion functions are added for new $build/$host combinations,
-# the two new functions must follow this pattern, or func_init_to_host_path_cmd
-# will break.
-
-
-# func_init_to_host_path_cmd
-# Ensures that function "pointer" variable $to_host_path_cmd is set to the
-# appropriate value, based on the value of $to_host_file_cmd.
-to_host_path_cmd=
-func_init_to_host_path_cmd ()
-{
- $opt_debug
- if test -z "$to_host_path_cmd"; then
- func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
- to_host_path_cmd="func_convert_path_${func_stripname_result}"
- fi
-}
+ --finish) mode="finish" ;;
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
-# func_to_host_path ARG
-# Converts the path ARG from $build format to $host format. Return result
-# in func_to_host_path_result.
-func_to_host_path ()
-{
- $opt_debug
- func_init_to_host_path_cmd
- $to_host_path_cmd "$1"
-}
-# end func_to_host_path
+ --preserve-dup-deps) duplicate_deps="yes" ;;
+ --quiet | --silent)
+ show=:
+ preserve_args="$preserve_args $arg"
+ ;;
-# func_convert_path_noop ARG
-# Copy ARG to func_to_host_path_result.
-func_convert_path_noop ()
-{
- func_to_host_path_result="$1"
-}
-# end func_convert_path_noop
+ --tag) prevopt="--tag" prev=tag ;;
+ --tag=*)
+ set tag "$optarg" ${1+"$@"}
+ shift
+ prev=tag
+ preserve_args="$preserve_args --tag"
+ ;;
+ -dlopen)
+ prevopt="-dlopen"
+ prev=execute_dlfiles
+ ;;
-# func_convert_path_msys_to_w32 ARG
-# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper. Returns result in
-# func_to_host_path_result.
-func_convert_path_msys_to_w32 ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # Remove leading and trailing path separator characters from ARG. MSYS
- # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
- # and winepath ignores them completely.
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
- func_to_host_path_result="$func_convert_core_msys_to_w32_result"
- func_convert_path_check : ";" \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- fi
-}
-# end func_convert_path_msys_to_w32
+ -*)
+ $echo "$modename: unrecognized option \`$arg'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ *)
+ nonopt="$arg"
+ break
+ ;;
+ esac
+done
-# func_convert_path_cygwin_to_w32 ARG
-# Convert path ARG from Cygwin to w32 format. Returns result in
-# func_to_host_file_result.
-func_convert_path_cygwin_to_w32 ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # See func_convert_path_msys_to_w32:
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
- func_convert_path_check : ";" \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- fi
-}
-# end func_convert_path_cygwin_to_w32
+if test -n "$prevopt"; then
+ $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+fi
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
-# func_convert_path_nix_to_w32 ARG
-# Convert path ARG from *nix to w32 format. Requires a wine environment and
-# a working winepath. Returns result in func_to_host_file_result.
-func_convert_path_nix_to_w32 ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # See func_convert_path_msys_to_w32:
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
- func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
- func_convert_path_check : ";" \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- fi
-}
-# end func_convert_path_nix_to_w32
+if test -z "$show_help"; then
+ # Infer the operation mode.
+ if test -z "$mode"; then
+ $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+ $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
+ case $nonopt in
+ *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+ mode=link
+ for arg
+ do
+ case $arg in
+ -c)
+ mode=compile
+ break
+ ;;
+ esac
+ done
+ ;;
+ *db | *dbx | *strace | *truss)
+ mode=execute
+ ;;
+ *install*|cp|mv)
+ mode=install
+ ;;
+ *rm)
+ mode=uninstall
+ ;;
+ *)
+ # If we have no mode, but dlfiles were specified, then do execute mode.
+ test -n "$execute_dlfiles" && mode=execute
-# func_convert_path_msys_to_cygwin ARG
-# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_path_msys_to_cygwin ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # See func_convert_path_msys_to_w32:
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
- func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
- func_to_host_path_result="$func_cygpath_result"
- func_convert_path_check : : \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ # Just use the default operation mode.
+ if test -z "$mode"; then
+ if test -n "$nonopt"; then
+ $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+ else
+ $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+ fi
+ fi
+ ;;
+ esac
fi
-}
-# end func_convert_path_msys_to_cygwin
-
-# func_convert_path_nix_to_cygwin ARG
-# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
-# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
-# func_to_host_file_result.
-func_convert_path_nix_to_cygwin ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # Remove leading and trailing path separator characters from
- # ARG. msys behavior is inconsistent here, cygpath turns them
- # into '.;' and ';.', and winepath ignores them completely.
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
- func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
- func_to_host_path_result="$func_cygpath_result"
- func_convert_path_check : : \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
+ $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
fi
-}
-# end func_convert_path_nix_to_cygwin
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$modename --help --mode=$mode' for more information."
-# func_mode_compile arg...
-func_mode_compile ()
-{
- $opt_debug
+ # These modes are in order of execution frequency so that they run quickly.
+ case $mode in
+ # libtool compile mode
+ compile)
+ modename="$modename: compile"
# Get the compilation command and the source file.
base_compile=
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
@@ -1958,11 +573,10 @@ func_mode_compile ()
arg_mode=normal
libobj=
later=
- pie_flag=
for arg
do
- case $arg_mode in
+ case "$arg_mode" in
arg )
# do not "continue". Instead, add this to base_compile
lastarg="$arg"
@@ -1979,19 +593,16 @@ func_mode_compile ()
# Accept any command-line options.
case $arg in
-o)
- test -n "$libobj" && \
- func_fatal_error "you cannot specify \`-o' more than once"
+ if test -n "$libobj" ; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit $EXIT_FAILURE
+ fi
arg_mode=target
continue
;;
- -pie | -fpie | -fPIE)
- func_append pie_flag " $arg"
- continue
- ;;
-
- -shared | -static | -prefer-pic | -prefer-non-pic)
- func_append later " $arg"
+ -static | -prefer-pic | -prefer-non-pic)
+ later="$later $arg"
continue
;;
@@ -2006,24 +617,31 @@ func_mode_compile ()
;; # replaced later. I would guess that would be a bug.
-Wc,*)
- func_stripname '-Wc,' '' "$arg"
- args=$func_stripname_result
+ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
lastarg=
save_ifs="$IFS"; IFS=','
- for arg in $args; do
+ for arg in $args; do
IFS="$save_ifs"
- func_append_quoted lastarg "$arg"
+
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ case $arg in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ arg="\"$arg\""
+ ;;
+ esac
+ lastarg="$lastarg $arg"
done
IFS="$save_ifs"
- func_stripname ' ' '' "$lastarg"
- lastarg=$func_stripname_result
+ lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
# Add the arguments to base_compile.
- func_append base_compile " $lastarg"
+ base_compile="$base_compile $lastarg"
continue
;;
- *)
+ * )
# Accept the current argument as the source file.
# The previous "srcfile" becomes the current argument.
#
@@ -2035,41 +653,64 @@ func_mode_compile ()
esac # case $arg_mode
# Aesthetically quote the previous argument.
- func_append_quoted base_compile "$lastarg"
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+ case $lastarg in
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, and some SunOS ksh mistreat backslash-escaping
+ # in scan sets (worked around with variable expansion),
+ # and furthermore cannot handle '|' '&' '(' ')' in scan sets
+ # at all, so we specify them separately.
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+
+ base_compile="$base_compile $lastarg"
done # for arg
case $arg_mode in
arg)
- func_fatal_error "you must specify an argument for -Xcompile"
+ $echo "$modename: you must specify an argument for -Xcompile"
+ exit $EXIT_FAILURE
;;
target)
- func_fatal_error "you must specify a target with \`-o'"
+ $echo "$modename: you must specify a target with \`-o'" 1>&2
+ exit $EXIT_FAILURE
;;
*)
# Get the name of the library object.
- test -z "$libobj" && {
- func_basename "$srcfile"
- libobj="$func_basename_result"
- }
+ [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
;;
esac
# Recognize several different file suffixes.
# If the user specifies -o file.o, it is replaced with file.lo
+ xform='[cCFSifmso]'
case $libobj in
- *.[cCFSifmso] | \
- *.ada | *.adb | *.ads | *.asm | \
- *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
- *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
- func_xform "$libobj"
- libobj=$func_xform_result
- ;;
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+ *.ads) xform=ads ;;
+ *.asm) xform=asm ;;
+ *.c++) xform=c++ ;;
+ *.cc) xform=cc ;;
+ *.ii) xform=ii ;;
+ *.class) xform=class ;;
+ *.cpp) xform=cpp ;;
+ *.cxx) xform=cxx ;;
+ *.f90) xform=f90 ;;
+ *.for) xform=for ;;
+ *.java) xform=java ;;
esac
+ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
case $libobj in
- *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
*)
- func_fatal_error "cannot determine name of library object from \`$libobj'"
+ $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+ exit $EXIT_FAILURE
;;
esac
@@ -2077,15 +718,7 @@ func_mode_compile ()
for arg in $later; do
case $arg in
- -shared)
- test "$build_libtool_libs" != yes && \
- func_fatal_configuration "can not build a shared library"
- build_old_libs=no
- continue
- ;;
-
-static)
- build_libtool_libs=no
build_old_libs=yes
continue
;;
@@ -2102,17 +735,29 @@ func_mode_compile ()
esac
done
- func_quote_for_eval "$libobj"
- test "X$libobj" != "X$func_quote_for_eval_result" \
- && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
- && func_warning "libobj name \`$libobj' may not contain shell special characters."
- func_dirname_and_basename "$obj" "/" ""
- objname="$func_basename_result"
- xdir="$func_dirname_result"
+ qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+ case $qlibobj in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ qlibobj="\"$qlibobj\"" ;;
+ esac
+ if test "X$libobj" != "X$qlibobj"; then
+ $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
+ exit $EXIT_FAILURE
+ fi
+ objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$obj"; then
+ xdir=
+ else
+ xdir=$xdir/
+ fi
lobj=${xdir}$objdir/$objname
- test -z "$base_compile" && \
- func_fatal_help "you must specify a compilation command"
+ if test -z "$base_compile"; then
+ $echo "$modename: you must specify a compilation command" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
# Delete any leftover library objects.
if test "$build_old_libs" = yes; then
@@ -2121,9 +766,12 @@ func_mode_compile ()
removelist="$lobj $libobj ${libobj}T"
fi
+ $run $rm $removelist
+ trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+
# On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in
- cygwin* | mingw* | pw32* | os2* | cegcc*)
+ cygwin* | mingw* | pw32* | os2*)
pic_mode=default
;;
esac
@@ -2135,8 +783,10 @@ func_mode_compile ()
# Calculate the filename of the output object if compiler does
# not support -o with -c
if test "$compiler_c_o" = no; then
- output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+ output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
lockfile="$output_obj.lock"
+ removelist="$removelist $output_obj $lockfile"
+ trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
else
output_obj=
need_locks=no
@@ -2146,13 +796,13 @@ func_mode_compile ()
# Lock this critical section if it is needed
# We use this script file to make the link, it avoids creating a new file
if test "$need_locks" = yes; then
- until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
- func_echo "Waiting for $lockfile to be removed"
+ until $run ln "$progpath" "$lockfile" 2>/dev/null; do
+ $show "Waiting for $lockfile to be removed"
sleep 2
done
elif test "$need_locks" = warn; then
if test -f "$lockfile"; then
- $ECHO "\
+ $echo "\
*** ERROR, $lockfile exists and contains:
`cat $lockfile 2>/dev/null`
@@ -2163,21 +813,34 @@ repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
- $opt_dry_run || $RM $removelist
+ $run $rm $removelist
exit $EXIT_FAILURE
fi
- func_append removelist " $output_obj"
- $ECHO "$srcfile" > "$lockfile"
+ $echo "$srcfile" > "$lockfile"
fi
- $opt_dry_run || $RM $removelist
- func_append removelist " $lockfile"
- trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+ qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+ case $qsrcfile in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ qsrcfile="\"$qsrcfile\"" ;;
+ esac
- func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
- srcfile=$func_to_tool_file_result
- func_quote_for_eval "$srcfile"
- qsrcfile=$func_quote_for_eval_result
+ $run $rm "$libobj" "${libobj}T"
+
+ # Create a libtool object file (analogous to a ".la" file),
+ # but don't create it if we're doing a dry run.
+ test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
# Only build a PIC object if we are building libtool libraries.
if test "$build_libtool_libs" = yes; then
@@ -2191,19 +854,32 @@ compiler."
command="$base_compile $qsrcfile"
fi
- func_mkdir_p "$xdir$objdir"
+ if test ! -d "${xdir}$objdir"; then
+ $show "$mkdir ${xdir}$objdir"
+ $run $mkdir ${xdir}$objdir
+ status=$?
+ if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
+ exit $status
+ fi
+ fi
if test -z "$output_obj"; then
# Place PIC objects in $objdir
- func_append command " -o $lobj"
+ command="$command -o $lobj"
fi
- func_show_eval_locale "$command" \
- 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+ $run $rm "$lobj" "$output_obj"
+
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ test -n "$output_obj" && $run $rm $removelist
+ exit $EXIT_FAILURE
+ fi
if test "$need_locks" = warn &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $ECHO "\
+ $echo "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
@@ -2217,42 +893,65 @@ repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
- $opt_dry_run || $RM $removelist
+ $run $rm $removelist
exit $EXIT_FAILURE
fi
# Just move the object if needed, then go on to compile the next one
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
- func_show_eval '$MV "$output_obj" "$lobj"' \
- 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ $show "$mv $output_obj $lobj"
+ if $run $mv $output_obj $lobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
fi
+ # Append the name of the PIC object to the libtool object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
# Allow error messages only from the first compilation.
if test "$suppress_opt" = yes; then
- suppress_output=' >/dev/null 2>&1'
+ suppress_output=' >/dev/null 2>&1'
fi
+ else
+ # No PIC object so indicate it doesn't exist in the libtool
+ # object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
fi
# Only build a position-dependent object if we build old libraries.
if test "$build_old_libs" = yes; then
if test "$pic_mode" != yes; then
# Don't build PIC code
- command="$base_compile $qsrcfile$pie_flag"
+ command="$base_compile $qsrcfile"
else
command="$base_compile $qsrcfile $pic_flag"
fi
if test "$compiler_c_o" = yes; then
- func_append command " -o $obj"
+ command="$command -o $obj"
fi
# Suppress compiler output if we already did a PIC compilation.
- func_append command "$suppress_output"
- func_show_eval_locale "$command" \
- '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+ command="$command$suppress_output"
+ $run $rm "$obj" "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ $run $rm $removelist
+ exit $EXIT_FAILURE
+ fi
if test "$need_locks" = warn &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $ECHO "\
+ $echo "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
@@ -2266,2835 +965,53 @@ repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
- $opt_dry_run || $RM $removelist
+ $run $rm $removelist
exit $EXIT_FAILURE
fi
# Just move the object if needed
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
- func_show_eval '$MV "$output_obj" "$obj"' \
- 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
- fi
- fi
-
- $opt_dry_run || {
- func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- removelist=$lockfile
- $RM "$lockfile"
- fi
- }
-
- exit $EXIT_SUCCESS
-}
-
-$opt_help || {
- test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
-}
-
-func_mode_help ()
-{
- # We need to display help for each of the modes.
- case $opt_mode in
- "")
- # Generic help is extracted from the usage comments
- # at the start of this file.
- func_help
- ;;
-
- clean)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
- ;;
-
- compile)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
- -o OUTPUT-FILE set the output file name to OUTPUT-FILE
- -no-suppress do not suppress compiler output for multiple passes
- -prefer-pic try to build PIC objects only
- -prefer-non-pic try to build non-PIC objects only
- -shared do not build a \`.o' file suitable for static linking
- -static only build a \`.o' file suitable for static linking
- -Wc,FLAG pass FLAG directly to the compiler
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
- ;;
-
- execute)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
- -dlopen FILE add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
- ;;
-
- finish)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges. Use
-the \`--dry-run' option if you just want to see what would be executed."
- ;;
-
- install)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command. The first component should be
-either the \`install' or \`cp' program.
-
-The following components of INSTALL-COMMAND are treated specially:
-
- -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
- ;;
-
- link)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
- -all-static do not do any dynamic linking at all
- -avoid-version do not add a version suffix if possible
- -bindir BINDIR specify path to binaries directory (for systems where
- libraries must be found in the PATH setting at runtime)
- -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
- -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
- -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
- -export-symbols SYMFILE
- try to export only the symbols listed in SYMFILE
- -export-symbols-regex REGEX
- try to export only the symbols matching REGEX
- -LLIBDIR search LIBDIR for required installed libraries
- -lNAME OUTPUT-FILE requires the installed library libNAME
- -module build a library that can dlopened
- -no-fast-install disable the fast-install mode
- -no-install link a not-installable executable
- -no-undefined declare that a library does not refer to external symbols
- -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
- -objectlist FILE Use a list of object files found in FILE to specify objects
- -precious-files-regex REGEX
- don't remove output files matching REGEX
- -release RELEASE specify package release information
- -rpath LIBDIR the created library will eventually be installed in LIBDIR
- -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
- -shared only do dynamic linking of libtool libraries
- -shrext SUFFIX override the standard shared library file extension
- -static do not do any dynamic linking of uninstalled libtool libraries
- -static-libtool-libs
- do not do any dynamic linking of libtool libraries
- -version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
- -weak LIBNAME declare that the target provides the LIBNAME interface
- -Wc,FLAG
- -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
- -Wl,FLAG
- -Xlinker FLAG pass linker-specific FLAG directly to the linker
- -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename. Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
- ;;
-
- uninstall)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
- ;;
-
- *)
- func_fatal_help "invalid operation mode \`$opt_mode'"
- ;;
- esac
-
- echo
- $ECHO "Try \`$progname --help' for more information about other modes."
-}
-
-# Now that we've collected a possible --mode arg, show help if necessary
-if $opt_help; then
- if test "$opt_help" = :; then
- func_mode_help
- else
- {
- func_help noexit
- for opt_mode in compile link execute install finish uninstall clean; do
- func_mode_help
- done
- } | sed -n '1p; 2,$s/^Usage:/ or: /p'
- {
- func_help noexit
- for opt_mode in compile link execute install finish uninstall clean; do
- echo
- func_mode_help
- done
- } |
- sed '1d
- /^When reporting/,/^Report/{
- H
- d
- }
- $x
- /information about other modes/d
- /more detailed .*MODE/d
- s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
- fi
- exit $?
-fi
-
-
-# func_mode_execute arg...
-func_mode_execute ()
-{
- $opt_debug
- # The first argument is the command name.
- cmd="$nonopt"
- test -z "$cmd" && \
- func_fatal_help "you must specify a COMMAND"
-
- # Handle -dlopen flags immediately.
- for file in $opt_dlopen; do
- test -f "$file" \
- || func_fatal_help "\`$file' is not a file"
-
- dir=
- case $file in
- *.la)
- func_resolve_sysroot "$file"
- file=$func_resolve_sysroot_result
-
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$file" \
- || func_fatal_help "\`$lib' is not a valid libtool archive"
-
- # Read the libtool library.
- dlname=
- library_names=
- func_source "$file"
-
- # Skip this library if it cannot be dlopened.
- if test -z "$dlname"; then
- # Warn if it was a shared library.
- test -n "$library_names" && \
- func_warning "\`$file' was not linked with \`-export-dynamic'"
- continue
- fi
-
- func_dirname "$file" "" "."
- dir="$func_dirname_result"
-
- if test -f "$dir/$objdir/$dlname"; then
- func_append dir "/$objdir"
- else
- if test ! -f "$dir/$dlname"; then
- func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
- fi
- fi
- ;;
-
- *.lo)
- # Just add the directory containing the .lo file.
- func_dirname "$file" "" "."
- dir="$func_dirname_result"
- ;;
-
- *)
- func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
- continue
- ;;
- esac
-
- # Get the absolute pathname.
- absdir=`cd "$dir" && pwd`
- test -n "$absdir" && dir="$absdir"
-
- # Now add the directory to shlibpath_var.
- if eval "test -z \"\$$shlibpath_var\""; then
- eval "$shlibpath_var=\"\$dir\""
- else
- eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
- fi
- done
-
- # This variable tells wrapper scripts just to set shlibpath_var
- # rather than running their programs.
- libtool_execute_magic="$magic"
-
- # Check if any of the arguments is a wrapper script.
- args=
- for file
- do
- case $file in
- -* | *.la | *.lo ) ;;
- *)
- # Do a test to see if this is really a libtool program.
- if func_ltwrapper_script_p "$file"; then
- func_source "$file"
- # Transform arg to wrapped name.
- file="$progdir/$program"
- elif func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- func_source "$func_ltwrapper_scriptname_result"
- # Transform arg to wrapped name.
- file="$progdir/$program"
- fi
- ;;
- esac
- # Quote arguments (to preserve shell metacharacters).
- func_append_quoted args "$file"
- done
-
- if test "X$opt_dry_run" = Xfalse; then
- if test -n "$shlibpath_var"; then
- # Export the shlibpath_var.
- eval "export $shlibpath_var"
- fi
-
- # Restore saved environment variables
- for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
- do
- eval "if test \"\${save_$lt_var+set}\" = set; then
- $lt_var=\$save_$lt_var; export $lt_var
- else
- $lt_unset $lt_var
- fi"
- done
-
- # Now prepare to actually exec the command.
- exec_cmd="\$cmd$args"
- else
- # Display what would be done.
- if test -n "$shlibpath_var"; then
- eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
- echo "export $shlibpath_var"
- fi
- $ECHO "$cmd$args"
- exit $EXIT_SUCCESS
- fi
-}
-
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
-
-
-# func_mode_finish arg...
-func_mode_finish ()
-{
- $opt_debug
- libs=
- libdirs=
- admincmds=
-
- for opt in "$nonopt" ${1+"$@"}
- do
- if test -d "$opt"; then
- func_append libdirs " $opt"
-
- elif test -f "$opt"; then
- if func_lalib_unsafe_p "$opt"; then
- func_append libs " $opt"
+ $show "$mv $output_obj $obj"
+ if $run $mv $output_obj $obj; then :
else
- func_warning "\`$opt' is not a valid libtool archive"
+ error=$?
+ $run $rm $removelist
+ exit $error
fi
-
- else
- func_fatal_error "invalid argument \`$opt'"
fi
- done
-
- if test -n "$libs"; then
- if test -n "$lt_sysroot"; then
- sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
- sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
- else
- sysroot_cmd=
- fi
-
- # Remove sysroot references
- if $opt_dry_run; then
- for lib in $libs; do
- echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
- done
- else
- tmpdir=`func_mktempdir`
- for lib in $libs; do
- sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
- > $tmpdir/tmp-la
- mv -f $tmpdir/tmp-la $lib
- done
- ${RM}r "$tmpdir"
- fi
- fi
-
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- for libdir in $libdirs; do
- if test -n "$finish_cmds"; then
- # Do each command in the finish commands.
- func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
-'"$cmd"'"'
- fi
- if test -n "$finish_eval"; then
- # Do the single finish_eval.
- eval cmds=\"$finish_eval\"
- $opt_dry_run || eval "$cmds" || func_append admincmds "
- $cmds"
- fi
- done
- fi
-
- # Exit here if they wanted silent mode.
- $opt_silent && exit $EXIT_SUCCESS
-
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- echo "----------------------------------------------------------------------"
- echo "Libraries have been installed in:"
- for libdir in $libdirs; do
- $ECHO " $libdir"
- done
- echo
- echo "If you ever happen to want to link against installed libraries"
- echo "in a given directory, LIBDIR, you must either use libtool, and"
- echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
- echo "flag during linking and do at least one of the following:"
- if test -n "$shlibpath_var"; then
- echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
- echo " during execution"
- fi
- if test -n "$runpath_var"; then
- echo " - add LIBDIR to the \`$runpath_var' environment variable"
- echo " during linking"
- fi
- if test -n "$hardcode_libdir_flag_spec"; then
- libdir=LIBDIR
- eval flag=\"$hardcode_libdir_flag_spec\"
-
- $ECHO " - use the \`$flag' linker flag"
- fi
- if test -n "$admincmds"; then
- $ECHO " - have your system administrator run these commands:$admincmds"
- fi
- if test -f /etc/ld.so.conf; then
- echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
- fi
- echo
-
- echo "See any operating system documentation about shared libraries for"
- case $host in
- solaris2.[6789]|solaris2.1[0-9])
- echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
- echo "pages."
- ;;
- *)
- echo "more information, such as the ld(1) and ld.so(8) manual pages."
- ;;
- esac
- echo "----------------------------------------------------------------------"
- fi
- exit $EXIT_SUCCESS
-}
-
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
-
-
-# func_mode_install arg...
-func_mode_install ()
-{
- $opt_debug
- # There may be an optional sh(1) argument at the beginning of
- # install_prog (especially on Windows NT).
- if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
- # Allow the use of GNU shtool's install command.
- case $nonopt in *shtool*) :;; *) false;; esac; then
- # Aesthetically quote it.
- func_quote_for_eval "$nonopt"
- install_prog="$func_quote_for_eval_result "
- arg=$1
- shift
- else
- install_prog=
- arg=$nonopt
- fi
-
- # The real first argument should be the name of the installation program.
- # Aesthetically quote it.
- func_quote_for_eval "$arg"
- func_append install_prog "$func_quote_for_eval_result"
- install_shared_prog=$install_prog
- case " $install_prog " in
- *[\\\ /]cp\ *) install_cp=: ;;
- *) install_cp=false ;;
- esac
-
- # We need to accept at least all the BSD install flags.
- dest=
- files=
- opts=
- prev=
- install_type=
- isdir=no
- stripme=
- no_mode=:
- for arg
- do
- arg2=
- if test -n "$dest"; then
- func_append files " $dest"
- dest=$arg
- continue
- fi
-
- case $arg in
- -d) isdir=yes ;;
- -f)
- if $install_cp; then :; else
- prev=$arg
- fi
- ;;
- -g | -m | -o)
- prev=$arg
- ;;
- -s)
- stripme=" -s"
- continue
- ;;
- -*)
- ;;
- *)
- # If the previous option needed an argument, then skip it.
- if test -n "$prev"; then
- if test "x$prev" = x-m && test -n "$install_override_mode"; then
- arg2=$install_override_mode
- no_mode=false
- fi
- prev=
- else
- dest=$arg
- continue
- fi
- ;;
- esac
-
- # Aesthetically quote the argument.
- func_quote_for_eval "$arg"
- func_append install_prog " $func_quote_for_eval_result"
- if test -n "$arg2"; then
- func_quote_for_eval "$arg2"
- fi
- func_append install_shared_prog " $func_quote_for_eval_result"
- done
-
- test -z "$install_prog" && \
- func_fatal_help "you must specify an install program"
-
- test -n "$prev" && \
- func_fatal_help "the \`$prev' option requires an argument"
-
- if test -n "$install_override_mode" && $no_mode; then
- if $install_cp; then :; else
- func_quote_for_eval "$install_override_mode"
- func_append install_shared_prog " -m $func_quote_for_eval_result"
- fi
- fi
-
- if test -z "$files"; then
- if test -z "$dest"; then
- func_fatal_help "no file or destination specified"
- else
- func_fatal_help "you must specify a destination"
- fi
- fi
-
- # Strip any trailing slash from the destination.
- func_stripname '' '/' "$dest"
- dest=$func_stripname_result
-
- # Check to see that the destination is a directory.
- test -d "$dest" && isdir=yes
- if test "$isdir" = yes; then
- destdir="$dest"
- destname=
- else
- func_dirname_and_basename "$dest" "" "."
- destdir="$func_dirname_result"
- destname="$func_basename_result"
-
- # Not a directory, so check to see that there is only one file specified.
- set dummy $files; shift
- test "$#" -gt 1 && \
- func_fatal_help "\`$dest' is not a directory"
- fi
- case $destdir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- for file in $files; do
- case $file in
- *.lo) ;;
- *)
- func_fatal_help "\`$destdir' must be an absolute directory name"
- ;;
- esac
- done
- ;;
- esac
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- staticlibs=
- future_libdirs=
- current_libdirs=
- for file in $files; do
-
- # Do each installation.
- case $file in
- *.$libext)
- # Do the static libraries later.
- func_append staticlibs " $file"
- ;;
-
- *.la)
- func_resolve_sysroot "$file"
- file=$func_resolve_sysroot_result
-
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$file" \
- || func_fatal_help "\`$file' is not a valid libtool archive"
-
- library_names=
- old_library=
- relink_command=
- func_source "$file"
-
- # Add the libdir to current_libdirs if it is the destination.
- if test "X$destdir" = "X$libdir"; then
- case "$current_libdirs " in
- *" $libdir "*) ;;
- *) func_append current_libdirs " $libdir" ;;
- esac
- else
- # Note the libdir as a future libdir.
- case "$future_libdirs " in
- *" $libdir "*) ;;
- *) func_append future_libdirs " $libdir" ;;
- esac
- fi
-
- func_dirname "$file" "/" ""
- dir="$func_dirname_result"
- func_append dir "$objdir"
-
- if test -n "$relink_command"; then
- # Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
-
- # Don't allow the user to place us outside of our expected
- # location b/c this prevents finding dependent libraries that
- # are installed to the same prefix.
- # At present, this check doesn't affect windows .dll's that
- # are installed into $libdir/../bin (currently, that works fine)
- # but it's something to keep an eye on.
- test "$inst_prefix_dir" = "$destdir" && \
- func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
-
- if test -n "$inst_prefix_dir"; then
- # Stick the inst_prefix_dir data into the link command.
- relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
- else
- relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
- fi
-
- func_warning "relinking \`$file'"
- func_show_eval "$relink_command" \
- 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
- fi
-
- # See the names of the shared library.
- set dummy $library_names; shift
- if test -n "$1"; then
- realname="$1"
- shift
-
- srcname="$realname"
- test -n "$relink_command" && srcname="$realname"T
-
- # Install the shared library and build the symlinks.
- func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
- 'exit $?'
- tstripme="$stripme"
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- case $realname in
- *.dll.a)
- tstripme=""
- ;;
- esac
- ;;
- esac
- if test -n "$tstripme" && test -n "$striplib"; then
- func_show_eval "$striplib $destdir/$realname" 'exit $?'
- fi
-
- if test "$#" -gt 0; then
- # Delete the old symlinks, and create new ones.
- # Try `ln -sf' first, because the `ln' binary might depend on
- # the symlink we replace! Solaris /bin/ln does not understand -f,
- # so we also need to try rm && ln -s.
- for linkname
- do
- test "$linkname" != "$realname" \
- && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
- done
- fi
-
- # Do each command in the postinstall commands.
- lib="$destdir/$realname"
- func_execute_cmds "$postinstall_cmds" 'exit $?'
- fi
-
- # Install the pseudo-library for information purposes.
- func_basename "$file"
- name="$func_basename_result"
- instname="$dir/$name"i
- func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
-
- # Maybe install the static library, too.
- test -n "$old_library" && func_append staticlibs " $dir/$old_library"
- ;;
-
- *.lo)
- # Install (i.e. copy) a libtool object.
-
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- func_basename "$file"
- destfile="$func_basename_result"
- destfile="$destdir/$destfile"
- fi
-
- # Deduce the name of the destination old-style object file.
- case $destfile in
- *.lo)
- func_lo2o "$destfile"
- staticdest=$func_lo2o_result
- ;;
- *.$objext)
- staticdest="$destfile"
- destfile=
- ;;
- *)
- func_fatal_help "cannot copy a libtool object to \`$destfile'"
- ;;
- esac
-
- # Install the libtool object if requested.
- test -n "$destfile" && \
- func_show_eval "$install_prog $file $destfile" 'exit $?'
-
- # Install the old object if enabled.
- if test "$build_old_libs" = yes; then
- # Deduce the name of the old-style object file.
- func_lo2o "$file"
- staticobj=$func_lo2o_result
- func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
- fi
- exit $EXIT_SUCCESS
- ;;
-
- *)
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- func_basename "$file"
- destfile="$func_basename_result"
- destfile="$destdir/$destfile"
- fi
-
- # If the file is missing, and there is a .exe on the end, strip it
- # because it is most likely a libtool script we actually want to
- # install
- stripped_ext=""
- case $file in
- *.exe)
- if test ! -f "$file"; then
- func_stripname '' '.exe' "$file"
- file=$func_stripname_result
- stripped_ext=".exe"
- fi
- ;;
- esac
-
- # Do a test to see if this is really a libtool program.
- case $host in
- *cygwin* | *mingw*)
- if func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- wrapper=$func_ltwrapper_scriptname_result
- else
- func_stripname '' '.exe' "$file"
- wrapper=$func_stripname_result
- fi
- ;;
- *)
- wrapper=$file
- ;;
- esac
- if func_ltwrapper_script_p "$wrapper"; then
- notinst_deplibs=
- relink_command=
-
- func_source "$wrapper"
-
- # Check the variables that should have been set.
- test -z "$generated_by_libtool_version" && \
- func_fatal_error "invalid libtool wrapper script \`$wrapper'"
-
- finalize=yes
- for lib in $notinst_deplibs; do
- # Check to see that each library is installed.
- libdir=
- if test -f "$lib"; then
- func_source "$lib"
- fi
- libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
- if test -n "$libdir" && test ! -f "$libfile"; then
- func_warning "\`$lib' has not been installed in \`$libdir'"
- finalize=no
- fi
- done
-
- relink_command=
- func_source "$wrapper"
-
- outputname=
- if test "$fast_install" = no && test -n "$relink_command"; then
- $opt_dry_run || {
- if test "$finalize" = yes; then
- tmpdir=`func_mktempdir`
- func_basename "$file$stripped_ext"
- file="$func_basename_result"
- outputname="$tmpdir/$file"
- # Replace the output file specification.
- relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
-
- $opt_silent || {
- func_quote_for_expand "$relink_command"
- eval "func_echo $func_quote_for_expand_result"
- }
- if eval "$relink_command"; then :
- else
- func_error "error: relink \`$file' with the above command before installing it"
- $opt_dry_run || ${RM}r "$tmpdir"
- continue
- fi
- file="$outputname"
- else
- func_warning "cannot relink \`$file'"
- fi
- }
- else
- # Install the binary that we compiled earlier.
- file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
- fi
- fi
-
- # remove .exe since cygwin /usr/bin/install will append another
- # one anyway
- case $install_prog,$host in
- */usr/bin/install*,*cygwin*)
- case $file:$destfile in
- *.exe:*.exe)
- # this is ok
- ;;
- *.exe:*)
- destfile=$destfile.exe
- ;;
- *:*.exe)
- func_stripname '' '.exe' "$destfile"
- destfile=$func_stripname_result
- ;;
- esac
- ;;
- esac
- func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
- $opt_dry_run || if test -n "$outputname"; then
- ${RM}r "$tmpdir"
- fi
- ;;
- esac
- done
-
- for file in $staticlibs; do
- func_basename "$file"
- name="$func_basename_result"
-
- # Set up the ranlib parameters.
- oldlib="$destdir/$name"
- func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
- tool_oldlib=$func_to_tool_file_result
-
- func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
-
- if test -n "$stripme" && test -n "$old_striplib"; then
- func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
- fi
-
- # Do each command in the postinstall commands.
- func_execute_cmds "$old_postinstall_cmds" 'exit $?'
- done
-
- test -n "$future_libdirs" && \
- func_warning "remember to run \`$progname --finish$future_libdirs'"
-
- if test -n "$current_libdirs"; then
- # Maybe just do a dry run.
- $opt_dry_run && current_libdirs=" -n$current_libdirs"
- exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
- else
- exit $EXIT_SUCCESS
- fi
-}
-
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
-
-
-# func_generate_dlsyms outputname originator pic_p
-# Extract symbols from dlprefiles and create ${outputname}S.o with
-# a dlpreopen symbol table.
-func_generate_dlsyms ()
-{
- $opt_debug
- my_outputname="$1"
- my_originator="$2"
- my_pic_p="${3-no}"
- my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
- my_dlsyms=
-
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- if test -n "$NM" && test -n "$global_symbol_pipe"; then
- my_dlsyms="${my_outputname}S.c"
- else
- func_error "not configured to extract global symbols from dlpreopened files"
- fi
- fi
- if test -n "$my_dlsyms"; then
- case $my_dlsyms in
- "") ;;
- *.c)
- # Discover the nlist of each of the dlfiles.
- nlist="$output_objdir/${my_outputname}.nm"
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
- func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
- # Parse the name list into a source file.
- func_verbose "creating $output_objdir/$my_dlsyms"
-
- $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
-#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
-#endif
-
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data. */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-/* External symbol declarations for the compiler. */\
-"
-
- if test "$dlself" = yes; then
- func_verbose "generating symbol list for \`$output'"
-
- $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
- # Add our own program objects to the symbol list.
- progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
- for progfile in $progfiles; do
- func_to_tool_file "$progfile" func_convert_file_msys_to_w32
- func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
- $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
- done
-
- if test -n "$exclude_expsyms"; then
- $opt_dry_run || {
- eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- }
- fi
-
- if test -n "$export_symbols_regex"; then
- $opt_dry_run || {
- eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- }
- fi
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- export_symbols="$output_objdir/$outputname.exp"
- $opt_dry_run || {
- $RM $export_symbols
- eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- }
- else
- $opt_dry_run || {
- eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
- eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- }
- fi
- fi
-
- for dlprefile in $dlprefiles; do
- func_verbose "extracting global C symbols from \`$dlprefile'"
- func_basename "$dlprefile"
- name="$func_basename_result"
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- # if an import library, we need to obtain dlname
- if func_win32_import_lib_p "$dlprefile"; then
- func_tr_sh "$dlprefile"
- eval "curr_lafile=\$libfile_$func_tr_sh_result"
- dlprefile_dlbasename=""
- if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
- # Use subshell, to avoid clobbering current variable values
- dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
- if test -n "$dlprefile_dlname" ; then
- func_basename "$dlprefile_dlname"
- dlprefile_dlbasename="$func_basename_result"
- else
- # no lafile. user explicitly requested -dlpreopen <import library>.
- $sharedlib_from_linklib_cmd "$dlprefile"
- dlprefile_dlbasename=$sharedlib_from_linklib_result
- fi
- fi
- $opt_dry_run || {
- if test -n "$dlprefile_dlbasename" ; then
- eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
- else
- func_warning "Could not compute DLL name from $name"
- eval '$ECHO ": $name " >> "$nlist"'
- fi
- func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
- $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
- }
- else # not an import lib
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
- fi
- ;;
- *)
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
- ;;
- esac
- done
-
- $opt_dry_run || {
- # Make sure we have at least an empty file.
- test -f "$nlist" || : > "$nlist"
-
- if test -n "$exclude_expsyms"; then
- $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
- $MV "$nlist"T "$nlist"
- fi
-
- # Try sorting and uniquifying the output.
- if $GREP -v "^: " < "$nlist" |
- if sort -k 3 </dev/null >/dev/null 2>&1; then
- sort -k 3
- else
- sort +2
- fi |
- uniq > "$nlist"S; then
- :
- else
- $GREP -v "^: " < "$nlist" > "$nlist"S
- fi
-
- if test -f "$nlist"S; then
- eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
- else
- echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
- fi
-
- echo >> "$output_objdir/$my_dlsyms" "\
-
-/* The mapping between symbol names and symbols. */
-typedef struct {
- const char *name;
- void *address;
-} lt_dlsymlist;
-extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
-LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
- { \"$my_originator\", (void *) 0 },"
-
- case $need_lib_prefix in
- no)
- eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
- ;;
- *)
- eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
- ;;
- esac
- echo >> "$output_objdir/$my_dlsyms" "\
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt_${my_prefix}_LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
- } # !$opt_dry_run
-
- pic_flag_for_symtable=
- case "$compile_command " in
- *" -static "*) ;;
- *)
- case $host in
- # compiling the symbol table file with pic_flag works around
- # a FreeBSD bug that causes programs to crash when -lm is
- # linked before any other PIC object. But we must not use
- # pic_flag when linking with -static. The problem exists in
- # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
- pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
- *-*-hpux*)
- pic_flag_for_symtable=" $pic_flag" ;;
- *)
- if test "X$my_pic_p" != Xno; then
- pic_flag_for_symtable=" $pic_flag"
- fi
- ;;
- esac
- ;;
- esac
- symtab_cflags=
- for arg in $LTCFLAGS; do
- case $arg in
- -pie | -fpie | -fPIE) ;;
- *) func_append symtab_cflags " $arg" ;;
- esac
- done
-
- # Now compile the dynamic symbol file.
- func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
-
- # Clean up the generated files.
- func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
-
- # Transform the symbol file into the correct name.
- symfileobj="$output_objdir/${my_outputname}S.$objext"
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- if test -f "$output_objdir/$my_outputname.def"; then
- compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
- else
- compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- fi
- ;;
- *)
- compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- ;;
- esac
- ;;
- *)
- func_fatal_error "unknown suffix for \`$my_dlsyms'"
- ;;
- esac
+EOF
else
- # We keep going just in case the user didn't refer to
- # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
- # really was required.
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
- # Nullify the symbol file.
- compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
- fi
-}
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-# Despite the name, also deal with 64 bit binaries.
-func_win32_libid ()
-{
- $opt_debug
- win32_libid_type="unknown"
- win32_fileres=`file -L $1 2>/dev/null`
- case $win32_fileres in
- *ar\ archive\ import\ library*) # definitely import
- win32_libid_type="x86 archive import"
- ;;
- *ar\ archive*) # could be an import, or static
- # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
- if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
- $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
- $SED -n -e '
- 1,100{
- / I /{
- s,.*,import,
- p
- q
- }
- }'`
- case $win32_nmres in
- import*) win32_libid_type="x86 archive import";;
- *) win32_libid_type="x86 archive static";;
- esac
+EOF
fi
- ;;
- *DLL*)
- win32_libid_type="x86 DLL"
- ;;
- *executable*) # but shell scripts are "executable" too...
- case $win32_fileres in
- *MS\ Windows\ PE\ Intel*)
- win32_libid_type="x86 DLL"
- ;;
- esac
- ;;
- esac
- $ECHO "$win32_libid_type"
-}
-# func_cygming_dll_for_implib ARG
-#
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-# Invoked by eval'ing the libtool variable
-# $sharedlib_from_linklib_cmd
-# Result is available in the variable
-# $sharedlib_from_linklib_result
-func_cygming_dll_for_implib ()
-{
- $opt_debug
- sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
-}
-
-# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
-#
-# The is the core of a fallback implementation of a
-# platform-specific function to extract the name of the
-# DLL associated with the specified import library LIBNAME.
-#
-# SECTION_NAME is either .idata$6 or .idata$7, depending
-# on the platform and compiler that created the implib.
-#
-# Echos the name of the DLL associated with the
-# specified import library.
-func_cygming_dll_for_implib_fallback_core ()
-{
- $opt_debug
- match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
- $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
- $SED '/^Contents of section '"$match_literal"':/{
- # Place marker at beginning of archive member dllname section
- s/.*/====MARK====/
- p
- d
- }
- # These lines can sometimes be longer than 43 characters, but
- # are always uninteresting
- /:[ ]*file format pe[i]\{,1\}-/d
- /^In archive [^:]*:/d
- # Ensure marker is printed
- /^====MARK====/p
- # Remove all lines with less than 43 characters
- /^.\{43\}/!d
- # From remaining lines, remove first 43 characters
- s/^.\{43\}//' |
- $SED -n '
- # Join marker and all lines until next marker into a single line
- /^====MARK====/ b para
- H
- $ b para
- b
- :para
- x
- s/\n//g
- # Remove the marker
- s/^====MARK====//
- # Remove trailing dots and whitespace
- s/[\. \t]*$//
- # Print
- /./p' |
- # we now have a list, one entry per line, of the stringified
- # contents of the appropriate section of all members of the
- # archive which possess that section. Heuristic: eliminate
- # all those which have a first or second character that is
- # a '.' (that is, objdump's representation of an unprintable
- # character.) This should work for all archives with less than
- # 0x302f exports -- but will fail for DLLs whose name actually
- # begins with a literal '.' or a single character followed by
- # a '.'.
- #
- # Of those that remain, print the first one.
- $SED -e '/^\./d;/^.\./d;q'
-}
+ $run $mv "${libobj}T" "${libobj}"
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
- $opt_debug
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
- test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
- $opt_debug
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
- test -n "$func_cygming_ms_implib_tmp"
-}
-
-# func_cygming_dll_for_implib_fallback ARG
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-#
-# This fallback implementation is for use when $DLLTOOL
-# does not support the --identify-strict option.
-# Invoked by eval'ing the libtool variable
-# $sharedlib_from_linklib_cmd
-# Result is available in the variable
-# $sharedlib_from_linklib_result
-func_cygming_dll_for_implib_fallback ()
-{
- $opt_debug
- if func_cygming_gnu_implib_p "$1" ; then
- # binutils import library
- sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
- elif func_cygming_ms_implib_p "$1" ; then
- # ms-generated import library
- sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
- else
- # unknown
- sharedlib_from_linklib_result=""
- fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
- $opt_debug
- f_ex_an_ar_dir="$1"; shift
- f_ex_an_ar_oldlib="$1"
- if test "$lock_old_archive_extraction" = yes; then
- lockfile=$f_ex_an_ar_oldlib.lock
- until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
- func_echo "Waiting for $lockfile to be removed"
- sleep 2
- done
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ $run $rm "$lockfile"
fi
- func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
- 'stat=$?; rm -f "$lockfile"; exit $stat'
- if test "$lock_old_archive_extraction" = yes; then
- $opt_dry_run || rm -f "$lockfile"
- fi
- if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
- fi
-}
-
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
- $opt_debug
- my_gentop="$1"; shift
- my_oldlibs=${1+"$@"}
- my_oldobjs=""
- my_xlib=""
- my_xabs=""
- my_xdir=""
-
- for my_xlib in $my_oldlibs; do
- # Extract the objects.
- case $my_xlib in
- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
- *) my_xabs=`pwd`"/$my_xlib" ;;
- esac
- func_basename "$my_xlib"
- my_xlib="$func_basename_result"
- my_xlib_u=$my_xlib
- while :; do
- case " $extracted_archives " in
- *" $my_xlib_u "*)
- func_arith $extracted_serial + 1
- extracted_serial=$func_arith_result
- my_xlib_u=lt$extracted_serial-$my_xlib ;;
- *) break ;;
- esac
- done
- extracted_archives="$extracted_archives $my_xlib_u"
- my_xdir="$my_gentop/$my_xlib_u"
-
- func_mkdir_p "$my_xdir"
-
- case $host in
- *-darwin*)
- func_verbose "Extracting $my_xabs"
- # Do not bother doing anything if just a dry run
- $opt_dry_run || {
- darwin_orig_dir=`pwd`
- cd $my_xdir || exit $?
- darwin_archive=$my_xabs
- darwin_curdir=`pwd`
- darwin_base_archive=`basename "$darwin_archive"`
- darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
- if test -n "$darwin_arches"; then
- darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
- darwin_arch=
- func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
- for darwin_arch in $darwin_arches ; do
- func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
- cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- func_extract_an_archive "`pwd`" "${darwin_base_archive}"
- cd "$darwin_curdir"
- $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
- done # $darwin_arches
- ## Okay now we've a bunch of thin objects, gotta fatten them up :)
- darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
- darwin_file=
- darwin_files=
- for darwin_file in $darwin_filelist; do
- darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
- $LIPO -create -output "$darwin_file" $darwin_files
- done # $darwin_filelist
- $RM -rf unfat-$$
- cd "$darwin_orig_dir"
- else
- cd $darwin_orig_dir
- func_extract_an_archive "$my_xdir" "$my_xabs"
- fi # $darwin_arches
- } # !$opt_dry_run
- ;;
- *)
- func_extract_an_archive "$my_xdir" "$my_xabs"
- ;;
- esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
- done
- func_extract_archives_result="$my_oldobjs"
-}
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable. Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take. If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
-# the $objdir directory. This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
- func_emit_wrapper_arg1=${1-no}
-
- $ECHO "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
- # install mode needs the following variables:
- generated_by_libtool_version='$macro_version'
- notinst_deplibs='$notinst_deplibs'
-else
- # When we are sourced in execute mode, \$file and \$ECHO are already set.
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- file=\"\$0\""
-
- qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
- $ECHO "\
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
- ECHO=\"$qECHO\"
- fi
-
-# Very basic option parsing. These options are (a) specific to
-# the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
-# windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
-# this pattern).
-#
-# There are only two supported options: --lt-debug and
-# --lt-dump-script. There is, deliberately, no --lt-help.
-#
-# The first argument to this parsing function should be the
-# script's $0 value, followed by "$@".
-lt_option_debug=
-func_parse_lt_options ()
-{
- lt_script_arg0=\$0
- shift
- for lt_opt
- do
- case \"\$lt_opt\" in
- --lt-debug) lt_option_debug=1 ;;
- --lt-dump-script)
- lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
- test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
- lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
- cat \"\$lt_dump_D/\$lt_dump_F\"
- exit 0
- ;;
- --lt-*)
- \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
- exit 1
- ;;
- esac
- done
-
- # Print the debug banner immediately:
- if test -n \"\$lt_option_debug\"; then
- echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
- fi
-}
-
-# Used when --lt-debug. Prints its arguments to stdout
-# (redirection is the responsibility of the caller)
-func_lt_dump_args ()
-{
- lt_dump_args_N=1;
- for lt_arg
- do
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
- lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
- done
-}
-
-# Core function for launching the target application
-func_exec_program_core ()
-{
-"
- case $host in
- # Backslashes separate directories on plain windows
- *-*-mingw | *-*-os2* | *-cegcc*)
- $ECHO "\
- if test -n \"\$lt_option_debug\"; then
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
- func_lt_dump_args \${1+\"\$@\"} 1>&2
- fi
- exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
- ;;
-
- *)
- $ECHO "\
- if test -n \"\$lt_option_debug\"; then
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
- func_lt_dump_args \${1+\"\$@\"} 1>&2
- fi
- exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
+ exit $EXIT_SUCCESS
;;
- esac
- $ECHO "\
- \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
- exit 1
-}
-
-# A function to encapsulate launching the target application
-# Strips options in the --lt-* namespace from \$@ and
-# launches target application with the remaining arguments.
-func_exec_program ()
-{
- case \" \$* \" in
- *\\ --lt-*)
- for lt_wr_arg
- do
- case \$lt_wr_arg in
- --lt-*) ;;
- *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
- esac
- shift
- done ;;
- esac
- func_exec_program_core \${1+\"\$@\"}
-}
-
- # Parse options
- func_parse_lt_options \"\$0\" \${1+\"\$@\"}
-
- # Find the directory that this script lives in.
- thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
- test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
- # Follow symbolic links until we get to the real thisdir.
- file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
- while test -n \"\$file\"; do
- destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
-
- # If there was a directory component, then change thisdir.
- if test \"x\$destdir\" != \"x\$file\"; then
- case \"\$destdir\" in
- [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
- *) thisdir=\"\$thisdir/\$destdir\" ;;
- esac
- fi
-
- file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
- file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
- done
-
- # Usually 'no', except on cygwin/mingw when embedded into
- # the cwrapper.
- WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
- if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
- # special case for '.'
- if test \"\$thisdir\" = \".\"; then
- thisdir=\`pwd\`
- fi
- # remove .libs from thisdir
- case \"\$thisdir\" in
- *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
- $objdir ) thisdir=. ;;
- esac
- fi
-
- # Try to get the absolute directory name.
- absdir=\`cd \"\$thisdir\" && pwd\`
- test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
- if test "$fast_install" = yes; then
- $ECHO "\
- program=lt-'$outputname'$exeext
- progdir=\"\$thisdir/$objdir\"
-
- if test ! -f \"\$progdir/\$program\" ||
- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
- test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
- file=\"\$\$-\$program\"
-
- if test ! -d \"\$progdir\"; then
- $MKDIR \"\$progdir\"
- else
- $RM \"\$progdir/\$file\"
- fi"
-
- $ECHO "\
-
- # relink executable if necessary
- if test -n \"\$relink_command\"; then
- if relink_command_output=\`eval \$relink_command 2>&1\`; then :
- else
- $ECHO \"\$relink_command_output\" >&2
- $RM \"\$progdir/\$file\"
- exit 1
- fi
- fi
-
- $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
- { $RM \"\$progdir/\$program\";
- $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
- $RM \"\$progdir/\$file\"
- fi"
- else
- $ECHO "\
- program='$outputname'
- progdir=\"\$thisdir/$objdir\"
-"
- fi
-
- $ECHO "\
-
- if test -f \"\$progdir/\$program\"; then"
-
- # fixup the dll searchpath if we need to.
- #
- # Fix the DLL searchpath if we need to. Do this before prepending
- # to shlibpath, because on Windows, both are PATH and uninstalled
- # libraries must come first.
- if test -n "$dllsearchpath"; then
- $ECHO "\
- # Add the dll search path components to the executable PATH
- PATH=$dllsearchpath:\$PATH
-"
- fi
-
- # Export our shlibpath_var if we have one.
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- $ECHO "\
- # Add our own library path to $shlibpath_var
- $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
- # Some systems cannot cope with colon-terminated $shlibpath_var
- # The second colon is a workaround for a bug in BeOS R4 sed
- $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
-
- export $shlibpath_var
-"
- fi
-
- $ECHO "\
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- # Run the actual program with our arguments.
- func_exec_program \${1+\"\$@\"}
- fi
- else
- # The program doesn't exist.
- \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
- \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
- \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
- exit 1
- fi
-fi\
-"
-}
-
-
-# func_emit_cwrapperexe_src
-# emit the source code for a wrapper executable on stdout
-# Must ONLY be called from within func_mode_link because
-# it depends on a number of variable set therein.
-func_emit_cwrapperexe_src ()
-{
- cat <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
- Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-
- The $output program cannot be directly executed until all the libtool
- libraries that it depends on are installed.
-
- This wrapper executable should never be moved out of the build directory.
- If it is, it will not operate correctly.
-*/
-EOF
- cat <<"EOF"
-#ifdef _MSC_VER
-# define _CRT_SECURE_NO_DEPRECATE 1
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _MSC_VER
-# include <direct.h>
-# include <process.h>
-# include <io.h>
-#else
-# include <unistd.h>
-# include <stdint.h>
-# ifdef __CYGWIN__
-# include <io.h>
-# endif
-#endif
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-/* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
-# ifdef __STRICT_ANSI__
-int _putenv (const char *);
-# endif
-#elif defined(__CYGWIN__)
-# ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-# endif
-/* #elif defined (other platforms) ... */
-#endif
-
-/* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
-# define setmode _setmode
-# define stat _stat
-# define chmod _chmod
-# define getcwd _getcwd
-# define putenv _putenv
-# define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-# define _INTPTR_T_DEFINED
-# define intptr_t int
-# endif
-#elif defined(__MINGW32__)
-# define setmode _setmode
-# define stat _stat
-# define chmod _chmod
-# define getcwd _getcwd
-# define putenv _putenv
-#elif defined(__CYGWIN__)
-# define HAVE_SETENV
-# define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
-#endif
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef S_IXOTH
-# define S_IXOTH 0
-#endif
-#ifndef S_IXGRP
-# define S_IXGRP 0
-#endif
-
-/* path handling portability macros */
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
- defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# define FOPEN_WB "wb"
-# ifndef DIR_SEPARATOR_2
-# define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-# define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
- (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#ifndef FOPEN_WB
-# define FOPEN_WB "w"
-#endif
-#ifndef _O_BINARY
-# define _O_BINARY 0
-#endif
-
-#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
- if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-#if defined(LT_DEBUGWRAPPER)
-static int lt_debug = 1;
-#else
-static int lt_debug = 0;
-#endif
-
-const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
-
-void *xmalloc (size_t num);
-char *xstrdup (const char *string);
-const char *base_name (const char *name);
-char *find_executable (const char *wrapper);
-char *chase_symlinks (const char *pathspec);
-int make_executable (const char *path);
-int check_executable (const char *path);
-char *strendzap (char *str, const char *pat);
-void lt_debugprintf (const char *file, int line, const char *fmt, ...);
-void lt_fatal (const char *file, int line, const char *message, ...);
-static const char *nonnull (const char *s);
-static const char *nonempty (const char *s);
-void lt_setenv (const char *name, const char *value);
-char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_update_exe_path (const char *name, const char *value);
-void lt_update_lib_path (const char *name, const char *value);
-char **prepare_spawn (char **argv);
-void lt_dump_script (FILE *f);
-EOF
-
- cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
-const char * LIB_PATH_VARNAME = "$shlibpath_var";
-EOF
-
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- func_to_host_path "$temp_rpath"
- cat <<EOF
-const char * LIB_PATH_VALUE = "$func_to_host_path_result";
-EOF
- else
- cat <<"EOF"
-const char * LIB_PATH_VALUE = "";
-EOF
- fi
-
- if test -n "$dllsearchpath"; then
- func_to_host_path "$dllsearchpath:"
- cat <<EOF
-const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE = "$func_to_host_path_result";
-EOF
- else
- cat <<"EOF"
-const char * EXE_PATH_VARNAME = "";
-const char * EXE_PATH_VALUE = "";
-EOF
- fi
-
- if test "$fast_install" = yes; then
- cat <<EOF
-const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
-EOF
- else
- cat <<EOF
-const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
-EOF
- fi
-
-
- cat <<"EOF"
-
-#define LTWRAPPER_OPTION_PREFIX "--lt-"
-
-static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
-static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
-
-int
-main (int argc, char *argv[])
-{
- char **newargz;
- int newargc;
- char *tmp_pathspec;
- char *actual_cwrapper_path;
- char *actual_cwrapper_name;
- char *target_name;
- char *lt_argv_zero;
- intptr_t rval = 127;
-
- int i;
-
- program_name = (char *) xstrdup (base_name (argv[0]));
- newargz = XMALLOC (char *, argc + 1);
-
- /* very simple arg parsing; don't want to rely on getopt
- * also, copy all non cwrapper options to newargz, except
- * argz[0], which is handled differently
- */
- newargc=0;
- for (i = 1; i < argc; i++)
- {
- if (strcmp (argv[i], dumpscript_opt) == 0)
- {
-EOF
- case "$host" in
- *mingw* | *cygwin* )
- # make stdout use "unix" line endings
- echo " setmode(1,_O_BINARY);"
- ;;
- esac
-
- cat <<"EOF"
- lt_dump_script (stdout);
- return 0;
- }
- if (strcmp (argv[i], debug_opt) == 0)
- {
- lt_debug = 1;
- continue;
- }
- if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
- {
- /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
- namespace, but it is not one of the ones we know about and
- have already dealt with, above (inluding dump-script), then
- report an error. Otherwise, targets might begin to believe
- they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
- namespace. The first time any user complains about this, we'll
- need to make LTWRAPPER_OPTION_PREFIX a configure-time option
- or a configure.ac-settable value.
- */
- lt_fatal (__FILE__, __LINE__,
- "unrecognized %s option: '%s'",
- ltwrapper_option_prefix, argv[i]);
- }
- /* otherwise ... */
- newargz[++newargc] = xstrdup (argv[i]);
- }
- newargz[++newargc] = NULL;
-
-EOF
- cat <<EOF
- /* The GNU banner must be the first non-error debug message */
- lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
-EOF
- cat <<"EOF"
- lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
- lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
-
- tmp_pathspec = find_executable (argv[0]);
- if (tmp_pathspec == NULL)
- lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
- lt_debugprintf (__FILE__, __LINE__,
- "(main) found exe (before symlink chase) at: %s\n",
- tmp_pathspec);
-
- actual_cwrapper_path = chase_symlinks (tmp_pathspec);
- lt_debugprintf (__FILE__, __LINE__,
- "(main) found exe (after symlink chase) at: %s\n",
- actual_cwrapper_path);
- XFREE (tmp_pathspec);
-
- actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
- strendzap (actual_cwrapper_path, actual_cwrapper_name);
-
- /* wrapper name transforms */
- strendzap (actual_cwrapper_name, ".exe");
- tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
- XFREE (actual_cwrapper_name);
- actual_cwrapper_name = tmp_pathspec;
- tmp_pathspec = 0;
-
- /* target_name transforms -- use actual target program name; might have lt- prefix */
- target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
- strendzap (target_name, ".exe");
- tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
- XFREE (target_name);
- target_name = tmp_pathspec;
- tmp_pathspec = 0;
-
- lt_debugprintf (__FILE__, __LINE__,
- "(main) libtool target name: %s\n",
- target_name);
-EOF
-
- cat <<EOF
- newargz[0] =
- XMALLOC (char, (strlen (actual_cwrapper_path) +
- strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
- strcpy (newargz[0], actual_cwrapper_path);
- strcat (newargz[0], "$objdir");
- strcat (newargz[0], "/");
-EOF
-
- cat <<"EOF"
- /* stop here, and copy so we don't have to do this twice */
- tmp_pathspec = xstrdup (newargz[0]);
-
- /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
- strcat (newargz[0], actual_cwrapper_name);
-
- /* DO want the lt- prefix here if it exists, so use target_name */
- lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
- XFREE (tmp_pathspec);
- tmp_pathspec = NULL;
-EOF
-
- case $host_os in
- mingw*)
- cat <<"EOF"
- {
- char* p;
- while ((p = strchr (newargz[0], '\\')) != NULL)
- {
- *p = '/';
- }
- while ((p = strchr (lt_argv_zero, '\\')) != NULL)
- {
- *p = '/';
- }
- }
-EOF
- ;;
- esac
-
- cat <<"EOF"
- XFREE (target_name);
- XFREE (actual_cwrapper_path);
- XFREE (actual_cwrapper_name);
-
- lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
- lt_setenv ("DUALCASE", "1"); /* for MSK sh */
- /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
- be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
- because on Windows, both *_VARNAMEs are PATH but uninstalled
- libraries must come first. */
- lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
- lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
-
- lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
- nonnull (lt_argv_zero));
- for (i = 0; i < newargc; i++)
- {
- lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
- i, nonnull (newargz[i]));
- }
-
-EOF
-
- case $host_os in
- mingw*)
- cat <<"EOF"
- /* execv doesn't actually work on mingw as expected on unix */
- newargz = prepare_spawn (newargz);
- rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
- if (rval == -1)
- {
- /* failed to start process */
- lt_debugprintf (__FILE__, __LINE__,
- "(main) failed to launch target \"%s\": %s\n",
- lt_argv_zero, nonnull (strerror (errno)));
- return 127;
- }
- return rval;
-EOF
- ;;
- *)
- cat <<"EOF"
- execv (lt_argv_zero, newargz);
- return rval; /* =127, but avoids unused variable warning */
-EOF
- ;;
- esac
- cat <<"EOF"
-}
-
-void *
-xmalloc (size_t num)
-{
- void *p = (void *) malloc (num);
- if (!p)
- lt_fatal (__FILE__, __LINE__, "memory exhausted");
-
- return p;
-}
-
-char *
-xstrdup (const char *string)
-{
- return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
- string) : NULL;
-}
-
-const char *
-base_name (const char *name)
-{
- const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- /* Skip over the disk name in MSDOS pathnames. */
- if (isalpha ((unsigned char) name[0]) && name[1] == ':')
- name += 2;
-#endif
-
- for (base = name; *name; name++)
- if (IS_DIR_SEPARATOR (*name))
- base = name + 1;
- return base;
-}
-
-int
-check_executable (const char *path)
-{
- struct stat st;
-
- lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
- nonempty (path));
- if ((!path) || (!*path))
- return 0;
-
- if ((stat (path, &st) >= 0)
- && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
- return 1;
- else
- return 0;
-}
-
-int
-make_executable (const char *path)
-{
- int rval = 0;
- struct stat st;
-
- lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
- nonempty (path));
- if ((!path) || (!*path))
- return 0;
-
- if (stat (path, &st) >= 0)
- {
- rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
- }
- return rval;
-}
-
-/* Searches for the full path of the wrapper. Returns
- newly allocated full path name if found, NULL otherwise
- Does not chase symlinks, even on platforms that support them.
-*/
-char *
-find_executable (const char *wrapper)
-{
- int has_slash = 0;
- const char *p;
- const char *p_next;
- /* static buffer for getcwd */
- char tmp[LT_PATHMAX + 1];
- int tmp_len;
- char *concat_name;
-
- lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
- nonempty (wrapper));
-
- if ((wrapper == NULL) || (*wrapper == '\0'))
- return NULL;
-
- /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
- {
- concat_name = xstrdup (wrapper);
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
- else
- {
-#endif
- if (IS_DIR_SEPARATOR (wrapper[0]))
- {
- concat_name = xstrdup (wrapper);
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- }
-#endif
-
- for (p = wrapper; *p; p++)
- if (*p == '/')
- {
- has_slash = 1;
- break;
- }
- if (!has_slash)
- {
- /* no slashes; search PATH */
- const char *path = getenv ("PATH");
- if (path != NULL)
- {
- for (p = path; *p; p = p_next)
- {
- const char *q;
- size_t p_len;
- for (q = p; *q; q++)
- if (IS_PATH_SEPARATOR (*q))
- break;
- p_len = q - p;
- p_next = (*q == '\0' ? q : q + 1);
- if (p_len == 0)
- {
- /* empty path: current directory */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
- nonnull (strerror (errno)));
- tmp_len = strlen (tmp);
- concat_name =
- XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
- }
- else
- {
- concat_name =
- XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, p, p_len);
- concat_name[p_len] = '/';
- strcpy (concat_name + p_len + 1, wrapper);
- }
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
- }
- /* not found in PATH; assume curdir */
- }
- /* Relative path | not found in path: prepend cwd */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
- nonnull (strerror (errno)));
- tmp_len = strlen (tmp);
- concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
-
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- return NULL;
-}
-
-char *
-chase_symlinks (const char *pathspec)
-{
-#ifndef S_ISLNK
- return xstrdup (pathspec);
-#else
- char buf[LT_PATHMAX];
- struct stat s;
- char *tmp_pathspec = xstrdup (pathspec);
- char *p;
- int has_symlinks = 0;
- while (strlen (tmp_pathspec) && !has_symlinks)
- {
- lt_debugprintf (__FILE__, __LINE__,
- "checking path component for symlinks: %s\n",
- tmp_pathspec);
- if (lstat (tmp_pathspec, &s) == 0)
- {
- if (S_ISLNK (s.st_mode) != 0)
- {
- has_symlinks = 1;
- break;
- }
-
- /* search backwards for last DIR_SEPARATOR */
- p = tmp_pathspec + strlen (tmp_pathspec) - 1;
- while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
- p--;
- if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
- {
- /* no more DIR_SEPARATORS left */
- break;
- }
- *p = '\0';
- }
- else
- {
- lt_fatal (__FILE__, __LINE__,
- "error accessing file \"%s\": %s",
- tmp_pathspec, nonnull (strerror (errno)));
- }
- }
- XFREE (tmp_pathspec);
-
- if (!has_symlinks)
- {
- return xstrdup (pathspec);
- }
-
- tmp_pathspec = realpath (pathspec, buf);
- if (tmp_pathspec == 0)
- {
- lt_fatal (__FILE__, __LINE__,
- "could not follow symlinks for %s", pathspec);
- }
- return xstrdup (tmp_pathspec);
-#endif
-}
-
-char *
-strendzap (char *str, const char *pat)
-{
- size_t len, patlen;
-
- assert (str != NULL);
- assert (pat != NULL);
-
- len = strlen (str);
- patlen = strlen (pat);
-
- if (patlen <= len)
- {
- str += len - patlen;
- if (strcmp (str, pat) == 0)
- *str = '\0';
- }
- return str;
-}
-
-void
-lt_debugprintf (const char *file, int line, const char *fmt, ...)
-{
- va_list args;
- if (lt_debug)
- {
- (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
- va_start (args, fmt);
- (void) vfprintf (stderr, fmt, args);
- va_end (args);
- }
-}
-
-static void
-lt_error_core (int exit_status, const char *file,
- int line, const char *mode,
- const char *message, va_list ap)
-{
- fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
- vfprintf (stderr, message, ap);
- fprintf (stderr, ".\n");
-
- if (exit_status >= 0)
- exit (exit_status);
-}
-
-void
-lt_fatal (const char *file, int line, const char *message, ...)
-{
- va_list ap;
- va_start (ap, message);
- lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
- va_end (ap);
-}
-
-static const char *
-nonnull (const char *s)
-{
- return s ? s : "(null)";
-}
-
-static const char *
-nonempty (const char *s)
-{
- return (s && !*s) ? "(empty)" : nonnull (s);
-}
-
-void
-lt_setenv (const char *name, const char *value)
-{
- lt_debugprintf (__FILE__, __LINE__,
- "(lt_setenv) setting '%s' to '%s'\n",
- nonnull (name), nonnull (value));
- {
-#ifdef HAVE_SETENV
- /* always make a copy, for consistency with !HAVE_SETENV */
- char *str = xstrdup (value);
- setenv (name, str, 1);
-#else
- int len = strlen (name) + 1 + strlen (value) + 1;
- char *str = XMALLOC (char, len);
- sprintf (str, "%s=%s", name, value);
- if (putenv (str) != EXIT_SUCCESS)
- {
- XFREE (str);
- }
-#endif
- }
-}
-
-char *
-lt_extend_str (const char *orig_value, const char *add, int to_end)
-{
- char *new_value;
- if (orig_value && *orig_value)
- {
- int orig_value_len = strlen (orig_value);
- int add_len = strlen (add);
- new_value = XMALLOC (char, add_len + orig_value_len + 1);
- if (to_end)
- {
- strcpy (new_value, orig_value);
- strcpy (new_value + orig_value_len, add);
- }
- else
- {
- strcpy (new_value, add);
- strcpy (new_value + add_len, orig_value);
- }
- }
- else
- {
- new_value = xstrdup (add);
- }
- return new_value;
-}
-
-void
-lt_update_exe_path (const char *name, const char *value)
-{
- lt_debugprintf (__FILE__, __LINE__,
- "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
- nonnull (name), nonnull (value));
-
- if (name && *name && value && *value)
- {
- char *new_value = lt_extend_str (getenv (name), value, 0);
- /* some systems can't cope with a ':'-terminated path #' */
- int len = strlen (new_value);
- while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
- {
- new_value[len-1] = '\0';
- }
- lt_setenv (name, new_value);
- XFREE (new_value);
- }
-}
-
-void
-lt_update_lib_path (const char *name, const char *value)
-{
- lt_debugprintf (__FILE__, __LINE__,
- "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
- nonnull (name), nonnull (value));
-
- if (name && *name && value && *value)
- {
- char *new_value = lt_extend_str (getenv (name), value, 0);
- lt_setenv (name, new_value);
- XFREE (new_value);
- }
-}
-
-EOF
- case $host_os in
- mingw*)
- cat <<"EOF"
-
-/* Prepares an argument vector before calling spawn().
- Note that spawn() does not by itself call the command interpreter
- (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
- ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&v);
- v.dwPlatformId == VER_PLATFORM_WIN32_NT;
- }) ? "cmd.exe" : "command.com").
- Instead it simply concatenates the arguments, separated by ' ', and calls
- CreateProcess(). We must quote the arguments since Win32 CreateProcess()
- interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
- special way:
- - Space and tab are interpreted as delimiters. They are not treated as
- delimiters if they are surrounded by double quotes: "...".
- - Unescaped double quotes are removed from the input. Their only effect is
- that within double quotes, space and tab are treated like normal
- characters.
- - Backslashes not followed by double quotes are not special.
- - But 2*n+1 backslashes followed by a double quote become
- n backslashes followed by a double quote (n >= 0):
- \" -> "
- \\\" -> \"
- \\\\\" -> \\"
- */
-#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-char **
-prepare_spawn (char **argv)
-{
- size_t argc;
- char **new_argv;
- size_t i;
-
- /* Count number of arguments. */
- for (argc = 0; argv[argc] != NULL; argc++)
- ;
-
- /* Allocate new argument vector. */
- new_argv = XMALLOC (char *, argc + 1);
-
- /* Put quoted arguments into the new argument vector. */
- for (i = 0; i < argc; i++)
- {
- const char *string = argv[i];
-
- if (string[0] == '\0')
- new_argv[i] = xstrdup ("\"\"");
- else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
- {
- int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
- size_t length;
- unsigned int backslashes;
- const char *s;
- char *quoted_string;
- char *p;
-
- length = 0;
- backslashes = 0;
- if (quote_around)
- length++;
- for (s = string; *s != '\0'; s++)
- {
- char c = *s;
- if (c == '"')
- length += backslashes + 1;
- length++;
- if (c == '\\')
- backslashes++;
- else
- backslashes = 0;
- }
- if (quote_around)
- length += backslashes + 1;
-
- quoted_string = XMALLOC (char, length + 1);
-
- p = quoted_string;
- backslashes = 0;
- if (quote_around)
- *p++ = '"';
- for (s = string; *s != '\0'; s++)
- {
- char c = *s;
- if (c == '"')
- {
- unsigned int j;
- for (j = backslashes + 1; j > 0; j--)
- *p++ = '\\';
- }
- *p++ = c;
- if (c == '\\')
- backslashes++;
- else
- backslashes = 0;
- }
- if (quote_around)
- {
- unsigned int j;
- for (j = backslashes; j > 0; j--)
- *p++ = '\\';
- *p++ = '"';
- }
- *p = '\0';
-
- new_argv[i] = quoted_string;
- }
- else
- new_argv[i] = (char *) string;
- }
- new_argv[argc] = NULL;
-
- return new_argv;
-}
-EOF
- ;;
- esac
-
- cat <<"EOF"
-void lt_dump_script (FILE* f)
-{
-EOF
- func_emit_wrapper yes |
- $SED -n -e '
-s/^\(.\{79\}\)\(..*\)/\1\
-\2/
-h
-s/\([\\"]\)/\\\1/g
-s/$/\\n/
-s/\([^\n]*\).*/ fputs ("\1", f);/p
-g
-D'
- cat <<"EOF"
-}
-EOF
-}
-# end: func_emit_cwrapperexe_src
-
-# func_win32_import_lib_p ARG
-# True if ARG is an import lib, as indicated by $file_magic_cmd
-func_win32_import_lib_p ()
-{
- $opt_debug
- case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
- *import*) : ;;
- *) false ;;
- esac
-}
-
-# func_mode_link arg...
-func_mode_link ()
-{
- $opt_debug
+ # libtool link mode
+ link | relink)
+ modename="$modename: link"
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
# It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out
# which system we are compiling for in order to pass an extra
@@ -5112,10 +1029,10 @@ func_mode_link ()
allow_undefined=yes
;;
esac
- libtool_args=$nonopt
+ libtool_args="$nonopt"
base_compile="$nonopt $@"
- compile_command=$nonopt
- finalize_command=$nonopt
+ compile_command="$nonopt"
+ finalize_command="$nonopt"
compile_rpath=
finalize_rpath=
@@ -5130,10 +1047,8 @@ func_mode_link ()
dllsearchpath=
lib_search_path=`pwd`
inst_prefix_dir=
- new_inherited_linker_flags=
avoid_version=no
- bindir=
dlfiles=
dlprefiles=
dlself=no
@@ -5160,46 +1075,29 @@ func_mode_link ()
thread_safe=no
vinfo=
vinfo_number=no
- weak_libs=
- single_module="${wl}-single_module"
+
func_infer_tag $base_compile
# We need to know -static, to get the right output filenames.
for arg
do
case $arg in
- -shared)
- test "$build_libtool_libs" != yes && \
- func_fatal_configuration "can not build a shared library"
- build_old_libs=no
- break
- ;;
- -all-static | -static | -static-libtool-libs)
- case $arg in
- -all-static)
+ -all-static | -static)
+ if test "X$arg" = "X-all-static"; then
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
- func_warning "complete static linking is impossible in this configuration"
+ $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
fi
if test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
- prefer_static_libs=yes
- ;;
- -static)
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=built
- ;;
- -static-libtool-libs)
+ else
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
- prefer_static_libs=yes
- ;;
- esac
+ fi
build_libtool_libs=no
build_old_libs=yes
+ prefer_static_libs=yes
break
;;
esac
@@ -5212,30 +1110,29 @@ func_mode_link ()
while test "$#" -gt 0; do
arg="$1"
shift
- func_quote_for_eval "$arg"
- qarg=$func_quote_for_eval_unquoted_result
- func_append libtool_args " $func_quote_for_eval_result"
+ case $arg in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+ ;;
+ *) qarg=$arg ;;
+ esac
+ libtool_args="$libtool_args $qarg"
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
case $prev in
output)
- func_append compile_command " @OUTPUT@"
- func_append finalize_command " @OUTPUT@"
+ compile_command="$compile_command @OUTPUT@"
+ finalize_command="$finalize_command @OUTPUT@"
;;
esac
case $prev in
- bindir)
- bindir="$arg"
- prev=
- continue
- ;;
dlfiles|dlprefiles)
if test "$preload" = no; then
# Add the symbol object into the linking commands.
- func_append compile_command " @SYMFILE@"
- func_append finalize_command " @SYMFILE@"
+ compile_command="$compile_command @SYMFILE@"
+ finalize_command="$finalize_command @SYMFILE@"
preload=yes
fi
case $arg in
@@ -5262,9 +1159,9 @@ func_mode_link ()
;;
*)
if test "$prev" = dlfiles; then
- func_append dlfiles " $arg"
+ dlfiles="$dlfiles $arg"
else
- func_append dlprefiles " $arg"
+ dlprefiles="$dlprefiles $arg"
fi
prev=
continue
@@ -5273,8 +1170,10 @@ func_mode_link ()
;;
expsyms)
export_symbols="$arg"
- test -f "$arg" \
- || func_fatal_error "symbol file \`$arg' does not exist"
+ if test ! -f "$arg"; then
+ $echo "$modename: symbol file \`$arg' does not exist"
+ exit $EXIT_FAILURE
+ fi
prev=
continue
;;
@@ -5283,21 +1182,18 @@ func_mode_link ()
prev=
continue
;;
- framework)
- case $host in
- *-*-darwin*)
- case "$deplibs " in
- *" $qarg.ltframework "*) ;;
- *) func_append deplibs " $qarg.ltframework" # this is fixed later
- ;;
- esac
- ;;
- esac
+ inst_prefix)
+ inst_prefix_dir="$arg"
prev=
continue
;;
- inst_prefix)
- inst_prefix_dir="$arg"
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
prev=
continue
;;
@@ -5305,30 +1201,39 @@ func_mode_link ()
if test -f "$arg"; then
save_arg=$arg
moreargs=
- for fil in `cat "$save_arg"`
+ for fil in `cat $save_arg`
do
-# func_append moreargs " $fil"
+# moreargs="$moreargs $fil"
arg=$fil
# A libtool-controlled object.
# Check to see that this really is a libtool object.
- if func_lalib_unsafe_p "$arg"; then
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
pic_object=
non_pic_object=
# Read the .lo file
- func_source "$arg"
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
- if test -z "$pic_object" ||
+ if test -z "$pic_object" || \
test -z "$non_pic_object" ||
- test "$pic_object" = none &&
+ test "$pic_object" = none && \
test "$non_pic_object" = none; then
- func_fatal_error "cannot find name of object for \`$arg'"
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit $EXIT_FAILURE
fi
# Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
if test "$pic_object" != none; then
# Prepend the subdirectory the object is found in.
@@ -5336,7 +1241,7 @@ func_mode_link ()
if test "$prev" = dlfiles; then
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- func_append dlfiles " $pic_object"
+ dlfiles="$dlfiles $pic_object"
prev=
continue
else
@@ -5348,12 +1253,12 @@ func_mode_link ()
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
- func_append dlprefiles " $pic_object"
+ dlprefiles="$dlprefiles $pic_object"
prev=
fi
# A PIC object.
- func_append libobjs " $pic_object"
+ libobjs="$libobjs $pic_object"
arg="$pic_object"
fi
@@ -5363,103 +1268,96 @@ func_mode_link ()
non_pic_object="$xdir$non_pic_object"
# A standard non-PIC object
- func_append non_pic_objects " $non_pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
if test -z "$pic_object" || test "$pic_object" = none ; then
arg="$non_pic_object"
fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- func_append non_pic_objects " $non_pic_object"
fi
else
# Only an error if not doing a dry-run.
- if $opt_dry_run; then
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit $EXIT_FAILURE
+ else
+ # Dry-run case.
+
# Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- func_lo2o "$arg"
- pic_object=$xdir$objdir/$func_lo2o_result
- non_pic_object=$xdir$func_lo2o_result
- func_append libobjs " $pic_object"
- func_append non_pic_objects " $non_pic_object"
- else
- func_fatal_error "\`$arg' is not a valid libtool object"
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
fi
fi
done
else
- func_fatal_error "link input file \`$arg' does not exist"
+ $echo "$modename: link input file \`$save_arg' does not exist"
+ exit $EXIT_FAILURE
fi
arg=$save_arg
prev=
continue
;;
- precious_regex)
- precious_files_regex="$arg"
- prev=
- continue
- ;;
- release)
- release="-$arg"
- prev=
- continue
- ;;
rpath | xrpath)
# We need an absolute path.
case $arg in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
- func_fatal_error "only absolute run-paths are allowed"
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit $EXIT_FAILURE
;;
esac
if test "$prev" = rpath; then
case "$rpath " in
*" $arg "*) ;;
- *) func_append rpath " $arg" ;;
+ *) rpath="$rpath $arg" ;;
esac
else
case "$xrpath " in
*" $arg "*) ;;
- *) func_append xrpath " $arg" ;;
+ *) xrpath="$xrpath $arg" ;;
esac
fi
prev=
continue
;;
- shrext)
- shrext_cmds="$arg"
+ xcompiler)
+ compiler_flags="$compiler_flags $qarg"
prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
continue
;;
- weak)
- func_append weak_libs " $arg"
+ xlinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $wl$qarg"
prev=
+ compile_command="$compile_command $wl$qarg"
+ finalize_command="$finalize_command $wl$qarg"
continue
;;
xcclinker)
- func_append linker_flags " $qarg"
- func_append compiler_flags " $qarg"
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $qarg"
prev=
- func_append compile_command " $qarg"
- func_append finalize_command " $qarg"
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
continue
;;
- xcompiler)
- func_append compiler_flags " $qarg"
+ shrext)
+ shrext_cmds="$arg"
prev=
- func_append compile_command " $qarg"
- func_append finalize_command " $qarg"
continue
;;
- xlinker)
- func_append linker_flags " $qarg"
- func_append compiler_flags " $wl$qarg"
+ darwin_framework)
+ compiler_flags="$compiler_flags $arg"
prev=
- func_append compile_command " $wl$qarg"
- func_append finalize_command " $wl$qarg"
continue
;;
*)
@@ -5475,16 +1373,16 @@ func_mode_link ()
case $arg in
-all-static)
if test -n "$link_static_flag"; then
- # See comment for -static flag below, for more details.
- func_append compile_command " $link_static_flag"
- func_append finalize_command " $link_static_flag"
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
fi
continue
;;
-allow-undefined)
# FIXME: remove this flag sometime in the future.
- func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+ continue
;;
-avoid-version)
@@ -5492,11 +1390,6 @@ func_mode_link ()
continue
;;
- -bindir)
- prev=bindir
- continue
- ;;
-
-dlopen)
prev=dlfiles
continue
@@ -5514,7 +1407,8 @@ func_mode_link ()
-export-symbols | -export-symbols-regex)
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- func_fatal_error "more than one -exported-symbols argument is not allowed"
+ $echo "$modename: more than one -exported-symbols argument is not allowed"
+ exit $EXIT_FAILURE
fi
if test "X$arg" = "X-export-symbols"; then
prev=expsyms
@@ -5525,9 +1419,10 @@ func_mode_link ()
;;
-framework)
- prev=framework
- continue
- ;;
+ prev=darwin_framework
+ compiler_flags="$compiler_flags $arg"
+ continue
+ ;;
-inst-prefix-dir)
prev=inst_prefix
@@ -5539,59 +1434,39 @@ func_mode_link ()
-L[A-Z][A-Z]*:*)
case $with_gcc/$host in
no/*-*-irix* | /*-*-irix*)
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
;;
esac
continue
;;
-L*)
- func_stripname "-L" '' "$arg"
- if test -z "$func_stripname_result"; then
- if test "$#" -gt 0; then
- func_fatal_error "require no space between \`-L' and \`$1'"
- else
- func_fatal_error "need path for \`-L' option"
- fi
- fi
- func_resolve_sysroot "$func_stripname_result"
- dir=$func_resolve_sysroot_result
+ dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
absdir=`cd "$dir" && pwd`
- test -z "$absdir" && \
- func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ if test -z "$absdir"; then
+ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+ exit $EXIT_FAILURE
+ fi
dir="$absdir"
;;
esac
case "$deplibs " in
- *" -L$dir "* | *" $arg "*)
- # Will only happen for absolute or sysroot arguments
- ;;
+ *" -L$dir "*) ;;
*)
- # Preserve sysroot, but never include relative directories
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
- *) func_append deplibs " -L$dir" ;;
- esac
- func_append lib_search_path " $dir"
+ deplibs="$deplibs -L$dir"
+ lib_search_path="$lib_search_path $dir"
;;
esac
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
case :$dllsearchpath: in
*":$dir:"*) ;;
- ::) dllsearchpath=$dir;;
- *) func_append dllsearchpath ":$dir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- ::) dllsearchpath=$testbindir;;
- *) func_append dllsearchpath ":$testbindir";;
+ *) dllsearchpath="$dllsearchpath:$dir";;
esac
;;
esac
@@ -5601,11 +1476,11 @@ func_mode_link ()
-l*)
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ *-*-cygwin* | *-*-pw32* | *-*-beos*)
# These systems don't actually have a C or math library (as such)
continue
;;
- *-*-os2*)
+ *-*-mingw* | *-*-os2*)
# These systems don't actually have a C library (as such)
test "X$arg" = "X-lc" && continue
;;
@@ -5615,17 +1490,8 @@ func_mode_link ()
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C and math libraries are in the System framework
- func_append deplibs " System.ltframework"
+ deplibs="$deplibs -framework System"
continue
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- test "X$arg" = "X-lc" && continue
- ;;
esac
elif test "X$arg" = "X-lc_r"; then
case $host in
@@ -5635,40 +1501,58 @@ func_mode_link ()
;;
esac
fi
- func_append deplibs " $arg"
- continue
- ;;
-
- -module)
- module=yes
+ deplibs="$deplibs $arg"
continue
;;
# Tru64 UNIX uses -model [arg] to determine the layout of C++
# classes, name mangling, and exception handling.
- # Darwin uses the -arch flag to determine output architecture.
- -model|-arch|-isysroot|--sysroot)
- func_append compiler_flags " $arg"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
+ -model)
+ compile_command="$compile_command $arg"
+ compiler_flags="$compiler_flags $arg"
+ finalize_command="$finalize_command $arg"
prev=xcompiler
continue
;;
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
- func_append compiler_flags " $arg"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- case "$new_inherited_linker_flags " in
- *" $arg "*) ;;
- * ) func_append new_inherited_linker_flags " $arg" ;;
- esac
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+ compiler_flags="$compiler_flags $arg"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
continue
;;
- -multi_module)
- single_module="${wl}-multi_module"
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+ # -r[0-9][0-9]* specifies the processor on the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+ # +DA*, +DD* enable 64-bit mode on the HP compiler
+ # -q* pass through compiler args for the IBM compiler
+ # -m* pass through architecture-specific compiler args for GCC
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
+
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ arg="\"$arg\""
+ ;;
+ esac
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ if test "$with_gcc" = "yes" ; then
+ compiler_flags="$compiler_flags $arg"
+ fi
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
continue
;;
@@ -5679,11 +1563,11 @@ func_mode_link ()
-no-install)
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
# The PATH hackery in wrapper scripts is required on Windows
- # and Darwin in order for the loader to find any dlls it needs.
- func_warning "\`-no-install' is ignored for $host"
- func_warning "assuming \`-no-fast-install' instead"
+ # in order for the loader to find any dlls it needs.
+ $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+ $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
fast_install=no
;;
*) no_install=yes ;;
@@ -5724,37 +1608,23 @@ func_mode_link ()
;;
-R*)
- func_stripname '-R' '' "$arg"
- dir=$func_stripname_result
+ dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
- =*)
- func_stripname '=' '' "$dir"
- dir=$lt_sysroot$func_stripname_result
- ;;
*)
- func_fatal_error "only absolute run-paths are allowed"
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit $EXIT_FAILURE
;;
esac
case "$xrpath " in
*" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
+ *) xrpath="$xrpath $dir" ;;
esac
continue
;;
- -shared)
- # The effects of -shared are defined in a previous loop.
- continue
- ;;
-
- -shrext)
- prev=shrext
- continue
- ;;
-
- -static | -static-libtool-libs)
+ -static)
# The effects of -static are defined in a previous loop.
# We used to do the same as -all-static on platforms that
# didn't have a PIC flag, but the assumption that the effects
@@ -5772,49 +1642,47 @@ func_mode_link ()
prev=vinfo
continue
;;
-
-version-number)
prev=vinfo
vinfo_number=yes
continue
;;
- -weak)
- prev=weak
- continue
- ;;
-
-Wc,*)
- func_stripname '-Wc,' '' "$arg"
- args=$func_stripname_result
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
arg=
save_ifs="$IFS"; IFS=','
for flag in $args; do
IFS="$save_ifs"
- func_quote_for_eval "$flag"
- func_append arg " $func_quote_for_eval_result"
- func_append compiler_flags " $func_quote_for_eval_result"
+ case $flag in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ flag="\"$flag\""
+ ;;
+ esac
+ arg="$arg $wl$flag"
+ compiler_flags="$compiler_flags $flag"
done
IFS="$save_ifs"
- func_stripname ' ' '' "$arg"
- arg=$func_stripname_result
+ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
;;
-Wl,*)
- func_stripname '-Wl,' '' "$arg"
- args=$func_stripname_result
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
arg=
save_ifs="$IFS"; IFS=','
for flag in $args; do
IFS="$save_ifs"
- func_quote_for_eval "$flag"
- func_append arg " $wl$func_quote_for_eval_result"
- func_append compiler_flags " $wl$func_quote_for_eval_result"
- func_append linker_flags " $func_quote_for_eval_result"
+ case $flag in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ flag="\"$flag\""
+ ;;
+ esac
+ arg="$arg $wl$flag"
+ compiler_flags="$compiler_flags $wl$flag"
+ linker_flags="$linker_flags $flag"
done
IFS="$save_ifs"
- func_stripname ' ' '' "$arg"
- arg=$func_stripname_result
+ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
;;
-Xcompiler)
@@ -5832,68 +1700,53 @@ func_mode_link ()
continue
;;
- # -msg_* for osf cc
- -msg_*)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- ;;
-
- # Flags to be passed through unchanged, with rationale:
- # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
- # -r[0-9][0-9]* specify processor for the SGI compiler
- # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
- # +DA*, +DD* enable 64-bit mode for the HP compiler
- # -q* compiler args for the IBM compiler
- # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
- # -F/path path to uninstalled frameworks, gcc on darwin
- # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
- # @file GCC response files
- # -tp=* Portland pgcc target processor selection
- # --sysroot=* for sysroot support
- # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- func_append compiler_flags " $arg"
- continue
- ;;
-
# Some other compiler flag.
-* | +*)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ arg="\"$arg\""
+ ;;
+ esac
;;
*.$objext)
# A standard object.
- func_append objs " $arg"
+ objs="$objs $arg"
;;
*.lo)
# A libtool-controlled object.
# Check to see that this really is a libtool object.
- if func_lalib_unsafe_p "$arg"; then
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
pic_object=
non_pic_object=
# Read the .lo file
- func_source "$arg"
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
- if test -z "$pic_object" ||
+ if test -z "$pic_object" || \
test -z "$non_pic_object" ||
- test "$pic_object" = none &&
+ test "$pic_object" = none && \
test "$non_pic_object" = none; then
- func_fatal_error "cannot find name of object for \`$arg'"
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit $EXIT_FAILURE
fi
# Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
if test "$pic_object" != none; then
# Prepend the subdirectory the object is found in.
@@ -5901,7 +1754,7 @@ func_mode_link ()
if test "$prev" = dlfiles; then
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- func_append dlfiles " $pic_object"
+ dlfiles="$dlfiles $pic_object"
prev=
continue
else
@@ -5913,12 +1766,12 @@ func_mode_link ()
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
- func_append dlprefiles " $pic_object"
+ dlprefiles="$dlprefiles $pic_object"
prev=
fi
# A PIC object.
- func_append libobjs " $pic_object"
+ libobjs="$libobjs $pic_object"
arg="$pic_object"
fi
@@ -5928,55 +1781,55 @@ func_mode_link ()
non_pic_object="$xdir$non_pic_object"
# A standard non-PIC object
- func_append non_pic_objects " $non_pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
if test -z "$pic_object" || test "$pic_object" = none ; then
arg="$non_pic_object"
fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- func_append non_pic_objects " $non_pic_object"
fi
else
# Only an error if not doing a dry-run.
- if $opt_dry_run; then
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- func_lo2o "$arg"
- pic_object=$xdir$objdir/$func_lo2o_result
- non_pic_object=$xdir$func_lo2o_result
- func_append libobjs " $pic_object"
- func_append non_pic_objects " $non_pic_object"
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit $EXIT_FAILURE
else
- func_fatal_error "\`$arg' is not a valid libtool object"
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
fi
fi
;;
*.$libext)
# An archive.
- func_append deplibs " $arg"
- func_append old_deplibs " $arg"
+ deplibs="$deplibs $arg"
+ old_deplibs="$old_deplibs $arg"
continue
;;
*.la)
# A libtool-controlled library.
- func_resolve_sysroot "$arg"
if test "$prev" = dlfiles; then
# This library was specified with -dlopen.
- func_append dlfiles " $func_resolve_sysroot_result"
+ dlfiles="$dlfiles $arg"
prev=
elif test "$prev" = dlprefiles; then
# The library was specified with -dlpreopen.
- func_append dlprefiles " $func_resolve_sysroot_result"
+ dlprefiles="$dlprefiles $arg"
prev=
else
- func_append deplibs " $func_resolve_sysroot_result"
+ deplibs="$deplibs $arg"
fi
continue
;;
@@ -5985,53 +1838,70 @@ func_mode_link ()
*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ arg="\"$arg\""
+ ;;
+ esac
;;
esac # arg
# Now actually substitute the argument into the commands.
if test -n "$arg"; then
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
fi
done # argument parsing loop
- test -n "$prev" && \
- func_fatal_help "the \`$prevarg' option requires an argument"
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
eval arg=\"$export_dynamic_flag_spec\"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
fi
oldlibs=
# calculate the name of the file, without its directory
- func_basename "$output"
- outputname="$func_basename_result"
+ outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
libobjs_save="$libobjs"
if test -n "$shlibpath_var"; then
# get the directories listed in $shlibpath_var
- eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+ eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
else
shlib_search_path=
fi
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
- func_dirname "$output" "/" ""
- output_objdir="$func_dirname_result$objdir"
- func_to_tool_file "$output_objdir/"
- tool_output_objdir=$func_to_tool_file_result
+ output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$output_objdir" = "X$output"; then
+ output_objdir="$objdir"
+ else
+ output_objdir="$output_objdir/$objdir"
+ fi
# Create the object directory.
- func_mkdir_p "$output_objdir"
+ if test ! -d "$output_objdir"; then
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$output_objdir"; then
+ exit $status
+ fi
+ fi
# Determine the type of output
case $output in
"")
- func_fatal_help "you must specify an output file"
+ $echo "$modename: you must specify an output file" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
;;
*.$libext) linkmode=oldlib ;;
*.lo | *.$objext) linkmode=obj ;;
@@ -6039,18 +1909,27 @@ func_mode_link ()
*) linkmode=prog ;; # Anything else should be a program.
esac
+ case $host in
+ *cygwin* | *mingw* | *pw32*)
+ # don't eliminate duplications in $postdeps and $predeps
+ duplicate_compiler_generated_deps=yes
+ ;;
+ *)
+ duplicate_compiler_generated_deps=$duplicate_deps
+ ;;
+ esac
specialdeplibs=
libs=
# Find all interdependent deplibs by searching for libraries
# that are linked more than once (e.g. -la -lb -la)
for deplib in $deplibs; do
- if $opt_preserve_dup_deps ; then
+ if test "X$duplicate_deps" = "Xyes" ; then
case "$libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
- func_append libs " $deplib"
+ libs="$libs $deplib"
done
if test "$linkmode" = lib; then
@@ -6060,12 +1939,12 @@ func_mode_link ()
# $postdeps and mark them as special (i.e., whose duplicates are
# not to be eliminated).
pre_post_deps=
- if $opt_duplicate_compiler_generated_deps; then
+ if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
for pre_post_dep in $predeps $postdeps; do
case "$pre_post_deps " in
- *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
esac
- func_append pre_post_deps " $pre_post_dep"
+ pre_post_deps="$pre_post_deps $pre_post_dep"
done
fi
pre_post_deps=
@@ -6077,15 +1956,15 @@ func_mode_link ()
need_relink=no # whether we're linking any uninstalled libtool libraries
notinst_deplibs= # not-installed libtool libraries
notinst_path= # paths that contain not-installed libtool libraries
-
case $linkmode in
lib)
- passes="conv dlpreopen link"
+ passes="conv link"
for file in $dlfiles $dlprefiles; do
case $file in
*.la) ;;
*)
- func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+ exit $EXIT_FAILURE
;;
esac
done
@@ -6101,20 +1980,7 @@ func_mode_link ()
*) passes="conv"
;;
esac
-
for pass in $passes; do
- # The preopen pass in lib mode reverses $deplibs; put it back here
- # so that -L comes before libs that need it for instance...
- if test "$linkmode,$pass" = "lib,link"; then
- ## FIXME: Find the place where the list is rebuilt in the wrong
- ## order, and fix it there properly
- tmp_deplibs=
- for deplib in $deplibs; do
- tmp_deplibs="$deplib $tmp_deplibs"
- done
- deplibs="$tmp_deplibs"
- fi
-
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan"; then
libs="$deplibs"
@@ -6124,74 +1990,34 @@ func_mode_link ()
case $pass in
dlopen) libs="$dlfiles" ;;
dlpreopen) libs="$dlprefiles" ;;
- link)
- libs="$deplibs %DEPLIBS%"
- test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
- ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
- if test "$linkmode,$pass" = "lib,dlpreopen"; then
- # Collect and forward deplibs of preopened libtool libs
- for lib in $dlprefiles; do
- # Ignore non-libtool-libs
- dependency_libs=
- func_resolve_sysroot "$lib"
- case $lib in
- *.la) func_source "$func_resolve_sysroot_result" ;;
- esac
-
- # Collect preopened libtool deplibs, except any this library
- # has declared as weak libs
- for deplib in $dependency_libs; do
- func_basename "$deplib"
- deplib_base=$func_basename_result
- case " $weak_libs " in
- *" $deplib_base "*) ;;
- *) func_append deplibs " $deplib" ;;
- esac
- done
- done
- libs="$dlprefiles"
- fi
if test "$pass" = dlopen; then
# Collect dlpreopened libraries
save_deplibs="$deplibs"
deplibs=
fi
-
for deplib in $libs; do
lib=
found=no
case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
- func_append compiler_flags " $deplib"
- if test "$linkmode" = lib ; then
- case "$new_inherited_linker_flags " in
- *" $deplib "*) ;;
- * ) func_append new_inherited_linker_flags " $deplib" ;;
- esac
- fi
+ compiler_flags="$compiler_flags $deplib"
fi
continue
;;
-l*)
if test "$linkmode" != lib && test "$linkmode" != prog; then
- func_warning "\`-l' is ignored for archives/objects"
+ $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
continue
fi
- func_stripname '-l' '' "$deplib"
- name=$func_stripname_result
- if test "$linkmode" = lib; then
- searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
- else
- searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
- fi
- for searchdir in $searchdirs; do
+ name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+ for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
for search_ext in .la $std_shrext .so .a; do
# Search the libtool library
lib="$searchdir/lib${name}${search_ext}"
@@ -6221,17 +2047,21 @@ func_mode_link ()
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $deplib "*)
- if func_lalib_p "$lib"; then
+ if (${SED} -e '2q' $lib |
+ grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
library_names=
old_library=
- func_source "$lib"
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
for l in $old_library $library_names; do
ll="$l"
done
if test "X$ll" = "X$old_library" ; then # only static version available
found=no
- func_dirname "$lib" "" "."
- ladir="$func_dirname_result"
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
lib=$ladir/$old_library
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
@@ -6243,36 +2073,19 @@ func_mode_link ()
continue
fi
fi
- ;;
+ ;;
*) ;;
esac
fi
fi
;; # -l
- *.ltframework)
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- if test "$linkmode" = lib ; then
- case "$new_inherited_linker_flags " in
- *" $deplib "*) ;;
- * ) func_append new_inherited_linker_flags " $deplib" ;;
- esac
- fi
- fi
- continue
- ;;
-L*)
case $linkmode in
lib)
deplibs="$deplib $deplibs"
test "$pass" = conv && continue
newdependency_libs="$deplib $newdependency_libs"
- func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- func_append newlib_search_path " $func_resolve_sysroot_result"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
;;
prog)
if test "$pass" = conv; then
@@ -6285,34 +2098,27 @@ func_mode_link ()
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
- func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- func_append newlib_search_path " $func_resolve_sysroot_result"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
;;
*)
- func_warning "\`-L' is ignored for archives/objects"
+ $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
;;
esac # linkmode
continue
;; # -L
-R*)
if test "$pass" = link; then
- func_stripname '-R' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- dir=$func_resolve_sysroot_result
+ dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
# Make sure the xrpath contains only unique directories.
case "$xrpath " in
*" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
+ *) xrpath="$xrpath $dir" ;;
esac
fi
deplibs="$deplib $deplibs"
continue
;;
- *.la)
- func_resolve_sysroot "$deplib"
- lib=$func_resolve_sysroot_result
- ;;
+ *.la) lib="$deplib" ;;
*.$libext)
if test "$pass" = conv; then
deplibs="$deplib $deplibs"
@@ -6320,41 +2126,35 @@ func_mode_link ()
fi
case $linkmode in
lib)
- # Linking convenience modules into shared libraries is allowed,
- # but linking other static libraries is non-portable.
- case " $dlpreconveniencelibs " in
- *" $deplib "*) ;;
- *)
- valid_a_lib=no
- case $deplibs_check_method in
- match_pattern*)
- set dummy $deplibs_check_method; shift
- match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method
+ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ if eval $echo \"$deplib\" 2>/dev/null \
+ | $SED 10q \
| $EGREP "$match_pattern_regex" > /dev/null; then
- valid_a_lib=yes
- fi
- ;;
- pass_all)
valid_a_lib=yes
+ fi
;;
- esac
- if test "$valid_a_lib" != yes; then
- echo
- $ECHO "*** Warning: Trying to link with static lib archive $deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because the file extensions .$libext of this argument makes me believe"
- echo "*** that it is just a static archive that I should not use here."
- else
- echo
- $ECHO "*** Warning: Linking the shared library $output against the"
- $ECHO "*** static library $deplib is not portable!"
- deplibs="$deplib $deplibs"
- fi
- ;;
- esac
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ $echo
+ $echo "*** Warning: Trying to link with static lib archive $deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because the file extensions .$libext of this argument makes me believe"
+ $echo "*** that it is just a static archive that I should not used here."
+ else
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the"
+ $echo "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
continue
;;
prog)
@@ -6375,11 +2175,11 @@ func_mode_link ()
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
# If there is no dlopen support or we're linking statically,
# we need to preload.
- func_append newdlprefiles " $deplib"
+ newdlprefiles="$newdlprefiles $deplib"
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
- func_append newdlfiles " $deplib"
+ newdlfiles="$newdlfiles $deplib"
fi
fi
continue
@@ -6389,18 +2189,21 @@ func_mode_link ()
continue
;;
esac # case $deplib
-
if test "$found" = yes || test -f "$lib"; then :
else
- func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ $echo "$modename: cannot find the library \`$lib'" 1>&2
+ exit $EXIT_FAILURE
fi
# Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$lib" \
- || func_fatal_error "\`$lib' is not a valid libtool archive"
+ if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
- func_dirname "$lib" "" "."
- ladir="$func_dirname_result"
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
dlname=
dlopen=
@@ -6408,7 +2211,6 @@ func_mode_link ()
libdir=
library_names=
old_library=
- inherited_linker_flags=
# If the library was installed with an old release of libtool,
# it will not redefine variables installed, or shouldnotlink
installed=yes
@@ -6417,24 +2219,16 @@ func_mode_link ()
# Read the .la file
- func_source "$lib"
-
- # Convert "-framework foo" to "foo.ltframework"
- if test -n "$inherited_linker_flags"; then
- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
- for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
- case " $new_inherited_linker_flags " in
- *" $tmp_inherited_linker_flag "*) ;;
- *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
- esac
- done
- fi
- dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
- test -n "$dlopen" && func_append dlfiles " $dlopen"
- test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
fi
if test "$pass" = conv; then
@@ -6442,23 +2236,25 @@ func_mode_link ()
deplibs="$lib $deplibs"
if test -z "$libdir"; then
if test -z "$old_library"; then
- func_fatal_error "cannot find name of link library for \`$lib'"
+ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+ exit $EXIT_FAILURE
fi
# It is a libtool convenience library, so add in its objects.
- func_append convenience " $ladir/$objdir/$old_library"
- func_append old_convenience " $ladir/$objdir/$old_library"
+ convenience="$convenience $ladir/$objdir/$old_library"
+ old_convenience="$old_convenience $ladir/$objdir/$old_library"
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
- if $opt_preserve_dup_deps ; then
- case "$tmp_libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append tmp_libs " $deplib"
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
done
elif test "$linkmode" != prog && test "$linkmode" != lib; then
- func_fatal_error "\`$lib' is not a convenience library"
+ $echo "$modename: \`$lib' is not a convenience library" 1>&2
+ exit $EXIT_FAILURE
fi
continue
fi # $pass = conv
@@ -6466,23 +2262,19 @@ func_mode_link ()
# Get the name of the library we link against.
linklib=
- if test -n "$old_library" &&
- { test "$prefer_static_libs" = yes ||
- test "$prefer_static_libs,$installed" = "built,no"; }; then
- linklib=$old_library
- else
- for l in $old_library $library_names; do
- linklib="$l"
- done
- fi
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
if test -z "$linklib"; then
- func_fatal_error "cannot find name of link library for \`$lib'"
+ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+ exit $EXIT_FAILURE
fi
# This library was specified with -dlopen.
if test "$pass" = dlopen; then
if test -z "$libdir"; then
- func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+ exit $EXIT_FAILURE
fi
if test -z "$dlname" ||
test "$dlopen_support" != yes ||
@@ -6491,9 +2283,9 @@ func_mode_link ()
# statically, we need to preload. We also need to preload any
# dependent libraries so libltdl's deplib preloader doesn't
# bomb out in the load deplibs phase.
- func_append dlprefiles " $lib $dependency_libs"
+ dlprefiles="$dlprefiles $lib $dependency_libs"
else
- func_append newdlfiles " $lib"
+ newdlfiles="$newdlfiles $lib"
fi
continue
fi # $pass = dlopen
@@ -6504,25 +2296,24 @@ func_mode_link ()
*)
abs_ladir=`cd "$ladir" && pwd`
if test -z "$abs_ladir"; then
- func_warning "cannot determine absolute directory name of \`$ladir'"
- func_warning "passing it literally to the linker, although it might fail"
+ $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
abs_ladir="$ladir"
fi
;;
esac
- func_basename "$lib"
- laname="$func_basename_result"
+ laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
# Find the relevant object directory and library name.
if test "X$installed" = Xyes; then
- if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- func_warning "library \`$lib' was moved."
+ if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ $echo "$modename: warning: library \`$lib' was moved." 1>&2
dir="$ladir"
absdir="$abs_ladir"
libdir="$abs_ladir"
else
- dir="$lt_sysroot$libdir"
- absdir="$lt_sysroot$libdir"
+ dir="$libdir"
+ absdir="$libdir"
fi
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
else
@@ -6530,62 +2321,32 @@ func_mode_link ()
dir="$ladir"
absdir="$abs_ladir"
# Remove this search path later
- func_append notinst_path " $abs_ladir"
+ notinst_path="$notinst_path $abs_ladir"
else
dir="$ladir/$objdir"
absdir="$abs_ladir/$objdir"
# Remove this search path later
- func_append notinst_path " $abs_ladir"
+ notinst_path="$notinst_path $abs_ladir"
fi
fi # $installed = yes
- func_stripname 'lib' '.la' "$laname"
- name=$func_stripname_result
+ name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
# This library was specified with -dlpreopen.
if test "$pass" = dlpreopen; then
- if test -z "$libdir" && test "$linkmode" = prog; then
- func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ newdlprefiles="$newdlprefiles $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ newdlprefiles="$newdlprefiles $dir/$dlname"
+ else
+ newdlprefiles="$newdlprefiles $dir/$linklib"
fi
- case "$host" in
- # special handling for platforms with PE-DLLs.
- *cygwin* | *mingw* | *cegcc* )
- # Linker will automatically link against shared library if both
- # static and shared are present. Therefore, ensure we extract
- # symbols from the import library if a shared library is present
- # (otherwise, the dlopen module name will be incorrect). We do
- # this by putting the import library name into $newdlprefiles.
- # We recover the dlopen module name by 'saving' the la file
- # name in a special purpose variable, and (later) extracting the
- # dlname from the la file.
- if test -n "$dlname"; then
- func_tr_sh "$dir/$linklib"
- eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
- func_append newdlprefiles " $dir/$linklib"
- else
- func_append newdlprefiles " $dir/$old_library"
- # Keep a list of preopened convenience libraries to check
- # that they are being used correctly in the link pass.
- test -z "$libdir" && \
- func_append dlpreconveniencelibs " $dir/$old_library"
- fi
- ;;
- * )
- # Prefer using a static library (so that no silly _DYNAMIC symbols
- # are required to link).
- if test -n "$old_library"; then
- func_append newdlprefiles " $dir/$old_library"
- # Keep a list of preopened convenience libraries to check
- # that they are being used correctly in the link pass.
- test -z "$libdir" && \
- func_append dlpreconveniencelibs " $dir/$old_library"
- # Otherwise, use the dlname, so that lt_dlopen finds it.
- elif test -n "$dlname"; then
- func_append newdlprefiles " $dir/$dlname"
- else
- func_append newdlprefiles " $dir/$linklib"
- fi
- ;;
- esac
fi # $pass = dlpreopen
if test -z "$libdir"; then
@@ -6603,7 +2364,7 @@ func_mode_link ()
if test "$linkmode" = prog && test "$pass" != link; then
- func_append newlib_search_path " $ladir"
+ newlib_search_path="$newlib_search_path $ladir"
deplibs="$lib $deplibs"
linkalldeplibs=no
@@ -6615,10 +2376,7 @@ func_mode_link ()
tmp_libs=
for deplib in $dependency_libs; do
case $deplib in
- -L*) func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- func_append newlib_search_path " $func_resolve_sysroot_result"
- ;;
+ -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
esac
# Need to link against all dependency_libs?
if test "$linkalldeplibs" = yes; then
@@ -6628,27 +2386,26 @@ func_mode_link ()
# or/and link against static libraries
newdependency_libs="$deplib $newdependency_libs"
fi
- if $opt_preserve_dup_deps ; then
+ if test "X$duplicate_deps" = "Xyes" ; then
case "$tmp_libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
- func_append tmp_libs " $deplib"
+ tmp_libs="$tmp_libs $deplib"
done # for deplib
continue
fi # $linkmode = prog...
if test "$linkmode,$pass" = "prog,link"; then
if test -n "$library_names" &&
- { { test "$prefer_static_libs" = no ||
- test "$prefer_static_libs,$installed" = "built,yes"; } ||
- test -z "$old_library"; }; then
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
# We need to hardcode the library path
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
# Make sure the rpath contains only unique directories.
- case "$temp_rpath:" in
- *"$absdir:"*) ;;
- *) func_append temp_rpath "$absdir:" ;;
+ case "$temp_rpath " in
+ *" $dir "*) ;;
+ *" $absdir "*) ;;
+ *) temp_rpath="$temp_rpath $dir" ;;
esac
fi
@@ -6660,7 +2417,7 @@ func_mode_link ()
*)
case "$compile_rpath " in
*" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
+ *) compile_rpath="$compile_rpath $absdir"
esac
;;
esac
@@ -6669,7 +2426,7 @@ func_mode_link ()
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
esac
;;
esac
@@ -6685,44 +2442,24 @@ func_mode_link ()
fi
link_static=no # Whether the deplib will be linked statically
- use_static_libs=$prefer_static_libs
- if test "$use_static_libs" = built && test "$installed" = yes; then
- use_static_libs=no
- fi
if test -n "$library_names" &&
- { test "$use_static_libs" = no || test -z "$old_library"; }; then
- case $host in
- *cygwin* | *mingw* | *cegcc*)
- # No point in relinking DLLs because paths are not encoded
- func_append notinst_deplibs " $lib"
- need_relink=no
- ;;
- *)
- if test "$installed" = no; then
- func_append notinst_deplibs " $lib"
- need_relink=yes
- fi
- ;;
- esac
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=yes
+ fi
# This is a shared library
- # Warn about portability, can't link against -module's on some
- # systems (darwin). Don't bleat about dlopened modules though!
- dlopenmodule=""
- for dlpremoduletest in $dlprefiles; do
- if test "X$dlpremoduletest" = "X$lib"; then
- dlopenmodule="$dlpremoduletest"
- break
- fi
- done
- if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
- echo
+ # Warn about portability, can't link against -module's on
+ # some systems (darwin)
+ if test "$shouldnotlink" = yes && test "$pass" = link ; then
+ $echo
if test "$linkmode" = prog; then
- $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ $echo "*** Warning: Linking the executable $output against the loadable module"
else
- $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ $echo "*** Warning: Linking the shared library $output against the loadable module"
fi
- $ECHO "*** $linklib is not portable!"
+ $echo "*** $linklib is not portable!"
fi
if test "$linkmode" = lib &&
test "$hardcode_into_libs" = yes; then
@@ -6734,7 +2471,7 @@ func_mode_link ()
*)
case "$compile_rpath " in
*" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
+ *) compile_rpath="$compile_rpath $absdir"
esac
;;
esac
@@ -6743,7 +2480,7 @@ func_mode_link ()
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
esac
;;
esac
@@ -6752,19 +2489,17 @@ func_mode_link ()
if test -n "$old_archive_from_expsyms_cmds"; then
# figure out the soname
set dummy $library_names
- shift
- realname="$1"
- shift
- libname=`eval "\\$ECHO \"$libname_spec\""`
+ realname="$2"
+ shift; shift
+ libname=`eval \\$echo \"$libname_spec\"`
# use dlname if we got it. it's perfectly good, no?
if test -n "$dlname"; then
soname="$dlname"
elif test -n "$soname_spec"; then
# bleh windows
case $host in
- *cygwin* | mingw* | *cegcc*)
- func_arith $current - $age
- major=$func_arith_result
+ *cygwin* | mingw*)
+ major=`expr $current - $age`
versuffix="-$major"
;;
esac
@@ -6775,29 +2510,43 @@ func_mode_link ()
# Make a new name for the extract_expsyms_cmds to use
soroot="$soname"
- func_basename "$soroot"
- soname="$func_basename_result"
- func_stripname 'lib' '.dll' "$soname"
- newlib=libimp-$func_stripname_result.a
+ soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+ newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
# If the library has no export list, then create one now
if test -f "$output_objdir/$soname-def"; then :
else
- func_verbose "extracting exported symbol list from \`$soname'"
- func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ $show "extracting exported symbol list from \`$soname'"
+ save_ifs="$IFS"; IFS='~'
+ cmds=$extract_expsyms_cmds
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
fi
# Create $newlib
if test -f "$output_objdir/$newlib"; then :; else
- func_verbose "generating import library for \`$soname'"
- func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ $show "generating import library for \`$soname'"
+ save_ifs="$IFS"; IFS='~'
+ cmds=$old_archive_from_expsyms_cmds
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
fi
# make sure the library variables are pointing to the new library
dir=$output_objdir
linklib=$newlib
fi # test -n "$old_archive_from_expsyms_cmds"
- if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ if test "$linkmode" = prog || test "$mode" != relink; then
add_shlibpath=
add_dir=
add=
@@ -6807,26 +2556,18 @@ func_mode_link ()
if test "$hardcode_direct" = no; then
add="$dir/$linklib"
case $host in
- *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
- *-*-sysv4*uw2*) add_dir="-L$dir" ;;
- *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-sco3.2v5* ) add_dir="-L$dir" ;;
*-*-darwin* )
- # if the lib is a (non-dlopened) module then we can not
- # link against it, someone is ignoring the earlier warnings
- if /usr/bin/file -L $add 2> /dev/null |
- $GREP ": [^:]* bundle" >/dev/null ; then
- if test "X$dlopenmodule" != "X$lib"; then
- $ECHO "*** Warning: lib $linklib is a module, not a shared library"
- if test -z "$old_library" ; then
- echo
- echo "*** And there doesn't seem to be a static archive available"
- echo "*** The link will probably fail, sorry"
- else
- add="$dir/$old_library"
- fi
- elif test -n "$old_library"; then
- add="$dir/$old_library"
+ # if the lib is a module then we can not link against
+ # it, someone is ignoring the new warnings I added
+ if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
+ $echo "** Warning, lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ $echo
+ $echo "** And there doesn't seem to be a static archive available"
+ $echo "** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
fi
fi
esac
@@ -6844,16 +2585,15 @@ func_mode_link ()
fi
;;
relink)
- if test "$hardcode_direct" = yes &&
- test "$hardcode_direct_absolute" = no; then
+ if test "$hardcode_direct" = yes; then
add="$dir/$linklib"
elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$absdir"
+ add_dir="-L$dir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
- case $libdir in
+ case "$libdir" in
[\\/]*)
- func_append add_dir " -L$inst_prefix_dir$libdir"
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
;;
esac
fi
@@ -6869,13 +2609,14 @@ func_mode_link ()
esac
if test "$lib_linked" != yes; then
- func_fatal_configuration "unsupported hardcode properties"
+ $echo "$modename: configuration error: unsupported hardcode properties"
+ exit $EXIT_FAILURE
fi
if test -n "$add_shlibpath"; then
case :$compile_shlibpath: in
*":$add_shlibpath:"*) ;;
- *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
esac
fi
if test "$linkmode" = prog; then
@@ -6884,24 +2625,23 @@ func_mode_link ()
else
test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs"
- if test "$hardcode_direct" != yes &&
- test "$hardcode_minus_L" != yes &&
+ if test "$hardcode_direct" != yes && \
+ test "$hardcode_minus_L" != yes && \
test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
- *) func_append finalize_shlibpath "$libdir:" ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
fi
fi
fi
- if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ if test "$linkmode" = prog || test "$mode" = relink; then
add_shlibpath=
add_dir=
add=
# Finalize command for both is simple: just hardcode it.
- if test "$hardcode_direct" = yes &&
- test "$hardcode_direct_absolute" = no; then
+ if test "$hardcode_direct" = yes; then
add="$libdir/$linklib"
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$libdir"
@@ -6909,24 +2649,24 @@ func_mode_link ()
elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
- *) func_append finalize_shlibpath "$libdir:" ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
add="-l$name"
elif test "$hardcode_automatic" = yes; then
if test -n "$inst_prefix_dir" &&
test -f "$inst_prefix_dir$libdir/$linklib" ; then
- add="$inst_prefix_dir$libdir/$linklib"
+ add="$inst_prefix_dir$libdir/$linklib"
else
- add="$libdir/$linklib"
+ add="$libdir/$linklib"
fi
else
# We cannot seem to hardcode it, guess we'll fake it.
add_dir="-L$libdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
- case $libdir in
+ case "$libdir" in
[\\/]*)
- func_append add_dir " -L$inst_prefix_dir$libdir"
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
;;
esac
fi
@@ -6961,21 +2701,21 @@ func_mode_link ()
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
- echo
- $ECHO "*** Warning: This system can not link to static lib archive $lib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
+ $echo
+ $echo "*** Warning: This system can not link to static lib archive $lib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have."
if test "$module" = yes; then
- echo "*** But as you try to build a module library, libtool will still create "
- echo "*** a static module, that should work as long as the dlopening application"
- echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ $echo "*** But as you try to build a module library, libtool will still create "
+ $echo "*** a static module, that should work as long as the dlopening application"
+ $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ $echo
+ $echo "*** However, this would only work if libtool was able to extract symbol"
+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $echo "*** not find such a program. So, this module is probably useless."
+ $echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
build_libtool_libs=module
@@ -6985,6 +2725,8 @@ func_mode_link ()
fi
fi
else
+ convenience="$convenience $dir/$old_library"
+ old_convenience="$old_convenience $dir/$old_library"
deplibs="$dir/$old_library $deplibs"
link_static=yes
fi
@@ -6999,113 +2741,120 @@ func_mode_link ()
temp_deplibs=
for libdir in $dependency_libs; do
case $libdir in
- -R*) func_stripname '-R' '' "$libdir"
- temp_xrpath=$func_stripname_result
+ -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
case " $xrpath " in
*" $temp_xrpath "*) ;;
- *) func_append xrpath " $temp_xrpath";;
+ *) xrpath="$xrpath $temp_xrpath";;
esac;;
- *) func_append temp_deplibs " $libdir";;
+ *) temp_deplibs="$temp_deplibs $libdir";;
esac
done
dependency_libs="$temp_deplibs"
fi
- func_append newlib_search_path " $absdir"
+ newlib_search_path="$newlib_search_path $absdir"
# Link against this library
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
# ... and its dependency_libs
tmp_libs=
for deplib in $dependency_libs; do
newdependency_libs="$deplib $newdependency_libs"
- case $deplib in
- -L*) func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result";;
- *) func_resolve_sysroot "$deplib" ;;
- esac
- if $opt_preserve_dup_deps ; then
+ if test "X$duplicate_deps" = "Xyes" ; then
case "$tmp_libs " in
- *" $func_resolve_sysroot_result "*)
- func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
- func_append tmp_libs " $func_resolve_sysroot_result"
+ tmp_libs="$tmp_libs $deplib"
done
if test "$link_all_deplibs" != no; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
- path=
case $deplib in
-L*) path="$deplib" ;;
*.la)
- func_resolve_sysroot "$deplib"
- deplib=$func_resolve_sysroot_result
- func_dirname "$deplib" "" "."
- dir=$func_dirname_result
+ dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$deplib" && dir="."
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
- func_warning "cannot determine absolute directory name of \`$dir'"
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
absdir="$dir"
fi
;;
esac
- if $GREP "^installed=no" $deplib > /dev/null; then
+ if grep "^installed=no" $deplib > /dev/null; then
+ path="$absdir/$objdir"
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ if test "$absdir" != "$libdir"; then
+ $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+ fi
+ path="$absdir"
+ fi
+ depdepl=
case $host in
*-*-darwin*)
- depdepl=
+ # we do not want to link against static libs,
+ # but need to link against shared
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
if test -n "$deplibrary_names" ; then
for tmp in $deplibrary_names ; do
depdepl=$tmp
done
- if test -f "$absdir/$objdir/$depdepl" ; then
- depdepl="$absdir/$objdir/$depdepl"
- darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
- if test -z "$darwin_install_name"; then
- darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
- fi
- func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
- func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
- path=
+ if test -f "$path/$depdepl" ; then
+ depdepl="$path/$depdepl"
fi
+ # do not add paths which are already there
+ case " $newlib_search_path " in
+ *" $path "*) ;;
+ *) newlib_search_path="$newlib_search_path $path";;
+ esac
fi
+ path=""
;;
*)
- path="-L$absdir/$objdir"
+ path="-L$path"
;;
esac
- else
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- test -z "$libdir" && \
- func_fatal_error "\`$deplib' is not a valid libtool archive"
- test "$absdir" != "$libdir" && \
- func_warning "\`$deplib' seems to be moved"
-
- path="-L$absdir"
- fi
;;
+ -l*)
+ case $host in
+ *-*-darwin*)
+ # Again, we only want to link against shared libraries
+ eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+ for tmp in $newlib_search_path ; do
+ if test -f "$tmp/lib$tmp_libs.dylib" ; then
+ eval depdepl="$tmp/lib$tmp_libs.dylib"
+ break
+ fi
+ done
+ path=""
+ ;;
+ *) continue ;;
+ esac
+ ;;
+ *) continue ;;
esac
case " $deplibs " in
*" $path "*) ;;
*) deplibs="$path $deplibs" ;;
esac
+ case " $deplibs " in
+ *" $depdepl "*) ;;
+ *) deplibs="$depdepl $deplibs" ;;
+ esac
done
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
- if test "$pass" = link; then
- if test "$linkmode" = "prog"; then
- compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
- finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
- else
- compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- fi
- fi
dependency_libs="$newdependency_libs"
if test "$pass" = dlpreopen; then
# Link the dlpreopened libraries before other libraries
@@ -7120,7 +2869,7 @@ func_mode_link ()
for dir in $newlib_search_path; do
case "$lib_search_path " in
*" $dir "*) ;;
- *) func_append lib_search_path " $dir" ;;
+ *) lib_search_path="$lib_search_path $dir" ;;
esac
done
newlib_search_path=
@@ -7178,10 +2927,10 @@ func_mode_link ()
-L*)
case " $tmp_libs " in
*" $deplib "*) ;;
- *) func_append tmp_libs " $deplib" ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
esac
;;
- *) func_append tmp_libs " $deplib" ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
esac
done
eval $var=\"$tmp_libs\"
@@ -7197,96 +2946,98 @@ func_mode_link ()
;;
esac
if test -n "$i" ; then
- func_append tmp_libs " $i"
+ tmp_libs="$tmp_libs $i"
fi
done
dependency_libs=$tmp_libs
done # for pass
if test "$linkmode" = prog; then
dlfiles="$newdlfiles"
- fi
- if test "$linkmode" = prog || test "$linkmode" = lib; then
dlprefiles="$newdlprefiles"
fi
case $linkmode in
oldlib)
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- func_warning "\`-dlopen' is ignored for archives"
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
fi
- case " $deplibs" in
- *\ -l* | *\ -L*)
- func_warning "\`-l' and \`-L' are ignored for archives" ;;
- esac
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+ fi
- test -n "$rpath" && \
- func_warning "\`-rpath' is ignored for archives"
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+ fi
- test -n "$xrpath" && \
- func_warning "\`-R' is ignored for archives"
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+ fi
- test -n "$vinfo" && \
- func_warning "\`-version-info/-version-number' is ignored for archives"
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+ fi
- test -n "$release" && \
- func_warning "\`-release' is ignored for archives"
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+ fi
- test -n "$export_symbols$export_symbols_regex" && \
- func_warning "\`-export-symbols' is ignored for archives"
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+ fi
# Now set the variables for building old libraries.
build_libtool_libs=no
oldlibs="$output"
- func_append objs "$old_deplibs"
+ objs="$objs$old_deplibs"
;;
lib)
# Make sure we only generate libraries of the form `libNAME.la'.
case $outputname in
lib*)
- func_stripname 'lib' '.la' "$outputname"
- name=$func_stripname_result
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
eval shared_ext=\"$shrext_cmds\"
eval libname=\"$libname_spec\"
;;
*)
- test "$module" = no && \
- func_fatal_help "libtool library \`$output' must begin with \`lib'"
-
+ if test "$module" = no; then
+ $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
if test "$need_lib_prefix" != no; then
# Add the "lib" prefix for modules if required
- func_stripname '' '.la' "$outputname"
- name=$func_stripname_result
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
eval shared_ext=\"$shrext_cmds\"
eval libname=\"$libname_spec\"
else
- func_stripname '' '.la' "$outputname"
- libname=$func_stripname_result
+ libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
fi
;;
esac
if test -n "$objs"; then
if test "$deplibs_check_method" != pass_all; then
- func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+ exit $EXIT_FAILURE
else
- echo
- $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
- $ECHO "*** objects $objs is not portable!"
- func_append libobjs " $objs"
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the non-libtool"
+ $echo "*** objects $objs is not portable!"
+ libobjs="$libobjs $objs"
fi
fi
- test "$dlself" != no && \
- func_warning "\`-dlopen self' is ignored for libtool libraries"
+ if test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+ fi
set dummy $rpath
- shift
- test "$#" -gt 1 && \
- func_warning "ignoring multiple \`-rpath's for a libtool library"
-
- install_libdir="$1"
+ if test "$#" -gt 2; then
+ $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+ fi
+ install_libdir="$2"
oldlibs=
if test -z "$rpath"; then
@@ -7300,21 +3051,25 @@ func_mode_link ()
build_old_libs=yes
fi
- test -n "$vinfo" && \
- func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+ fi
- test -n "$release" && \
- func_warning "\`-release' is ignored for convenience libraries"
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+ fi
else
# Parse the version information argument.
save_ifs="$IFS"; IFS=':'
set dummy $vinfo 0 0 0
- shift
IFS="$save_ifs"
- test -n "$7" && \
- func_fatal_help "too many parameters to \`-version-info'"
+ if test -n "$8"; then
+ $echo "$modename: too many parameters to \`-version-info'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
# convert absolute version numbers to libtool ages
# this retains compatibility with .la files and attempts
@@ -7322,9 +3077,9 @@ func_mode_link ()
case $vinfo_number in
yes)
- number_major="$1"
- number_minor="$2"
- number_revision="$3"
+ number_major="$2"
+ number_minor="$3"
+ number_revision="$4"
#
# There are really only two kinds -- those that
# use the current revision as the major version
@@ -7333,34 +3088,27 @@ func_mode_link ()
# which has an extra 1 added just for fun
#
case $version_type in
- # correct linux to gnu/linux during the next big refactor
- darwin|linux|osf|windows|none)
- func_arith $number_major + $number_minor
- current=$func_arith_result
+ darwin|linux|osf|windows)
+ current=`expr $number_major + $number_minor`
age="$number_minor"
revision="$number_revision"
;;
- freebsd-aout|freebsd-elf|qnx|sunos)
+ freebsd-aout|freebsd-elf|sunos)
current="$number_major"
revision="$number_minor"
age="0"
;;
irix|nonstopux)
- func_arith $number_major + $number_minor
- current=$func_arith_result
+ current=`expr $number_major + $number_minor - 1`
age="$number_minor"
revision="$number_minor"
- lt_irix_increment=no
- ;;
- *)
- func_fatal_configuration "$modename: unknown library version type \`$version_type'"
;;
esac
;;
no)
- current="$1"
- revision="$2"
- age="$3"
+ current="$2"
+ revision="$3"
+ age="$4"
;;
esac
@@ -7368,30 +3116,34 @@ func_mode_link ()
case $current in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
- func_error "CURRENT \`$current' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
+ $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
;;
esac
case $revision in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
- func_error "REVISION \`$revision' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
+ $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
;;
esac
case $age in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
- func_error "AGE \`$age' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
+ $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
;;
esac
if test "$age" -gt "$current"; then
- func_error "AGE \`$age' is greater than the current interface number \`$current'"
- func_fatal_error "\`$vinfo' is not valid version information"
+ $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
fi
# Calculate the version variables.
@@ -7404,14 +3156,11 @@ func_mode_link ()
darwin)
# Like Linux, but with the current version available in
# verstring for coding it into the library header
- func_arith $current - $age
- major=.$func_arith_result
+ major=.`expr $current - $age`
versuffix="$major.$age.$revision"
# Darwin ld doesn't like 0 for these options...
- func_arith $current + 1
- minor_current=$func_arith_result
- xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
- verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ minor_current=`expr $current + 1`
+ verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
;;
freebsd-aout)
@@ -7421,16 +3170,11 @@ func_mode_link ()
freebsd-elf)
major=".$current"
- versuffix=".$current"
+ versuffix=".$current";
;;
irix | nonstopux)
- if test "X$lt_irix_increment" = "Xno"; then
- func_arith $current - $age
- else
- func_arith $current - $age + 1
- fi
- major=$func_arith_result
+ major=`expr $current - $age + 1`
case $version_type in
nonstopux) verstring_prefix=nonstopux ;;
@@ -7441,10 +3185,8 @@ func_mode_link ()
# Add in all the interfaces that we are compatible with.
loop=$revision
while test "$loop" -ne 0; do
- func_arith $revision - $loop
- iface=$func_arith_result
- func_arith $loop - 1
- loop=$func_arith_result
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
verstring="$verstring_prefix$major.$iface:$verstring"
done
@@ -7453,35 +3195,26 @@ func_mode_link ()
versuffix="$major.$revision"
;;
- linux) # correct to gnu/linux during the next big refactor
- func_arith $current - $age
- major=.$func_arith_result
+ linux)
+ major=.`expr $current - $age`
versuffix="$major.$age.$revision"
;;
osf)
- func_arith $current - $age
- major=.$func_arith_result
+ major=.`expr $current - $age`
versuffix=".$current.$age.$revision"
verstring="$current.$age.$revision"
# Add in all the interfaces that we are compatible with.
loop=$age
while test "$loop" -ne 0; do
- func_arith $current - $loop
- iface=$func_arith_result
- func_arith $loop - 1
- loop=$func_arith_result
+ iface=`expr $current - $loop`
+ loop=`expr $loop - 1`
verstring="$verstring:${iface}.0"
done
# Make executables depend on our current version.
- func_append verstring ":${current}.0"
- ;;
-
- qnx)
- major=".$current"
- versuffix=".$current"
+ verstring="$verstring:${current}.0"
;;
sunos)
@@ -7492,13 +3225,14 @@ func_mode_link ()
windows)
# Use '-' rather than '.', since we only want one
# extension on DOS 8.3 filesystems.
- func_arith $current - $age
- major=$func_arith_result
+ major=`expr $current - $age`
versuffix="-$major"
;;
*)
- func_fatal_configuration "unknown library version type \`$version_type'"
+ $echo "$modename: unknown library version type \`$version_type'" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit $EXIT_FAILURE
;;
esac
@@ -7532,7 +3266,7 @@ func_mode_link ()
# Check to see if the archive will have undefined symbols.
if test "$allow_undefined" = yes; then
if test "$allow_undefined_flag" = unsupported; then
- func_warning "undefined symbols not allowed in $host shared libraries"
+ $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
build_libtool_libs=no
build_old_libs=yes
fi
@@ -7540,62 +3274,58 @@ func_mode_link ()
# Don't allow undefined symbols.
allow_undefined_flag="$no_undefined_flag"
fi
-
fi
- func_generate_dlsyms "$libname" "$libname" "yes"
- func_append libobjs " $symfileobj"
- test "X$libobjs" = "X " && libobjs=
-
- if test "$opt_mode" != relink; then
+ if test "$mode" != relink; then
# Remove our outputs, but don't remove object files since they
# may have been created when compiling PIC objects.
removelist=
- tempremovelist=`$ECHO "$output_objdir/*"`
+ tempremovelist=`$echo "$output_objdir/*"`
for p in $tempremovelist; do
case $p in
- *.$objext | *.gcno)
+ *.$objext)
;;
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
if test "X$precious_files_regex" != "X"; then
- if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
- then
+ if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
continue
fi
fi
- func_append removelist " $p"
+ removelist="$removelist $p"
;;
*) ;;
esac
done
- test -n "$removelist" && \
- func_show_eval "${RM}r \$removelist"
+ if test -n "$removelist"; then
+ $show "${rm}r $removelist"
+ $run ${rm}r $removelist
+ fi
fi
# Now set the variables for building old libraries.
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
- func_append oldlibs " $output_objdir/$libname.$libext"
+ oldlibs="$oldlibs $output_objdir/$libname.$libext"
# Transform .lo files to .o files.
- oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+ oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
fi
# Eliminate all temporary directories.
- #for path in $notinst_path; do
- # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
- # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
- # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
- #done
+ for path in $notinst_path; do
+ lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
+ deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
+ dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+ done
if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them.
temp_xrpath=
for libdir in $xrpath; do
- func_replace_sysroot "$libdir"
- func_append temp_xrpath " -R$func_replace_sysroot_result"
+ temp_xrpath="$temp_xrpath -R$libdir"
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
esac
done
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
@@ -7609,7 +3339,7 @@ func_mode_link ()
for lib in $old_dlfiles; do
case " $dlprefiles $dlfiles " in
*" $lib "*) ;;
- *) func_append dlfiles " $lib" ;;
+ *) dlfiles="$dlfiles $lib" ;;
esac
done
@@ -7619,36 +3349,31 @@ func_mode_link ()
for lib in $old_dlprefiles; do
case "$dlprefiles " in
*" $lib "*) ;;
- *) func_append dlprefiles " $lib" ;;
+ *) dlprefiles="$dlprefiles $lib" ;;
esac
done
if test "$build_libtool_libs" = yes; then
if test -n "$rpath"; then
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
# these systems don't actually have a c library (as such)!
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C library is in the System framework
- func_append deplibs " System.ltframework"
+ deplibs="$deplibs -framework System"
;;
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
;;
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
# Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- ;;
- *)
+ *)
# Add libc to deplibs on all other systems if necessary.
if test "$build_libtool_need_lc" = "yes"; then
- func_append deplibs " -lc"
+ deplibs="$deplibs -lc"
fi
;;
esac
@@ -7682,139 +3407,123 @@ func_mode_link ()
# limits. Maybe even breaks it. We compile a program, linking it
# against the deplibs as a proxy for the library. Then we can check
# whether they linked in statically or dynamically with ldd.
- $opt_dry_run || $RM conftest.c
+ $rm conftest.c
cat > conftest.c <<EOF
int main() { return 0; }
EOF
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ $rm conftest
+ $LTCC -o conftest conftest.c $deplibs
+ if test "$?" -eq 0 ; then
ldd_output=`ldd conftest`
for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" -ne "0"; then
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $i "*)
- func_append newdeplibs " $i"
+ newdeplibs="$newdeplibs $i"
i=""
;;
esac
- fi
+ fi
if test -n "$i" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- func_append newdeplibs " $i"
+ newdeplibs="$newdeplibs $i"
else
droppeddeps=yes
- echo
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which I believe you do not have"
- echo "*** because a test_compile did reveal that the linker did not use it for"
- echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which I believe you do not have"
+ $echo "*** because a test_compile did reveal that the linker did not use it for"
+ $echo "*** its dynamic dependency list that programs get resolved with at runtime."
fi
fi
- ;;
- *)
- func_append newdeplibs " $i"
- ;;
- esac
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
done
else
# Error occurred in the first compile. Let's try to salvage
# the situation: Compile a separate program for each library.
for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
+ $rm conftest
+ $LTCC -o conftest conftest.c $i
+ # Did it work?
+ if test "$?" -eq 0 ; then
ldd_output=`ldd conftest`
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $i "*)
- func_append newdeplibs " $i"
+ newdeplibs="$newdeplibs $i"
i=""
;;
esac
fi
if test -n "$i" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- func_append newdeplibs " $i"
+ newdeplibs="$newdeplibs $i"
else
droppeddeps=yes
- echo
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because a test_compile did reveal that the linker did not use this one"
- echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because a test_compile did reveal that the linker did not use this one"
+ $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
fi
fi
else
droppeddeps=yes
- echo
- $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
- echo "*** make it link in! You will probably need to install it or some"
- echo "*** library that it depends on before this library will be fully"
- echo "*** functional. Installing it before continuing would be even better."
+ $echo
+ $echo "*** Warning! Library $i is needed by this library but I was not able to"
+ $echo "*** make it link in! You will probably need to install it or some"
+ $echo "*** library that it depends on before this library will be fully"
+ $echo "*** functional. Installing it before continuing would be even better."
fi
- ;;
- *)
- func_append newdeplibs " $i"
- ;;
- esac
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
done
fi
;;
file_magic*)
- set dummy $deplibs_check_method; shift
- file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ set dummy $deplibs_check_method
+ file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
for a_deplib in $deplibs; do
- case $a_deplib in
- -l*)
- func_stripname -l '' "$a_deplib"
- name=$func_stripname_result
+ name="`expr $a_deplib : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $a_deplib "*)
- func_append newdeplibs " $a_deplib"
+ newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
;;
esac
fi
if test -n "$a_deplib" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- if test -n "$file_magic_glob"; then
- libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
- else
- libnameglob=$libname
- fi
- test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ libname=`eval \\$echo \"$libname_spec\"`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- if test "$want_nocaseglob" = yes; then
- shopt -s nocaseglob
- potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
- $nocaseglob
- else
- potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
- fi
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
# Follow soft links.
- if ls -lLd "$potent_lib" 2>/dev/null |
- $GREP " -> " >/dev/null; then
+ if ls -lLd "$potent_lib" 2>/dev/null \
+ | grep " -> " >/dev/null; then
continue
fi
# The statement above tries to avoid entering an
@@ -7827,13 +3536,13 @@ EOF
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
case $potliblink in
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
- *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac
done
- if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
- $SED -e 10q |
- $EGREP "$file_magic_regex" > /dev/null; then
- func_append newdeplibs " $a_deplib"
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+ | ${SED} 10q \
+ | $EGREP "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
@@ -7842,52 +3551,50 @@ EOF
fi
if test -n "$a_deplib" ; then
droppeddeps=yes
- echo
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because I did check the linker path looking for a file starting"
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $a_deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
- $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ $echo "*** with $libname but no candidates were found. (...for file magic test)"
else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a file magic. Last file checked: $potlib"
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a file magic. Last file checked: $potlib"
fi
fi
- ;;
- *)
+ else
# Add a -L argument.
- func_append newdeplibs " $a_deplib"
- ;;
- esac
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
done # Gone through all deplibs.
;;
match_pattern*)
- set dummy $deplibs_check_method; shift
- match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ set dummy $deplibs_check_method
+ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
for a_deplib in $deplibs; do
- case $a_deplib in
- -l*)
- func_stripname -l '' "$a_deplib"
- name=$func_stripname_result
+ name="`expr $a_deplib : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test -n "$name" && test "$name" != "0"; then
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $a_deplib "*)
- func_append newdeplibs " $a_deplib"
+ newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
;;
esac
fi
if test -n "$a_deplib" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
+ libname=`eval \\$echo \"$libname_spec\"`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
potlib="$potent_lib" # see symlink-check above in file_magic test
- if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
- $EGREP "$match_pattern_regex" > /dev/null; then
- func_append newdeplibs " $a_deplib"
+ if eval $echo \"$potent_lib\" 2>/dev/null \
+ | ${SED} 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
@@ -7896,48 +3603,46 @@ EOF
fi
if test -n "$a_deplib" ; then
droppeddeps=yes
- echo
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because I did check the linker path looking for a file starting"
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $a_deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
- $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a regex pattern. Last file checked: $potlib"
fi
fi
- ;;
- *)
+ else
# Add a -L argument.
- func_append newdeplibs " $a_deplib"
- ;;
- esac
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
done # Gone through all deplibs.
;;
none | unknown | *)
newdeplibs=""
- tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+ tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+ -e 's/ -[LR][^ ]*//g'`
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
for i in $predeps $postdeps ; do
# can't use Xsed below, because $i might contain '/'
- tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+ tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
done
fi
- case $tmp_deplibs in
- *[!\ \ ]*)
- echo
+ if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
+ | grep . >/dev/null; then
+ $echo
if test "X$deplibs_check_method" = "Xnone"; then
- echo "*** Warning: inter-library dependencies are not supported in this platform."
+ $echo "*** Warning: inter-library dependencies are not supported in this platform."
else
- echo "*** Warning: inter-library dependencies are not known to be supported."
+ $echo "*** Warning: inter-library dependencies are not known to be supported."
fi
- echo "*** All declared inter-library dependencies are being dropped."
+ $echo "*** All declared inter-library dependencies are being dropped."
droppeddeps=yes
- ;;
- esac
+ fi
;;
esac
versuffix=$versuffix_save
@@ -7948,24 +3653,24 @@ EOF
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library with the System framework
- newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ # On Rhapsody replace the C library is the System framework
+ newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
;;
esac
if test "$droppeddeps" = yes; then
if test "$module" = yes; then
- echo
- echo "*** Warning: libtool could not satisfy all declared inter-library"
- $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
- echo "*** a static module, that should work as long as the dlopening"
- echo "*** application is linked with the -dlopen flag."
+ $echo
+ $echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $echo "*** dependencies of module $libname. Therefore, libtool will create"
+ $echo "*** a static module, that should work as long as the dlopening"
+ $echo "*** application is linked with the -dlopen flag."
if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ $echo
+ $echo "*** However, this would only work if libtool was able to extract symbol"
+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $echo "*** not find such a program. So, this module is probably useless."
+ $echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
@@ -7975,16 +3680,16 @@ EOF
build_libtool_libs=no
fi
else
- echo "*** The inter-library dependencies that have been dropped here will be"
- echo "*** automatically added whenever a program is linked with this library"
- echo "*** or is declared to -dlopen it."
+ $echo "*** The inter-library dependencies that have been dropped here will be"
+ $echo "*** automatically added whenever a program is linked with this library"
+ $echo "*** or is declared to -dlopen it."
if test "$allow_undefined" = no; then
- echo
- echo "*** Since this library must not contain undefined symbols,"
- echo "*** because either the platform does not support them or"
- echo "*** it was explicitly requested with -no-undefined,"
- echo "*** libtool will only create a static version of it."
+ $echo
+ $echo "*** Since this library must not contain undefined symbols,"
+ $echo "*** because either the platform does not support them or"
+ $echo "*** it was explicitly requested with -no-undefined,"
+ $echo "*** libtool will only create a static version of it."
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=module
@@ -7998,41 +3703,6 @@ EOF
# Done checking deplibs!
deplibs=$newdeplibs
fi
- # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- case $host in
- *-*-darwin*)
- newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- ;;
- esac
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $deplibs " in
- *" -L$path/$objdir "*)
- func_append new_libs " -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) func_append new_libs " $deplib" ;;
- esac
- ;;
- *) func_append new_libs " $deplib" ;;
- esac
- done
- deplibs="$new_libs"
# All the library-specific variables (install_libdir is set above).
library_names=
@@ -8041,22 +3711,15 @@ EOF
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
- # Remove ${wl} instances when linking with ld.
- # FIXME: should test the right _cmds variable.
- case $archive_cmds in
- *\$LD\ *) wl= ;;
- esac
if test "$hardcode_into_libs" = yes; then
# Hardcode the library paths
hardcode_libdirs=
dep_rpath=
rpath="$finalize_rpath"
- test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ test "$mode" != relink && rpath="$compile_rpath$rpath"
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
- func_replace_sysroot "$libdir"
- libdir=$func_replace_sysroot_result
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
@@ -8065,18 +3728,18 @@ EOF
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
- func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
- func_append dep_rpath " $flag"
+ dep_rpath="$dep_rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
- *) func_append perm_rpath " $libdir" ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
done
@@ -8084,13 +3747,17 @@ EOF
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
- eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
- func_append rpath "$dir:"
+ rpath="$rpath$dir:"
done
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
fi
@@ -8098,7 +3765,7 @@ EOF
fi
shlibpath="$finalize_shlibpath"
- test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
if test -n "$shlibpath"; then
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
fi
@@ -8107,9 +3774,8 @@ EOF
eval shared_ext=\"$shrext_cmds\"
eval library_names=\"$library_names_spec\"
set dummy $library_names
- shift
- realname="$1"
- shift
+ realname="$2"
+ shift; shift
if test -n "$soname_spec"; then
eval soname=\"$soname_spec\"
@@ -8121,169 +3787,82 @@ EOF
fi
lib="$output_objdir/$realname"
- linknames=
for link
do
- func_append linknames " $link"
+ linknames="$linknames $link"
done
# Use standard objects if they are pic
- test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
- test "X$libobjs" = "X " && libobjs=
-
- delfiles=
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
- export_symbols="$output_objdir/$libname.uexp"
- func_append delfiles " $export_symbols"
- fi
-
- orig_export_symbols=
- case $host_os in
- cygwin* | mingw* | cegcc*)
- if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
- # exporting using user supplied symfile
- if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
- # and it's NOT already a .def file. Must figure out
- # which of the given symbols are data symbols and tag
- # them as such. So, trigger use of export_symbols_cmds.
- # export_symbols gets reassigned inside the "prepare
- # the list of exported symbols" if statement, so the
- # include_expsyms logic still works.
- orig_export_symbols="$export_symbols"
- export_symbols=
- always_export_symbols=yes
- fi
- fi
- ;;
- esac
+ test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
- func_verbose "generating symbol list for \`$libname.la'"
+ $show "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp"
- $opt_dry_run || $RM $export_symbols
+ $run $rm $export_symbols
cmds=$export_symbols_cmds
save_ifs="$IFS"; IFS='~'
- for cmd1 in $cmds; do
+ for cmd in $cmds; do
IFS="$save_ifs"
- # Take the normal branch if the nm_file_list_spec branch
- # doesn't work or if tool conversion is not needed.
- case $nm_file_list_spec~$to_tool_file_cmd in
- *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
- try_normal_branch=yes
- eval cmd=\"$cmd1\"
- func_len " $cmd"
- len=$func_len_result
- ;;
- *)
- try_normal_branch=no
- ;;
- esac
- if test "$try_normal_branch" = yes \
- && { test "$len" -lt "$max_cmd_len" \
- || test "$max_cmd_len" -le -1; }
- then
- func_show_eval "$cmd" 'exit $?'
- skipped_export=false
- elif test -n "$nm_file_list_spec"; then
- func_basename "$output"
- output_la=$func_basename_result
- save_libobjs=$libobjs
- save_output=$output
- output=${output_objdir}/${output_la}.nm
- func_to_tool_file "$output"
- libobjs=$nm_file_list_spec$func_to_tool_file_result
- func_append delfiles " $output"
- func_verbose "creating $NM input file list: $output"
- for obj in $save_libobjs; do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result"
- done > "$output"
- eval cmd=\"$cmd1\"
- func_show_eval "$cmd" 'exit $?'
- output=$save_output
- libobjs=$save_libobjs
- skipped_export=false
+ eval cmd=\"$cmd\"
+ if len=`expr "X$cmd" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ skipped_export=false
else
- # The command line is too long to execute in one step.
- func_verbose "using reloadable object file for export list..."
- skipped_export=:
- # Break out early, otherwise skipped_export may be
- # set to false by a later but shorter cmd.
- break
+ # The command line is too long to execute in one step.
+ $show "using reloadable object file for export list..."
+ skipped_export=:
fi
done
IFS="$save_ifs"
- if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
- func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ if test -n "$export_symbols_regex"; then
+ $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+ $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+ $run eval '$mv "${export_symbols}T" "$export_symbols"'
fi
fi
fi
if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols="$export_symbols"
- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
- fi
-
- if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
- # The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
- # FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands which not all seds can handle. GNU sed should be fine
- # though. Also, the filter scales superlinearly with the number of
- # global variables. join(1) would be nice here, but unfortunately
- # isn't a blessed tool.
- $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- func_append delfiles " $export_symbols $output_objdir/$libname.filter"
- export_symbols=$output_objdir/$libname.def
- $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
fi
tmp_deplibs=
for test_deplib in $deplibs; do
- case " $convenience " in
- *" $test_deplib "*) ;;
- *)
- func_append tmp_deplibs " $test_deplib"
- ;;
- esac
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ tmp_deplibs="$tmp_deplibs $test_deplib"
+ ;;
+ esac
done
deplibs="$tmp_deplibs"
if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec" &&
- test "$compiler_needs_object" = yes &&
- test -z "$libobjs"; then
- # extract the archives, so we have objects to list.
- # TODO: could optimize this to just extract one archive.
- whole_archive_flag_spec=
- fi
if test -n "$whole_archive_flag_spec"; then
save_libobjs=$libobjs
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- test "X$libobjs" = "X " && libobjs=
else
gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
+ generated="$generated $gentop"
func_extract_archives $gentop $convenience
- func_append libobjs " $func_extract_archives_result"
- test "X$libobjs" = "X " && libobjs=
+ libobjs="$libobjs $func_extract_archives_result"
fi
fi
-
+
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
- func_append linker_flags " $flag"
+ linker_flags="$linker_flags $flag"
fi
# Make a backup of the uninstalled library when relinking
- if test "$opt_mode" = relink; then
- $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
fi
# Do each of the archive commands.
@@ -8296,24 +3875,21 @@ EOF
cmds=$module_cmds
fi
else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- eval test_cmds=\"$archive_expsym_cmds\"
- cmds=$archive_expsym_cmds
- else
- eval test_cmds=\"$archive_cmds\"
- cmds=$archive_cmds
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
fi
fi
- if test "X$skipped_export" != "X:" &&
- func_len " $test_cmds" &&
- len=$func_len_result &&
- test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
:
else
- # The command line is too long to link in one step, link piecewise
- # or, if using GNU ld and skipped_export is not :, use a linker
- # script.
+ # The command line is too long to link in one step, link piecewise.
+ $echo "creating reloadable object files..."
# Save the value of $output and $libobjs because we want to
# use them later. If we have whole_archive_flag_spec, we
@@ -8327,171 +3903,77 @@ EOF
save_libobjs=$libobjs
fi
save_output=$output
- func_basename "$output"
- output_la=$func_basename_result
+ output_la=`$echo "X$output" | $Xsed -e "$basename"`
# Clear the reloadable object creation command queue and
# initialize k to one.
test_cmds=
concat_cmds=
objlist=
+ delfiles=
last_robj=
k=1
-
- if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
- output=${output_objdir}/${output_la}.lnkscript
- func_verbose "creating GNU ld script: $output"
- echo 'INPUT (' > $output
- for obj in $save_libobjs
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result" >> $output
- done
- echo ')' >> $output
- func_append delfiles " $output"
- func_to_tool_file "$output"
- output=$func_to_tool_file_result
- elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
- output=${output_objdir}/${output_la}.lnk
- func_verbose "creating linker input file list: $output"
- : > $output
- set x $save_libobjs
- shift
- firstobj=
- if test "$compiler_needs_object" = yes; then
- firstobj="$1 "
- shift
- fi
- for obj
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result" >> $output
- done
- func_append delfiles " $output"
- func_to_tool_file "$output"
- output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
- else
- if test -n "$save_libobjs"; then
- func_verbose "creating reloadable object files..."
- output=$output_objdir/$output_la-${k}.$objext
- eval test_cmds=\"$reload_cmds\"
- func_len " $test_cmds"
- len0=$func_len_result
- len=$len0
-
- # Loop over the list of objects to be linked.
- for obj in $save_libobjs
- do
- func_len " $obj"
- func_arith $len + $func_len_result
- len=$func_arith_result
- if test "X$objlist" = X ||
- test "$len" -lt "$max_cmd_len"; then
- func_append objlist " $obj"
- else
- # The command $test_cmds is almost too long, add a
- # command to the queue.
- if test "$k" -eq 1 ; then
- # The first file doesn't have a previous command to add.
- reload_objs=$objlist
- eval concat_cmds=\"$reload_cmds\"
- else
- # All subsequent reloadable object files will link in
- # the last one created.
- reload_objs="$objlist $last_robj"
- eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
- fi
- last_robj=$output_objdir/$output_la-${k}.$objext
- func_arith $k + 1
- k=$func_arith_result
- output=$output_objdir/$output_la-${k}.$objext
- objlist=" $obj"
- func_len " $last_robj"
- func_arith $len0 + $func_len_result
- len=$func_arith_result
- fi
- done
- # Handle the remaining objects by creating one last
- # reloadable object file. All subsequent reloadable object
- # files will link in the last one created.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- reload_objs="$objlist $last_robj"
- eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
- if test -n "$last_robj"; then
- eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
- fi
- func_append delfiles " $output"
-
+ output=$output_objdir/$output_la-${k}.$objext
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+ if test "X$objlist" = X ||
+ { len=`expr "X$test_cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len"; }; then
+ objlist="$objlist $obj"
else
- output=
- fi
-
- if ${skipped_export-false}; then
- func_verbose "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $opt_dry_run || $RM $export_symbols
- libobjs=$output
- # Append the command to create the export file.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
- if test -n "$last_robj"; then
- eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ k=`expr $k + 1`
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=$obj
+ len=1
fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+ if ${skipped_export-false}; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+ fi
+
+ # Set up a command to remove the reloadable object files
+ # after they are used.
+ i=0
+ while test "$i" -lt "$k"
+ do
+ i=`expr $i + 1`
+ delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
+ done
- test -n "$save_libobjs" &&
- func_verbose "creating a temporary reloadable object file: $output"
-
- # Loop through the commands generated above and execute them.
- save_ifs="$IFS"; IFS='~'
- for cmd in $concat_cmds; do
- IFS="$save_ifs"
- $opt_silent || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
- $opt_dry_run || eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$opt_mode" = relink; then
- ( cd "$output_objdir" && \
- $RM "${realname}T" && \
- $MV "${realname}U" "$realname" )
- fi
+ $echo "creating a temporary reloadable object file: $output"
- exit $lt_exit
- }
- done
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
IFS="$save_ifs"
-
- if test -n "$export_symbols_regex" && ${skipped_export-false}; then
- func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
- fi
- fi
-
- if ${skipped_export-false}; then
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols="$export_symbols"
- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
- fi
-
- if test -n "$orig_export_symbols"; then
- # The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
- # FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands which not all seds can handle. GNU sed should be fine
- # though. Also, the filter scales superlinearly with the number of
- # global variables. join(1) would be nice here, but unfortunately
- # isn't a blessed tool.
- $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- func_append delfiles " $export_symbols $output_objdir/$libname.filter"
- export_symbols=$output_objdir/$libname.def
- $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- fi
- fi
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
libobjs=$output
# Restore the value of output.
@@ -8499,7 +3981,6 @@ EOF
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- test "X$libobjs" = "X " && libobjs=
fi
# Expand the library linking commands again to reset the
# value of $libobjs for piecewise linking.
@@ -8512,69 +3993,37 @@ EOF
cmds=$module_cmds
fi
else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- cmds=$archive_expsym_cmds
- else
- cmds=$archive_cmds
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
fi
fi
- fi
-
- if test -n "$delfiles"; then
- # Append the command to remove temporary files to $cmds.
- eval cmds=\"\$cmds~\$RM $delfiles\"
- fi
-
- # Add any objects from preloaded convenience libraries
- if test -n "$dlprefiles"; then
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
- func_extract_archives $gentop $dlprefiles
- func_append libobjs " $func_extract_archives_result"
- test "X$libobjs" = "X " && libobjs=
+ # Append the command to remove the reloadable object files
+ # to the just-reset $cmds.
+ eval cmds=\"\$cmds~\$rm $delfiles\"
fi
-
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
- $opt_silent || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
- $opt_dry_run || eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$opt_mode" = relink; then
- ( cd "$output_objdir" && \
- $RM "${realname}T" && \
- $MV "${realname}U" "$realname" )
- fi
-
- exit $lt_exit
- }
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
done
IFS="$save_ifs"
# Restore the uninstalled library and exit
- if test "$opt_mode" = relink; then
- $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
-
- if test -n "$convenience"; then
- if test -z "$whole_archive_flag_spec"; then
- func_show_eval '${RM}r "$gentop"'
- fi
- fi
-
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
exit $EXIT_SUCCESS
fi
# Create links to the real library.
for linkname in $linknames; do
if test "$realname" != "$linkname"; then
- func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
fi
done
@@ -8587,35 +4036,38 @@ EOF
;;
obj)
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- func_warning "\`-dlopen' is ignored for objects"
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
fi
- case " $deplibs" in
- *\ -l* | *\ -L*)
- func_warning "\`-l' and \`-L' are ignored for objects" ;;
- esac
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+ fi
- test -n "$rpath" && \
- func_warning "\`-rpath' is ignored for objects"
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+ fi
- test -n "$xrpath" && \
- func_warning "\`-R' is ignored for objects"
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+ fi
- test -n "$vinfo" && \
- func_warning "\`-version-info' is ignored for objects"
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+ fi
- test -n "$release" && \
- func_warning "\`-release' is ignored for objects"
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+ fi
case $output in
*.lo)
- test -n "$objs$old_deplibs" && \
- func_fatal_error "cannot build library object \`$output' from non-libtool objects"
-
- libobj=$output
- func_lo2o "$libobj"
- obj=$func_lo2o_result
+ if test -n "$objs$old_deplibs"; then
+ $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ libobj="$output"
+ obj=`$echo "X$output" | $Xsed -e "$lo2o"`
;;
*)
libobj=
@@ -8624,7 +4076,7 @@ EOF
esac
# Delete the old objects.
- $opt_dry_run || $RM $obj $libobj
+ $run $rm $obj $libobj
# Objects from convenience libraries. This assumes
# single-version convenience libraries. Whenever we create
@@ -8633,36 +4085,40 @@ EOF
reload_conv_objs=
gentop=
# reload_cmds runs $LD directly, so let us get rid of
- # -Wl from whole_archive_flag_spec and hope we can get by with
- # turning comma into space..
+ # -Wl from whole_archive_flag_spec
wl=
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
- eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
- reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
else
gentop="$output_objdir/${obj}x"
- func_append generated " $gentop"
+ generated="$generated $gentop"
func_extract_archives $gentop $convenience
reload_conv_objs="$reload_objs $func_extract_archives_result"
fi
fi
- # If we're not building shared, we need to use non_pic_objs
- test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
-
# Create the old-style object.
- reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+ reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
output="$obj"
- func_execute_cmds "$reload_cmds" 'exit $?'
+ cmds=$reload_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
# Exit if we aren't doing a library object file.
if test -z "$libobj"; then
if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
fi
exit $EXIT_SUCCESS
@@ -8670,13 +4126,14 @@ EOF
if test "$build_libtool_libs" != yes; then
if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
fi
# Create an invalid libtool object if no PIC, so that we don't
# accidentally link it into a program.
# $show "echo timestamp > $libobj"
- # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ # $run eval "echo timestamp > $libobj" || exit $?
exit $EXIT_SUCCESS
fi
@@ -8684,11 +4141,20 @@ EOF
# Only do commands if we really have different PIC objects.
reload_objs="$libobjs $reload_conv_objs"
output="$libobj"
- func_execute_cmds "$reload_cmds" 'exit $?'
+ cmds=$reload_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
fi
if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
fi
exit $EXIT_SUCCESS
@@ -8696,78 +4162,43 @@ EOF
prog)
case $host in
- *cygwin*) func_stripname '' '.exe' "$output"
- output=$func_stripname_result.exe;;
+ *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
esac
- test -n "$vinfo" && \
- func_warning "\`-version-info' is ignored for programs"
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+ fi
- test -n "$release" && \
- func_warning "\`-release' is ignored for programs"
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+ fi
- test "$preload" = yes \
- && test "$dlopen_support" = unknown \
- && test "$dlopen_self" = unknown \
- && test "$dlopen_self_static" = unknown && \
- func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+ if test "$preload" = yes; then
+ if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+ test "$dlopen_self_static" = unknown; then
+ $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+ fi
+ fi
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library is the System framework
- compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
- finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
;;
esac
case $host in
- *-*-darwin*)
- # Don't allow lazy linking, it breaks C++ global constructors
- # But is supposedly fixed on 10.4 or later (yay!).
- if test "$tagname" = CXX ; then
- case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
- 10.[0123])
- func_append compile_command " ${wl}-bind_at_load"
- func_append finalize_command " ${wl}-bind_at_load"
- ;;
- esac
- fi
- # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- ;;
+ *darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ if test "$tagname" = CXX ; then
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ fi
+ ;;
esac
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $compile_deplibs " in
- *" -L$path/$objdir "*)
- func_append new_libs " -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $compile_deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) func_append new_libs " $deplib" ;;
- esac
- ;;
- *) func_append new_libs " $deplib" ;;
- esac
- done
- compile_deplibs="$new_libs"
-
-
- func_append compile_command " $compile_deplibs"
- func_append finalize_command " $finalize_deplibs"
+ compile_command="$compile_command $compile_deplibs"
+ finalize_command="$finalize_command $finalize_deplibs"
if test -n "$rpath$xrpath"; then
# If the user specified any rpath flags, then add them.
@@ -8775,7 +4206,7 @@ EOF
# This is the magic to use -rpath.
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
esac
done
fi
@@ -8794,32 +4225,25 @@ EOF
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
- func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
- func_append rpath " $flag"
+ rpath="$rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
- *) func_append perm_rpath " $libdir" ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
case :$dllsearchpath: in
*":$libdir:"*) ;;
- ::) dllsearchpath=$libdir;;
- *) func_append dllsearchpath ":$libdir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- ::) dllsearchpath=$testbindir;;
- *) func_append dllsearchpath ":$testbindir";;
+ *) dllsearchpath="$dllsearchpath:$libdir";;
esac
;;
esac
@@ -8845,18 +4269,18 @@ EOF
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
- func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
- func_append rpath " $flag"
+ rpath="$rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$finalize_perm_rpath " in
*" $libdir "*) ;;
- *) func_append finalize_perm_rpath " $libdir" ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
esac
fi
done
@@ -8870,55 +4294,254 @@ EOF
if test -n "$libobjs" && test "$build_old_libs" = yes; then
# Transform all the library objects into standard objects.
- compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
- finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
fi
- func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+ dlsyms=
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ dlsyms="${outputname}S.c"
+ else
+ $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+ fi
+ fi
+
+ if test -n "$dlsyms"; then
+ case $dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${outputname}.nm"
+
+ $show "$rm $nlist ${nlist}S ${nlist}T"
+ $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+ # Parse the name list into a source file.
+ $show "creating $output_objdir/$dlsyms"
+
+ test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ $show "generating symbol list for \`$output'"
+
+ test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for arg in $progfiles; do
+ $show "extracting global C symbols from \`$arg'"
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $run $rm $export_symbols
+ $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ else
+ $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ fi
+ fi
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+ name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+ $run eval '$echo ": $name " >> "$nlist"'
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -z "$run"; then
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $mv "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if grep -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ grep -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+ else
+ $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+ fi
+
+ $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+"
+
+ case $host in
+ *cygwin* | *mingw* )
+ $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+ runtime relocations are performed -- see ld's documentation
+ on pseudo-relocs */
+struct {
+"
+ ;;
+ * )
+ $echo >> "$output_objdir/$dlsyms" "\
+const struct {
+"
+ ;;
+ esac
+
+
+ $echo >> "$output_objdir/$dlsyms" "\
+ const char *name;
+ lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+ $echo >> "$output_objdir/$dlsyms" "\
+ {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ fi
- # template prelinking step
- if test -n "$prelink_cmds"; then
- func_execute_cmds "$prelink_cmds" 'exit $?'
+ pic_flag_for_symtable=
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+ esac;;
+ *-*-hpux*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag";;
+ esac
+ esac
+
+ # Now compile the dynamic symbol file.
+ $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+ $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+ # Clean up the generated files.
+ $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+ $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+ # Transform the symbol file into the correct name.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ ;;
+ *)
+ $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
fi
- wrappers_required=yes
- case $host in
- *cegcc* | *mingw32ce*)
- # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
- wrappers_required=no
- ;;
- *cygwin* | *mingw* )
- if test "$build_libtool_libs" != yes; then
- wrappers_required=no
- fi
- ;;
- *)
- if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
- wrappers_required=no
- fi
- ;;
- esac
- if test "$wrappers_required" = no; then
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
# Replace the output file specification.
- compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
- exit_status=0
- func_show_eval "$link_command" 'exit_status=$?'
-
- if test -n "$postlink_cmds"; then
- func_to_tool_file "$output"
- postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
- func_execute_cmds "$postlink_cmds" 'exit $?'
- fi
+ $show "$link_command"
+ $run eval "$link_command"
+ status=$?
# Delete the generated files.
- if test -f "$output_objdir/${outputname}S.${objext}"; then
- func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ if test -n "$dlsyms"; then
+ $show "$rm $output_objdir/${outputname}S.${objext}"
+ $run $rm "$output_objdir/${outputname}S.${objext}"
fi
- exit $exit_status
+ exit $status
+ fi
+
+ if test -n "$shlibpath_var"; then
+ # We should set the shlibpath_var
+ rpath=
+ for dir in $temp_rpath; do
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*)
+ # Absolute path.
+ rpath="$rpath$dir:"
+ ;;
+ *)
+ # Relative path: add a thisdir entry.
+ rpath="$rpath\$thisdir/$dir:"
+ ;;
+ esac
+ done
+ temp_rpath="$rpath"
fi
if test -n "$compile_shlibpath$finalize_shlibpath"; then
@@ -8935,7 +4558,7 @@ EOF
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
- func_append rpath "$dir:"
+ rpath="$rpath$dir:"
done
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
@@ -8943,7 +4566,7 @@ EOF
# We should set the runpath_var.
rpath=
for dir in $finalize_perm_rpath; do
- func_append rpath "$dir:"
+ rpath="$rpath$dir:"
done
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
@@ -8953,18 +4576,12 @@ EOF
# We don't need to create a wrapper script.
link_command="$compile_var$compile_command$compile_rpath"
# Replace the output file specification.
- link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
# Delete the old output file.
- $opt_dry_run || $RM $output
+ $run $rm $output
# Link the executable and exit
- func_show_eval "$link_command" 'exit $?'
-
- if test -n "$postlink_cmds"; then
- func_to_tool_file "$output"
- postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
- func_execute_cmds "$postlink_cmds" 'exit $?'
- fi
-
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
exit $EXIT_SUCCESS
fi
@@ -8973,13 +4590,13 @@ EOF
link_command="$compile_var$compile_command$compile_rpath"
relink_command="$finalize_var$finalize_command$finalize_rpath"
- func_warning "this platform does not like uninstalled shared libraries"
- func_warning "\`$output' will be relinked during installation"
+ $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+ $echo "$modename: \`$output' will be relinked during installation" 1>&2
else
if test "$fast_install" != no; then
link_command="$finalize_var$compile_command$finalize_rpath"
if test "$fast_install" = yes; then
- relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
else
# fast_install is set to needless
relink_command=
@@ -8991,98 +4608,448 @@ EOF
fi
# Replace the output file specification.
- link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
# Delete the old output files.
- $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
- func_show_eval "$link_command" 'exit $?'
+ $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
- if test -n "$postlink_cmds"; then
- func_to_tool_file "$output_objdir/$outputname"
- postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
- func_execute_cmds "$postlink_cmds" 'exit $?'
- fi
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
# Now create the wrapper script.
- func_verbose "creating $output"
+ $show "creating $output"
# Quote the relink command for shipping.
if test -n "$relink_command"; then
# Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
fi
done
relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
fi
- # Only actually do things if not in dry run mode.
- $opt_dry_run || {
+ # Quote $echo for shipping.
+ if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
+ case $progpath in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+ esac
+ qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+ else
+ qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if our run command is non-null.
+ if test -z "$run"; then
# win32 will think the script is a binary if it has
# a .exe suffix, so we strip it off here.
case $output in
- *.exe) func_stripname '' '.exe' "$output"
- output=$func_stripname_result ;;
+ *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
esac
# test for cygwin because mv fails w/o .exe extensions
case $host in
*cygwin*)
exeext=.exe
- func_stripname '' '.exe' "$outputname"
- outputname=$func_stripname_result ;;
+ outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
*) exeext= ;;
esac
case $host in
*cygwin* | *mingw* )
- func_dirname_and_basename "$output" "" "."
- output_name=$func_basename_result
- output_path=$func_dirname_result
- cwrappersource="$output_path/$objdir/lt-$output_name.c"
- cwrapper="$output_path/$output_name.exe"
- $RM $cwrappersource $cwrapper
- trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
- func_emit_cwrapperexe_src > $cwrappersource
-
- # The wrapper executable is built using the $host compiler,
- # because it contains $host paths and files. If cross-
- # compiling, it, like the target executable, must be
- # executed on the $host or under an emulation environment.
- $opt_dry_run || {
- $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
- $STRIP $cwrapper
- }
-
- # Now, create the wrapper script for func_source use:
- func_ltwrapper_scriptname $cwrapper
- $RM $func_ltwrapper_scriptname_result
- trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
- $opt_dry_run || {
- # note: this script will not be executed, so do not chmod.
- if test "x$build" = "x$host" ; then
- $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
- else
- func_emit_wrapper no > $func_ltwrapper_scriptname_result
- fi
- }
+ cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
+ cwrapper=`$echo ${output}.exe`
+ $rm $cwrappersource $cwrapper
+ trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "/bin/sh $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+#define DIR_SEPARATOR '/'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+#define HAVE_DOS_BASED_FILE_SYSTEM
+#ifndef DIR_SEPARATOR_2
+#define DIR_SEPARATOR_2 '\\'
+#endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+char * basename (const char *name);
+char * fnqualify(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int i;
+
+ program_name = (char *) xstrdup ((char *) basename (argv[0]));
+ newargz = XMALLOC(char *, argc+2);
+EOF
+
+ cat >> $cwrappersource <<EOF
+ newargz[0] = "$SHELL";
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+ newargz[1] = fnqualify(argv[0]);
+ /* we know the script has the same name, without the .exe */
+ /* so make sure newargz[1] doesn't end in .exe */
+ strendzap(newargz[1],".exe");
+ for (i = 1; i < argc; i++)
+ newargz[i+1] = xstrdup(argv[i]);
+ newargz[argc+1] = NULL;
+EOF
+
+ cat >> $cwrappersource <<EOF
+ execv("$SHELL",newargz);
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void * p = (void *) malloc (num);
+ if (!p)
+ lt_fatal ("Memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+char *
+basename (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha (name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return (char *) base;
+}
+
+char *
+fnqualify(const char *path)
+{
+ size_t size;
+ char *p;
+ char tmp[LT_PATHMAX + 1];
+
+ assert(path != NULL);
+
+ /* Is it qualified already? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha (path[0]) && path[1] == ':')
+ return xstrdup (path);
+#endif
+ if (IS_DIR_SEPARATOR (path[0]))
+ return xstrdup (path);
+
+ /* prepend the current directory */
+ /* doesn't handle '~' */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
+ p = XMALLOC(char, size);
+ sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
+ return p;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert(str != NULL);
+ assert(pat != NULL);
+
+ len = strlen(str);
+ patlen = strlen(pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp(str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+ const char * message, va_list ap)
+{
+ fprintf (stderr, "%s: %s: ", program_name, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ va_end (ap);
+}
+EOF
+ # we should really use a build-platform specific compiler
+ # here, but OTOH, the wrappers (shell script and this C one)
+ # are only useful if you want to execute the "real" binary.
+ # Since the "real" binary is built for $host, then this
+ # wrapper might as well be built for $host, too.
+ $run $LTCC -s -o $cwrapper $cwrappersource
;;
- * )
- $RM $output
- trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+ esac
+ $rm $output
+ trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
- func_emit_wrapper no > $output
- chmod +x $output
+ $echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variable:
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$echo are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ echo=\"$qecho\"
+ file=\"\$0\"
+ # Make sure echo works.
+ if test \"X\$1\" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+ # Yippee, \$echo works!
+ :
+ else
+ # Restart under the correct shell, and then maybe \$echo will work.
+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+ fi
+ fi\
+"
+ $echo >> $output "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $echo >> $output "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" || \\
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $mkdir \"\$progdir\"
+ else
+ $rm \"\$progdir/\$file\"
+ fi"
+
+ $echo >> $output "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $echo \"\$relink_command_output\" >&2
+ $rm \"\$progdir/\$file\"
+ exit $EXIT_FAILURE
+ fi
+ fi
+
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $rm \"\$progdir/\$program\";
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $rm \"\$progdir/\$file\"
+ fi"
+ else
+ $echo >> $output "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $echo >> $output "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $echo >> $output "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ # fixup the dll searchpath if we need to.
+ if test -n "$dllsearchpath"; then
+ $echo >> $output "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ $echo >> $output "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2*)
+ $echo >> $output "\
+ exec \$progdir\\\\\$program \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $echo >> $output "\
+ exec \$progdir/\$program \${1+\"\$@\"}
+"
;;
esac
- }
+ $echo >> $output "\
+ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+ exit $EXIT_FAILURE
+ fi
+ else
+ # The program doesn't exist.
+ \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+ \$echo \"This script is just a wrapper for \$program.\" 1>&2
+ $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit $EXIT_FAILURE
+ fi
+fi\
+"
+ chmod +x $output
+ fi
exit $EXIT_SUCCESS
;;
esac
@@ -9091,7 +5058,7 @@ EOF
for oldlib in $oldlibs; do
if test "$build_libtool_libs" = convenience; then
- oldobjs="$libobjs_save $symfileobj"
+ oldobjs="$libobjs_save"
addlibs="$convenience"
build_libtool_libs=no
else
@@ -9100,35 +5067,22 @@ EOF
build_libtool_libs=no
else
oldobjs="$old_deplibs $non_pic_objects"
- if test "$preload" = yes && test -f "$symfileobj"; then
- func_append oldobjs " $symfileobj"
- fi
fi
addlibs="$old_convenience"
fi
if test -n "$addlibs"; then
gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
+ generated="$generated $gentop"
func_extract_archives $gentop $addlibs
- func_append oldobjs " $func_extract_archives_result"
+ oldobjs="$oldobjs $func_extract_archives_result"
fi
# Do each command in the archive commands.
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
- cmds=$old_archive_from_new_cmds
+ cmds=$old_archive_from_new_cmds
else
-
- # Add any objects from preloaded convenience libraries
- if test -n "$dlprefiles"; then
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
-
- func_extract_archives $gentop $dlprefiles
- func_append oldobjs " $func_extract_archives_result"
- fi
-
# POSIX demands no paths to be encoded in archives. We have
# to avoid creating archives with duplicate basenames if we
# might have to extract them afterwards, e.g., when creating a
@@ -9137,22 +5091,32 @@ EOF
# not supported by libtool).
if (for obj in $oldobjs
do
- func_basename "$obj"
- $ECHO "$func_basename_result"
+ $echo "X$obj" | $Xsed -e 's%^.*/%%'
done | sort | sort -uc >/dev/null 2>&1); then
:
else
- echo "copying selected object files to avoid basename conflicts..."
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
- func_mkdir_p "$gentop"
+ $echo "copying selected object files to avoid basename conflicts..."
+
+ if test -z "$gentop"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ fi
+
save_oldobjs=$oldobjs
oldobjs=
counter=1
for obj in $save_oldobjs
do
- func_basename "$obj"
- objbase="$func_basename_result"
+ objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
case " $oldobjs " in
" ") oldobjs=$obj ;;
*[\ /]"$objbase "*)
@@ -9160,74 +5124,58 @@ EOF
# Make sure we don't pick an alternate name that also
# overlaps.
newobj=lt$counter-$objbase
- func_arith $counter + 1
- counter=$func_arith_result
+ counter=`expr $counter + 1`
case " $oldobjs " in
*[\ /]"$newobj "*) ;;
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
esac
done
- func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
- func_append oldobjs " $gentop/$newobj"
+ $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ $run ln "$obj" "$gentop/$newobj" ||
+ $run cp "$obj" "$gentop/$newobj"
+ oldobjs="$oldobjs $gentop/$newobj"
;;
- *) func_append oldobjs " $obj" ;;
+ *) oldobjs="$oldobjs $obj" ;;
esac
done
fi
- func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
- tool_oldlib=$func_to_tool_file_result
+
eval cmds=\"$old_archive_cmds\"
- func_len " $cmds"
- len=$func_len_result
- if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- cmds=$old_archive_cmds
- elif test -n "$archiver_list_spec"; then
- func_verbose "using command file archive linking..."
- for obj in $oldobjs
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result"
- done > $output_objdir/$libname.libcmd
- func_to_tool_file "$output_objdir/$libname.libcmd"
- oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ if len=`expr "X$cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
cmds=$old_archive_cmds
else
# the command line is too long to link in one step, link in parts
- func_verbose "using piecewise archive linking..."
+ $echo "using piecewise archive linking..."
save_RANLIB=$RANLIB
RANLIB=:
objlist=
concat_cmds=
save_oldobjs=$oldobjs
- oldobjs=
+
# Is there a better way of finding the last object in the list?
for obj in $save_oldobjs
do
last_oldobj=$obj
done
- eval test_cmds=\"$old_archive_cmds\"
- func_len " $test_cmds"
- len0=$func_len_result
- len=$len0
for obj in $save_oldobjs
do
- func_len " $obj"
- func_arith $len + $func_len_result
- len=$func_arith_result
- func_append objlist " $obj"
- if test "$len" -lt "$max_cmd_len"; then
+ oldobjs="$objlist $obj"
+ objlist="$objlist $obj"
+ eval test_cmds=\"$old_archive_cmds\"
+ if len=`expr "X$test_cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len"; then
:
else
# the above command should be used before it gets too long
oldobjs=$objlist
if test "$obj" = "$last_oldobj" ; then
- RANLIB=$save_RANLIB
+ RANLIB=$save_RANLIB
fi
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
objlist=
- len=$len0
fi
done
RANLIB=$save_RANLIB
@@ -9239,39 +5187,49 @@ EOF
fi
fi
fi
- func_execute_cmds "$cmds" 'exit $?'
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ eval cmd=\"$cmd\"
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
done
- test -n "$generated" && \
- func_show_eval "${RM}r$generated"
+ if test -n "$generated"; then
+ $show "${rm}r$generated"
+ $run ${rm}r$generated
+ fi
# Now create the libtool archive.
case $output in
*.la)
old_library=
test "$build_old_libs" = yes && old_library="$libname.$libext"
- func_verbose "creating $output"
+ $show "creating $output"
# Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
fi
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
if test "$hardcode_automatic" = yes ; then
relink_command=
fi
+
# Only create the output if not a dry run.
- $opt_dry_run || {
+ if test -z "$run"; then
for installed in no yes; do
if test "$installed" = yes; then
if test -z "$install_libdir"; then
@@ -9283,60 +5241,38 @@ EOF
for deplib in $dependency_libs; do
case $deplib in
*.la)
- func_basename "$deplib"
- name="$func_basename_result"
- func_resolve_sysroot "$deplib"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
- test -z "$libdir" && \
- func_fatal_error "\`$deplib' is not a valid libtool archive"
- func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
- ;;
- -L*)
- func_stripname -L '' "$deplib"
- func_replace_sysroot "$func_stripname_result"
- func_append newdependency_libs " -L$func_replace_sysroot_result"
- ;;
- -R*)
- func_stripname -R '' "$deplib"
- func_replace_sysroot "$func_stripname_result"
- func_append newdependency_libs " -R$func_replace_sysroot_result"
+ name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ newdependency_libs="$newdependency_libs $libdir/$name"
;;
- *) func_append newdependency_libs " $deplib" ;;
+ *) newdependency_libs="$newdependency_libs $deplib" ;;
esac
done
dependency_libs="$newdependency_libs"
newdlfiles=
-
for lib in $dlfiles; do
- case $lib in
- *.la)
- func_basename "$lib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- test -z "$libdir" && \
- func_fatal_error "\`$lib' is not a valid libtool archive"
- func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
- ;;
- *) func_append newdlfiles " $lib" ;;
- esac
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ newdlfiles="$newdlfiles $libdir/$name"
done
dlfiles="$newdlfiles"
newdlprefiles=
for lib in $dlprefiles; do
- case $lib in
- *.la)
- # Only pass preopened files to the pseudo-archive (for
- # eventual linking with the app. that links it) if we
- # didn't already link the preopened objects directly into
- # the library:
- func_basename "$lib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- test -z "$libdir" && \
- func_fatal_error "\`$lib' is not a valid libtool archive"
- func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
- ;;
- esac
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ newdlprefiles="$newdlprefiles $libdir/$name"
done
dlprefiles="$newdlprefiles"
else
@@ -9346,7 +5282,7 @@ EOF
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
- func_append newdlfiles " $abs"
+ newdlfiles="$newdlfiles $abs"
done
dlfiles="$newdlfiles"
newdlprefiles=
@@ -9355,37 +5291,19 @@ EOF
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
- func_append newdlprefiles " $abs"
+ newdlprefiles="$newdlprefiles $abs"
done
dlprefiles="$newdlprefiles"
fi
- $RM $output
+ $rm $output
# place dlname in correct position for cygwin
- # In fact, it would be nice if we could use this code for all target
- # systems that can't hard-code library paths into their executables
- # and that have no shared library path variable independent of PATH,
- # but it turns out we can't easily determine that from inspecting
- # libtool variables, so we have to hard-code the OSs to which it
- # applies here; at the moment, that means platforms that use the PE
- # object format with DLL files. See the long comment at the top of
- # tests/bindir.at for full details.
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
- # If a -bindir argument was supplied, place the dll there.
- if test "x$bindir" != x ;
- then
- func_relative_path "$install_libdir" "$bindir"
- tdlname=$func_relative_path_result$dlname
- else
- # Otherwise fall back on heuristic.
- tdlname=../bin/$dlname
- fi
- ;;
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
esac
- $ECHO > $output "\
+ $echo > $output "\
# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
@@ -9399,15 +5317,9 @@ library_names='$library_names'
# The name of the static archive.
old_library='$old_library'
-# Linker flags that can not go in dependency_libs.
-inherited_linker_flags='$new_inherited_linker_flags'
-
# Libraries that this one depends upon.
dependency_libs='$dependency_libs'
-# Names of additional weak libraries provided by this library
-weak_library_names='$weak_libs'
-
# Version information for $libname.
current=$current
age=$age
@@ -9426,29 +5338,746 @@ dlpreopen='$dlprefiles'
# Directory that this library needs to be installed in:
libdir='$install_libdir'"
if test "$installed" = no && test "$need_relink" = yes; then
- $ECHO >> $output "\
+ $echo >> $output "\
relink_command=\"$relink_command\""
fi
done
- }
+ fi
# Do a symbolic link so that the libtool archive can be found in
# LD_LIBRARY_PATH before the program is installed.
- func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+ $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
;;
esac
exit $EXIT_SUCCESS
-}
+ ;;
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
- func_mode_link ${1+"$@"}
+ # libtool install mode
+ install)
+ modename="$modename: install"
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
+ # Aesthetically quote it.
+ arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$arg "
+ arg="$1"
+ shift
+ else
+ install_prog=
+ arg="$nonopt"
+ fi
-# func_mode_uninstall arg...
-func_mode_uninstall ()
-{
- $opt_debug
- RM="$nonopt"
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog$arg"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest="$arg"
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f) prev="-f" ;;
+ -g) prev="-g" ;;
+ -m) prev="-m" ;;
+ -o) prev="-o" ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*) ;;
+
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest="$arg"
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog $arg"
+ done
+
+ if test -z "$install_prog"; then
+ $echo "$modename: you must specify an install program" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prev' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ $echo "$modename: no file or destination specified" 1>&2
+ else
+ $echo "$modename: you must specify a destination" 1>&2
+ fi
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Strip any trailing slash from the destination.
+ dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$destdir" = "X$dest" && destdir=.
+ destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files
+ if test "$#" -gt 2; then
+ $echo "$modename: \`$dest' is not a directory" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ library_names=
+ old_library=
+ relink_command=
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+ test "X$dir" = "X$file/" && dir=
+ dir="$dir$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ if test "$inst_prefix_dir" = "$destdir"; then
+ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ $echo "$modename: warning: relinking \`$file'" 1>&2
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names
+ if test -n "$2"; then
+ realname="$2"
+ shift
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ $show "$install_prog $dir/$srcname $destdir/$realname"
+ $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+ if test -n "$stripme" && test -n "$striplib"; then
+ $show "$striplib $destdir/$realname"
+ $run eval "$striplib $destdir/$realname" || exit $?
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ for linkname
+ do
+ if test "$linkname" != "$realname"; then
+ $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ fi
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ cmds=$postinstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Install the pseudo-library for information purposes.
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ instname="$dir/$name"i
+ $show "$install_prog $instname $destdir/$name"
+ $run eval "$install_prog $instname $destdir/$name" || exit $?
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ if test -n "$destfile"; then
+ $show "$install_prog $file $destfile"
+ $run eval "$install_prog $file $destfile" || exit $?
+ fi
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+ $show "$install_prog $staticobj $staticdest"
+ $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin*|*mingw*)
+ wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+ notinst_deplibs=
+ relink_command=
+
+ # To insure that "foo" is sourced, and not "foo.exe",
+ # finese the cygwin/MSYS system by explicitly sourcing "foo."
+ # which disallows the automatic-append-.exe behavior.
+ case $build in
+ *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+ *) wrapperdot=${wrapper} ;;
+ esac
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . ${wrapperdot} ;;
+ *) . ./${wrapperdot} ;;
+ esac
+
+ # Check the variables that should have been set.
+ if test -z "$notinst_deplibs"; then
+ $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ # If there is no directory component, then add one.
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ fi
+ libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ # To insure that "foo" is sourced, and not "foo.exe",
+ # finese the cygwin/MSYS system by explicitly sourcing "foo."
+ # which disallows the automatic-append-.exe behavior.
+ case $build in
+ *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+ *) wrapperdot=${wrapper} ;;
+ esac
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . ${wrapperdot} ;;
+ *) . ./${wrapperdot} ;;
+ esac
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ if test "$finalize" = yes && test -z "$run"; then
+ tmpdir="/tmp"
+ test -n "$TMPDIR" && tmpdir="$TMPDIR"
+ tmpdir="$tmpdir/libtool-$$"
+ save_umask=`umask`
+ umask 0077
+ if $mkdir "$tmpdir"; then
+ umask $save_umask
+ else
+ umask $save_umask
+ $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+ continue
+ fi
+ file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ ${rm}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ $echo "$modename: warning: cannot relink \`$file'" 1>&2
+ fi
+ else
+ # Install the binary that we compiled earlier.
+ file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyways
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
+ ;;
+ esac
+ ;;
+ esac
+ $show "$install_prog$stripme $file $destfile"
+ $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+ test -n "$outputname" && ${rm}r "$tmpdir"
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ $show "$install_prog $file $oldlib"
+ $run eval "$install_prog \$file \$oldlib" || exit $?
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ $show "$old_striplib $oldlib"
+ $run eval "$old_striplib $oldlib" || exit $?
+ fi
+
+ # Do each command in the postinstall commands.
+ cmds=$old_postinstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$future_libdirs"; then
+ $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+ fi
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ test -n "$run" && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+ ;;
+
+ # libtool finish mode
+ finish)
+ modename="$modename: finish"
+ libdirs="$nonopt"
+ admincmds=
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ cmds=$finish_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || admincmds="$admincmds
+ $cmd"
+ done
+ IFS="$save_ifs"
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $run eval "$cmds" || admincmds="$admincmds
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ test "$show" = : && exit $EXIT_SUCCESS
+
+ $echo "----------------------------------------------------------------------"
+ $echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $echo " $libdir"
+ done
+ $echo
+ $echo "If you ever happen to want to link against installed libraries"
+ $echo "in a given directory, LIBDIR, you must either use libtool, and"
+ $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ $echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ $echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ $echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ $echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $echo " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $echo " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ $echo
+ $echo "See any operating system documentation about shared libraries for"
+ $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ $echo "----------------------------------------------------------------------"
+ exit $EXIT_SUCCESS
+ ;;
+
+ # libtool execute mode
+ execute)
+ modename="$modename: execute"
+
+ # The first argument is the command name.
+ cmd="$nonopt"
+ if test -z "$cmd"; then
+ $echo "$modename: you must specify a COMMAND" 1>&2
+ $echo "$help"
+ exit $EXIT_FAILURE
+ fi
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ if test ! -f "$file"; then
+ $echo "$modename: \`$file' is not a file" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ dir=
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+ ;;
+
+ *)
+ $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+ args="$args \"$file\""
+ done
+
+ if test -z "$run"; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ if test "${save_LC_ALL+set}" = set; then
+ LC_ALL="$save_LC_ALL"; export LC_ALL
+ fi
+ if test "${save_LANG+set}" = set; then
+ LANG="$save_LANG"; export LANG
+ fi
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+ $echo "export $shlibpath_var"
+ fi
+ $echo "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+ ;;
+
+ # libtool clean and uninstall mode
+ clean | uninstall)
+ modename="$modename: $mode"
+ rm="$nonopt"
files=
rmforce=
exit_status=0
@@ -9460,41 +6089,44 @@ func_mode_uninstall ()
for arg
do
case $arg in
- -f) func_append RM " $arg"; rmforce=yes ;;
- -*) func_append RM " $arg" ;;
- *) func_append files " $arg" ;;
+ -f) rm="$rm $arg"; rmforce=yes ;;
+ -*) rm="$rm $arg" ;;
+ *) files="$files $arg" ;;
esac
done
- test -z "$RM" && \
- func_fatal_help "you must specify an RM program"
+ if test -z "$rm"; then
+ $echo "$modename: you must specify an RM program" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
rmdirs=
+ origobjdir="$objdir"
for file in $files; do
- func_dirname "$file" "" "."
- dir="$func_dirname_result"
- if test "X$dir" = X.; then
- odir="$objdir"
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$dir" = "X$file"; then
+ dir=.
+ objdir="$origobjdir"
else
- odir="$dir/$objdir"
+ objdir="$dir/$origobjdir"
fi
- func_basename "$file"
- name="$func_basename_result"
- test "$opt_mode" = uninstall && odir="$dir"
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ test "$mode" = uninstall && objdir="$dir"
- # Remember odir for removal later, being careful to avoid duplicates
- if test "$opt_mode" = clean; then
+ # Remember objdir for removal later, being careful to avoid duplicates
+ if test "$mode" = clean; then
case " $rmdirs " in
- *" $odir "*) ;;
- *) func_append rmdirs " $odir" ;;
+ *" $objdir "*) ;;
+ *) rmdirs="$rmdirs $objdir" ;;
esac
fi
# Don't error if the file doesn't exist and rm -f was used.
- if { test -L "$file"; } >/dev/null 2>&1 ||
- { test -h "$file"; } >/dev/null 2>&1 ||
- test -f "$file"; then
+ if (test -L "$file") >/dev/null 2>&1 \
+ || (test -h "$file") >/dev/null 2>&1 \
+ || test -f "$file"; then
:
elif test -d "$file"; then
exit_status=1
@@ -9508,130 +6140,335 @@ func_mode_uninstall ()
case $name in
*.la)
# Possibly a libtool archive, so verify it.
- if func_lalib_p "$file"; then
- func_source $dir/$name
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ . $dir/$name
# Delete the libtool libraries and symlinks.
for n in $library_names; do
- func_append rmfiles " $odir/$n"
+ rmfiles="$rmfiles $objdir/$n"
done
- test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+ test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
- case "$opt_mode" in
- clean)
- case " $library_names " in
- *" $dlname "*) ;;
- *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
- esac
- test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
- ;;
- uninstall)
+ if test "$mode" = uninstall; then
if test -n "$library_names"; then
# Do each command in the postuninstall commands.
- func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ cmds=$postuninstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
fi
if test -n "$old_library"; then
# Do each command in the old_postuninstall commands.
- func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ cmds=$old_postuninstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
fi
# FIXME: should reinstall the best remaining shared library.
- ;;
- esac
+ fi
fi
;;
*.lo)
# Possibly a libtool object, so verify it.
- if func_lalib_p "$file"; then
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
# Read the .lo file
- func_source $dir/$name
+ . $dir/$name
# Add PIC object to the list of files to remove.
- if test -n "$pic_object" &&
- test "$pic_object" != none; then
- func_append rmfiles " $dir/$pic_object"
+ if test -n "$pic_object" \
+ && test "$pic_object" != none; then
+ rmfiles="$rmfiles $dir/$pic_object"
fi
# Add non-PIC object to the list of files to remove.
- if test -n "$non_pic_object" &&
- test "$non_pic_object" != none; then
- func_append rmfiles " $dir/$non_pic_object"
+ if test -n "$non_pic_object" \
+ && test "$non_pic_object" != none; then
+ rmfiles="$rmfiles $dir/$non_pic_object"
fi
fi
;;
*)
- if test "$opt_mode" = clean ; then
+ if test "$mode" = clean ; then
noexename=$name
case $file in
*.exe)
- func_stripname '' '.exe' "$file"
- file=$func_stripname_result
- func_stripname '' '.exe' "$name"
- noexename=$func_stripname_result
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ noexename=`$echo $name|${SED} 's,.exe$,,'`
# $file with .exe has already been added to rmfiles,
# add $file without .exe
- func_append rmfiles " $file"
+ rmfiles="$rmfiles $file"
;;
esac
# Do a test to see if this is a libtool program.
- if func_ltwrapper_p "$file"; then
- if func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- relink_command=
- func_source $func_ltwrapper_scriptname_result
- func_append rmfiles " $func_ltwrapper_scriptname_result"
- else
- relink_command=
- func_source $dir/$noexename
- fi
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ relink_command=
+ . $dir/$noexename
# note $name still contains .exe if it was in $file originally
# as does the version of $file that was added into $rmfiles
- func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
if test "$fast_install" = yes && test -n "$relink_command"; then
- func_append rmfiles " $odir/lt-$name"
+ rmfiles="$rmfiles $objdir/lt-$name"
fi
if test "X$noexename" != "X$name" ; then
- func_append rmfiles " $odir/lt-${noexename}.c"
+ rmfiles="$rmfiles $objdir/lt-${noexename}.c"
fi
fi
fi
;;
esac
- func_show_eval "$RM $rmfiles" 'exit_status=1'
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles || exit_status=1
done
+ objdir="$origobjdir"
# Try to remove the ${objdir}s in the directories where we deleted files
for dir in $rmdirs; do
if test -d "$dir"; then
- func_show_eval "rmdir $dir >/dev/null 2>&1"
+ $show "rmdir $dir"
+ $run rmdir $dir >/dev/null 2>&1
fi
done
exit $exit_status
-}
-
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
- func_mode_uninstall ${1+"$@"}
+ ;;
-test -z "$opt_mode" && {
- help="$generic_help"
- func_fatal_help "you must specify a MODE"
-}
+ "")
+ $echo "$modename: you must specify a MODE" 1>&2
+ $echo "$generic_help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
-test -z "$exec_cmd" && \
- func_fatal_help "invalid operation mode \`$opt_mode'"
+ if test -z "$exec_cmd"; then
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$generic_help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+fi # test -z "$show_help"
if test -n "$exec_cmd"; then
- eval exec "$exec_cmd"
+ eval exec $exec_cmd
exit $EXIT_FAILURE
fi
-exit $exit_status
+# We need to display help for each of the modes.
+case $mode in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+-n, --dry-run display commands without modifying any files
+ --features display basic configuration information and exit
+ --finish same as \`--mode=finish'
+ --help display this help message and exit
+ --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
+ --quiet same as \`--silent'
+ --silent don't print informational messages
+ --tag=TAG use configuration variables from tag TAG
+ --version print version information
+
+MODE must be one of the following:
+
+ clean remove files from the build directory
+ compile compile a source file into a libtool object
+ execute automatically set library path, then run a program
+ finish complete the installation of libtool libraries
+ install install libraries or executables
+ link create a library or an executable
+ uninstall remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool@gnu.org>."
+ exit $EXIT_SUCCESS
+ ;;
+
+clean)
+ $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+compile)
+ $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -prefer-pic try to building PIC objects only
+ -prefer-non-pic try to building non-PIC objects only
+ -static always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+execute)
+ $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+finish)
+ $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+install)
+ $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+link)
+ $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -static do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+uninstall)
+ $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+*)
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit $?
# The TAGs below are defined such that we never get into a situation
# in which we disable both kinds of libraries. Given conflicting
@@ -9650,12 +6487,10 @@ build_old_libs=yes
# ### END LIBTOOL TAG CONFIG: disable-shared
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
# ### END LIBTOOL TAG CONFIG: disable-static
# Local Variables:
# mode:shell-script
# sh-indentation:2
# End:
-# vi:sw=2
-
diff --git a/m4/libtool.m4 b/m4/libtool.m4
deleted file mode 100644
index 828104c..0000000
--- a/m4/libtool.m4
+++ /dev/null
@@ -1,8001 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-m4_define([_LT_COPYING], [dnl
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 57 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
- [m4_default([$3],
- [m4_fatal([Libtool version $1 or higher is required],
- 63)])],
- [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
- *\ * | *\ *)
- AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-
-_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
-dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_WITH_SYSROOT])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- _LT_PATH_MAGIC
- fi
- ;;
-esac
-
-# Use C for the default configuration in the libtool script
-LT_SUPPORTED_TAG([CC])
-_LT_LANG_C_CONFIG
-_LT_LANG_DEFAULT_CONFIG
-_LT_CONFIG_COMMANDS
-])# _LT_SETUP
-
-
-# _LT_PREPARE_SED_QUOTE_VARS
-# --------------------------
-# Define a few sed substitution that help us do robust quoting.
-m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
-[# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-])
-
-# _LT_PROG_LTMAIN
-# ---------------
-# Note that this code is called both from `configure', and `config.status'
-# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
-# so we pass a copy along to make sure it has a sensible value anyway.
-m4_defun([_LT_PROG_LTMAIN],
-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
-])# _LT_PROG_LTMAIN
-
-
-## ------------------------------------- ##
-## Accumulate code for creating libtool. ##
-## ------------------------------------- ##
-
-# So that we can recreate a full libtool script including additional
-# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
-# label.
-
-
-# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
-# ----------------------------------------
-# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL_INIT],
-[m4_ifval([$1],
- [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
- [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_INIT])
-
-
-# _LT_CONFIG_LIBTOOL([COMMANDS])
-# ------------------------------
-# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL],
-[m4_ifval([$1],
- [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
- [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
-
-
-# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
-# -----------------------------------------------------
-m4_defun([_LT_CONFIG_SAVE_COMMANDS],
-[_LT_CONFIG_LIBTOOL([$1])
-_LT_CONFIG_LIBTOOL_INIT([$2])
-])
-
-
-# _LT_FORMAT_COMMENT([COMMENT])
-# -----------------------------
-# Add leading comment marks to the start of each line, and a trailing
-# full-stop to the whole comment if one is not present already.
-m4_define([_LT_FORMAT_COMMENT],
-[m4_ifval([$1], [
-m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
- [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
-)])
-
-
-
-## ------------------------ ##
-## FIXME: Eliminate VARNAME ##
-## ------------------------ ##
-
-
-# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
-# -------------------------------------------------------------------
-# CONFIGNAME is the name given to the value in the libtool script.
-# VARNAME is the (base) name used in the configure script.
-# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
-# VARNAME. Any other value will be used directly.
-m4_define([_LT_DECL],
-[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
- [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
- [m4_ifval([$1], [$1], [$2])])
- lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
- m4_ifval([$4],
- [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
- lt_dict_add_subkey([lt_decl_dict], [$2],
- [tagged?], [m4_ifval([$5], [yes], [no])])])
-])
-
-
-# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
-# --------------------------------------------------------
-m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
-
-
-# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_tag_varnames],
-[_lt_decl_filter([tagged?], [yes], $@)])
-
-
-# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
-# ---------------------------------------------------------
-m4_define([_lt_decl_filter],
-[m4_case([$#],
- [0], [m4_fatal([$0: too few arguments: $#])],
- [1], [m4_fatal([$0: too few arguments: $#: $1])],
- [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
- [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
- [lt_dict_filter([lt_decl_dict], $@)])[]dnl
-])
-
-
-# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
-# --------------------------------------------------
-m4_define([lt_decl_quote_varnames],
-[_lt_decl_filter([value], [1], $@)])
-
-
-# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_dquote_varnames],
-[_lt_decl_filter([value], [2], $@)])
-
-
-# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_varnames_tagged],
-[m4_assert([$# <= 2])dnl
-_$0(m4_quote(m4_default([$1], [[, ]])),
- m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
- m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
-m4_define([_lt_decl_varnames_tagged],
-[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
-
-
-# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_all_varnames],
-[_$0(m4_quote(m4_default([$1], [[, ]])),
- m4_if([$2], [],
- m4_quote(lt_decl_varnames),
- m4_quote(m4_shift($@))))[]dnl
-])
-m4_define([_lt_decl_all_varnames],
-[lt_join($@, lt_decl_varnames_tagged([$1],
- lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
-])
-
-
-# _LT_CONFIG_STATUS_DECLARE([VARNAME])
-# ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'. VARNAME
-# must have a single quote delimited value for this to work.
-m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
-
-
-# _LT_CONFIG_STATUS_DECLARATIONS
-# ------------------------------
-# We delimit libtool config variables with single quotes, so when
-# we write them to config.status, we have to be sure to quote all
-# embedded single quotes properly. In configure, this macro expands
-# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
-#
-# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
-m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
- [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAGS
-# ----------------
-# Output comment and list of tags supported by the script
-m4_defun([_LT_LIBTOOL_TAGS],
-[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
-])
-
-
-# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
-# -----------------------------------
-# Extract the dictionary values for VARNAME (optionally with TAG) and
-# expand to a commented shell variable setting:
-#
-# # Some comment about what VAR is for.
-# visible_name=$lt_internal_name
-m4_define([_LT_LIBTOOL_DECLARE],
-[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
- [description])))[]dnl
-m4_pushdef([_libtool_name],
- m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
-m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
- [0], [_libtool_name=[$]$1],
- [1], [_libtool_name=$lt_[]$1],
- [2], [_libtool_name=$lt_[]$1],
- [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
-m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
-])
-
-
-# _LT_LIBTOOL_CONFIG_VARS
-# -----------------------
-# Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
-# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
-# section) are produced by _LT_LIBTOOL_TAG_VARS.
-m4_defun([_LT_LIBTOOL_CONFIG_VARS],
-[m4_foreach([_lt_var],
- m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
- [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAG_VARS(TAG)
-# -------------------------
-m4_define([_LT_LIBTOOL_TAG_VARS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
- [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
-
-
-# _LT_TAGVAR(VARNAME, [TAGNAME])
-# ------------------------------
-m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
-
-
-# _LT_CONFIG_COMMANDS
-# -------------------
-# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
-# variables for single and double quote escaping we saved from calls
-# to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'. Finally, any additional code accumulated
-# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
-m4_defun([_LT_CONFIG_COMMANDS],
-[AC_PROVIDE_IFELSE([LT_OUTPUT],
- dnl If the libtool generation code has been placed in $CONFIG_LT,
- dnl instead of duplicating it all over again into config.status,
- dnl then we will have config.status run $CONFIG_LT later, so it
- dnl needs to know what name is stored there:
- [AC_CONFIG_COMMANDS([libtool],
- [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
- dnl If the libtool generation code is destined for config.status,
- dnl expand the accumulated commands and init code now:
- [AC_CONFIG_COMMANDS([libtool],
- [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
-])#_LT_CONFIG_COMMANDS
-
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
-[
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-_LT_CONFIG_STATUS_DECLARATIONS
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$[]1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_quote_varnames); do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-# Double-quote double-evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_dquote_varnames); do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-_LT_OUTPUT_LIBTOOL_INIT
-])
-
-# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
-# ------------------------------------
-# Generate a child script FILE with all initialization necessary to
-# reuse the environment learned by the parent script, and make the
-# file executable. If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins. After this
-# macro, additional text can be appended to FILE to form the body of
-# the child script. The macro ends with non-zero status if the
-# file could not be fully written (such as if the disk is full).
-m4_ifdef([AS_INIT_GENERATED],
-[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
-[m4_defun([_LT_GENERATED_FILE_INIT],
-[m4_require([AS_PREPARE])]dnl
-[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
-[lt_write_fail=0
-cat >$1 <<_ASEOF || lt_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-$2
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$1 <<\_ASEOF || lt_write_fail=1
-AS_SHELL_SANITIZE
-_AS_PREPARE
-exec AS_MESSAGE_FD>&1
-_ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
-m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
-
-# LT_OUTPUT
-# ---------
-# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
-# tests.
-AC_DEFUN([LT_OUTPUT],
-[: ${CONFIG_LT=./config.lt}
-AC_MSG_NOTICE([creating $CONFIG_LT])
-_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
-[# Run this file to recreate a libtool stub with the current configuration.])
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-lt_cl_silent=false
-exec AS_MESSAGE_LOG_FD>>config.log
-{
- echo
- AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-
-lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
-for use in further configure time tests before the real libtool is
-generated.
-
-Usage: $[0] [[OPTIONS]]
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
-
-Report bugs to <bug-libtool@gnu.org>."
-
-lt_cl_version="\
-m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
-m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-configured by $[0], generated by m4_PACKAGE_STRING.
-
-Copyright (C) 2011 Free Software Foundation, Inc.
-This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
-
-while test $[#] != 0
-do
- case $[1] in
- --version | --v* | -V )
- echo "$lt_cl_version"; exit 0 ;;
- --help | --h* | -h )
- echo "$lt_cl_help"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --quiet | --q* | --silent | --s* | -q )
- lt_cl_silent=: ;;
-
- -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
-
- *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
- esac
- shift
-done
-
-if $lt_cl_silent; then
- exec AS_MESSAGE_FD>/dev/null
-fi
-_LTEOF
-
-cat >>"$CONFIG_LT" <<_LTEOF
-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AC_MSG_NOTICE([creating $ofile])
-_LT_OUTPUT_LIBTOOL_COMMANDS
-AS_EXIT(0)
-_LTEOF
-chmod +x "$CONFIG_LT"
-
-# configure is writing to config.log, but config.lt does its own redirection,
-# appending to config.log, which fails on DOS, as config.log is still kept
-# open by configure. Here we exec the FD to /dev/null, effectively closing
-# config.log, so it can be properly (re)opened and appended to by config.lt.
-lt_cl_success=:
-test "$silent" = yes &&
- lt_config_lt_args="$lt_config_lt_args --quiet"
-exec AS_MESSAGE_LOG_FD>/dev/null
-$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-exec AS_MESSAGE_LOG_FD>>config.log
-$lt_cl_success || AS_EXIT(1)
-])# LT_OUTPUT
-
-
-# _LT_CONFIG(TAG)
-# ---------------
-# If TAG is the built-in tag, create an initial libtool script with a
-# default configuration from the untagged config vars. Otherwise add code
-# to config.status for appending the configuration named by TAG from the
-# matching tagged config vars.
-m4_defun([_LT_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_CONFIG_SAVE_COMMANDS([
- m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
- m4_if(_LT_TAG, [C], [
- # See if we are running on zsh, and set the options which allow our
- # commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
-
- cfgfile="${ofile}T"
- trap "$RM \"$cfgfile\"; exit 1" 1 2 15
- $RM "$cfgfile"
-
- cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-_LT_COPYING
-_LT_LIBTOOL_TAGS
-
-# ### BEGIN LIBTOOL CONFIG
-_LT_LIBTOOL_CONFIG_VARS
-_LT_LIBTOOL_TAG_VARS
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
- case $host_os in
- aix3*)
- cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-_LT_EOF
- ;;
- esac
-
- _LT_PROG_LTMAIN
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- _LT_PROG_REPLACE_SHELLFNS
-
- mv -f "$cfgfile" "$ofile" ||
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-],
-[cat <<_LT_EOF >> "$ofile"
-
-dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
-dnl in a comment (ie after a #).
-# ### BEGIN LIBTOOL TAG CONFIG: $1
-_LT_LIBTOOL_TAG_VARS(_LT_TAG)
-# ### END LIBTOOL TAG CONFIG: $1
-_LT_EOF
-])dnl /m4_if
-],
-[m4_if([$1], [], [
- PACKAGE='$PACKAGE'
- VERSION='$VERSION'
- TIMESTAMP='$TIMESTAMP'
- RM='$RM'
- ofile='$ofile'], [])
-])dnl /_LT_CONFIG_SAVE_COMMANDS
-])# _LT_CONFIG
-
-
-# LT_SUPPORTED_TAG(TAG)
-# ---------------------
-# Trace this macro to discover what tags are supported by the libtool
-# --tag option, using:
-# autoconf --trace 'LT_SUPPORTED_TAG:$1'
-AC_DEFUN([LT_SUPPORTED_TAG], [])
-
-
-# C support is built-in for now
-m4_define([_LT_LANG_C_enabled], [])
-m4_define([_LT_TAGS], [])
-
-
-# LT_LANG(LANG)
-# -------------
-# Enable libtool support for the given language if not already enabled.
-AC_DEFUN([LT_LANG],
-[AC_BEFORE([$0], [LT_OUTPUT])dnl
-m4_case([$1],
- [C], [_LT_LANG(C)],
- [C++], [_LT_LANG(CXX)],
- [Go], [_LT_LANG(GO)],
- [Java], [_LT_LANG(GCJ)],
- [Fortran 77], [_LT_LANG(F77)],
- [Fortran], [_LT_LANG(FC)],
- [Windows Resource], [_LT_LANG(RC)],
- [m4_ifdef([_LT_LANG_]$1[_CONFIG],
- [_LT_LANG($1)],
- [m4_fatal([$0: unsupported language: "$1"])])])dnl
-])# LT_LANG
-
-
-# _LT_LANG(LANGNAME)
-# ------------------
-m4_defun([_LT_LANG],
-[m4_ifdef([_LT_LANG_]$1[_enabled], [],
- [LT_SUPPORTED_TAG([$1])dnl
- m4_append([_LT_TAGS], [$1 ])dnl
- m4_define([_LT_LANG_]$1[_enabled], [])dnl
- _LT_LANG_$1_CONFIG($1)])dnl
-])# _LT_LANG
-
-
-m4_ifndef([AC_PROG_GO], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_GO. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-m4_defun([AC_PROG_GO],
-[AC_LANG_PUSH(Go)dnl
-AC_ARG_VAR([GOC], [Go compiler command])dnl
-AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-AC_CHECK_TOOL(GOC, gccgo)
-if test -z "$GOC"; then
- if test -n "$ac_tool_prefix"; then
- AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
- fi
-fi
-if test -z "$GOC"; then
- AC_CHECK_PROG(GOC, gccgo, gccgo, false)
-fi
-])#m4_defun
-])#m4_ifndef
-
-
-# _LT_LANG_DEFAULT_CONFIG
-# -----------------------
-m4_defun([_LT_LANG_DEFAULT_CONFIG],
-[AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [LT_LANG(CXX)],
- [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_F77],
- [LT_LANG(F77)],
- [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_FC],
- [LT_LANG(FC)],
- [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
-
-dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
-dnl pulling things in needlessly.
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
- [LT_LANG(GCJ)],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [LT_LANG(GCJ)],
- [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
- [LT_LANG(GCJ)],
- [m4_ifdef([AC_PROG_GCJ],
- [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
- m4_ifdef([A][M_PROG_GCJ],
- [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
- m4_ifdef([LT_PROG_GCJ],
- [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
-
-AC_PROVIDE_IFELSE([AC_PROG_GO],
- [LT_LANG(GO)],
- [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
-
-AC_PROVIDE_IFELSE([LT_PROG_RC],
- [LT_LANG(RC)],
- [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
-])# _LT_LANG_DEFAULT_CONFIG
-
-# Obsolete macros:
-AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
-AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
-AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
-AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
-AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
-dnl AC_DEFUN([AC_LIBTOOL_RC], [])
-
-
-# _LT_TAG_COMPILER
-# ----------------
-m4_defun([_LT_TAG_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_TAG_COMPILER
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# -------------------------
-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
- case $host_os in
- rhapsody* | darwin*)
- AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
- AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
- AC_CHECK_TOOL([LIPO], [lipo], [:])
- AC_CHECK_TOOL([OTOOL], [otool], [:])
- AC_CHECK_TOOL([OTOOL64], [otool64], [:])
- _LT_DECL([], [DSYMUTIL], [1],
- [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
- _LT_DECL([], [NMEDIT], [1],
- [Tool to change global to local symbols on Mac OS X])
- _LT_DECL([], [LIPO], [1],
- [Tool to manipulate fat objects and archives on Mac OS X])
- _LT_DECL([], [OTOOL], [1],
- [ldd/readelf like tool for Mach-O binaries on Mac OS X])
- _LT_DECL([], [OTOOL64], [1],
- [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
-
- AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
- [lt_cv_apple_cc_single_mod=no
- if test -z "${LT_MULTI_MODULE}"; then
- # By default we will add the -single_module flag. You can override
- # by either setting the environment variable LT_MULTI_MODULE
- # non-empty at configure time, or by adding -multi_module to the
- # link flags.
- rm -rf libconftest.dylib*
- echo "int foo(void){return 1;}" > conftest.c
- echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
- _lt_result=$?
- # If there is a non-empty error log, and "single_module"
- # appears in it, assume the flag caused a linker warning
- if test -s conftest.err && $GREP single_module conftest.err; then
- cat conftest.err >&AS_MESSAGE_LOG_FD
- # Otherwise, if the output was created with a 0 exit code from
- # the compiler, it worked.
- elif test -f libconftest.dylib && test $_lt_result -eq 0; then
- lt_cv_apple_cc_single_mod=yes
- else
- cat conftest.err >&AS_MESSAGE_LOG_FD
- fi
- rm -rf libconftest.dylib*
- rm -f conftest.*
- fi])
-
- AC_CACHE_CHECK([for -exported_symbols_list linker flag],
- [lt_cv_ld_exported_symbols_list],
- [lt_cv_ld_exported_symbols_list=no
- save_LDFLAGS=$LDFLAGS
- echo "_main" > conftest.sym
- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [lt_cv_ld_exported_symbols_list=yes],
- [lt_cv_ld_exported_symbols_list=no])
- LDFLAGS="$save_LDFLAGS"
- ])
-
- AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
- [lt_cv_ld_force_load=no
- cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
- echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
- $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
- echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
- $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
- cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
- _lt_result=$?
- if test -s conftest.err && $GREP force_load conftest.err; then
- cat conftest.err >&AS_MESSAGE_LOG_FD
- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
- lt_cv_ld_force_load=yes
- else
- cat conftest.err >&AS_MESSAGE_LOG_FD
- fi
- rm -f conftest.err libconftest.a conftest conftest.c
- rm -rf conftest.dSYM
- ])
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- 10.[[012]]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- esac
- ;;
- esac
- if test "$lt_cv_apple_cc_single_mod" = "yes"; then
- _lt_dar_single_mod='$single_module'
- fi
- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
- else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
- _lt_dsymutil='~$DSYMUTIL $lib || :'
- else
- _lt_dsymutil=
- fi
- ;;
- esac
-])
-
-
-# _LT_DARWIN_LINKER_FEATURES([TAG])
-# ---------------------------------
-# Checks for linker and compiler features on darwin
-m4_defun([_LT_DARWIN_LINKER_FEATURES],
-[
- m4_require([_LT_REQUIRED_DARWIN_CHECKS])
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_automatic, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- if test "$lt_cv_ld_force_load" = "yes"; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
- m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
- [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=''
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
- case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test "$_lt_dar_can_shared" = "yes"; then
- output_verbose_link_cmd=func_echo_all
- _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
- m4_if([$1], [CXX],
-[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
- _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
- fi
-],[])
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
-])
-
-# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
-# ----------------------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-# Store the results from the different compilers for each TAGNAME.
-# Allow to override them for all tags through lt_cv_aix_libpath.
-m4_defun([_LT_SYS_MODULE_PATH_AIX],
-[m4_require([_LT_DECL_SED])dnl
-if test "${lt_cv_aix_libpath+set}" = set; then
- aix_libpath=$lt_cv_aix_libpath
-else
- AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
- [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
- lt_aix_libpath_sed='[
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }]'
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi],[])
- if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
- fi
- ])
- aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
-fi
-])# _LT_SYS_MODULE_PATH_AIX
-
-
-# _LT_SHELL_INIT(ARG)
-# -------------------
-m4_define([_LT_SHELL_INIT],
-[m4_divert_text([M4SH-INIT], [$1
-])])# _LT_SHELL_INIT
-
-
-
-# _LT_PROG_ECHO_BACKSLASH
-# -----------------------
-# Find how we can fake an echo command that does not interpret backslash.
-# In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
-m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-AC_MSG_CHECKING([how to print strings])
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
- test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='printf %s\n'
-else
- # Use this function as a fallback that always works.
- func_fallback_echo ()
- {
- eval 'cat <<_LTECHO_EOF
-$[]1
-_LTECHO_EOF'
- }
- ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO "$*"
-}
-
-case "$ECHO" in
- printf*) AC_MSG_RESULT([printf]) ;;
- print*) AC_MSG_RESULT([print -r]) ;;
- *) AC_MSG_RESULT([cat]) ;;
-esac
-
-m4_ifdef([_AS_DETECT_SUGGESTED],
-[_AS_DETECT_SUGGESTED([
- test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
- ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
- ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
- ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- PATH=/empty FPATH=/empty; export PATH FPATH
- test "X`printf %s $ECHO`" = "X$ECHO" \
- || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
-
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
-
-
-# _LT_WITH_SYSROOT
-# ----------------
-AC_DEFUN([_LT_WITH_SYSROOT],
-[AC_MSG_CHECKING([for sysroot])
-AC_ARG_WITH([sysroot],
-[ --with-sysroot[=DIR] Search for dependent libraries within DIR
- (or the compiler's sysroot if not specified).],
-[], [with_sysroot=no])
-
-dnl lt_sysroot will always be passed unquoted. We quote it here
-dnl in case the user passed a directory name.
-lt_sysroot=
-case ${with_sysroot} in #(
- yes)
- if test "$GCC" = yes; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
- fi
- ;; #(
- /*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
- ;; #(
- no|'')
- ;; #(
- *)
- AC_MSG_RESULT([${with_sysroot}])
- AC_MSG_ERROR([The sysroot must be an absolute path.])
- ;;
-esac
-
- AC_MSG_RESULT([${lt_sysroot:-no}])
-_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and in which our libraries should be installed.])])
-
-# _LT_ENABLE_LOCK
-# ---------------
-m4_defun([_LT_ENABLE_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
- [AS_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*|s390*-*tpf*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_PUSH(C)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_POP])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*)
- case $host in
- i?86-*-solaris*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- sparc*-*-solaris*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
- if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD="${LD-ld}_sol2"
- fi
- ;;
- *)
- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
- LD="${LD-ld} -64"
- fi
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-esac
-
-need_locks="$enable_libtool_lock"
-])# _LT_ENABLE_LOCK
-
-
-# _LT_PROG_AR
-# -----------
-m4_defun([_LT_PROG_AR],
-[AC_CHECK_TOOLS(AR, [ar], false)
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
-
-AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
- [lt_cv_ar_at_file=no
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
- [echo conftest.$ac_objext > conftest.lst
- lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
- AC_TRY_EVAL([lt_ar_try])
- if test "$ac_status" -eq 0; then
- # Ensure the archiver fails upon bogus file names.
- rm -f conftest.$ac_objext libconftest.a
- AC_TRY_EVAL([lt_ar_try])
- if test "$ac_status" -ne 0; then
- lt_cv_ar_at_file=@
- fi
- fi
- rm -f conftest.* libconftest.a
- ])
- ])
-
-if test "x$lt_cv_ar_at_file" = xno; then
- archiver_list_spec=
-else
- archiver_list_spec=$lt_cv_ar_at_file
-fi
-_LT_DECL([], [archiver_list_spec], [1],
- [How to feed a file listing to the archiver])
-])# _LT_PROG_AR
-
-
-# _LT_CMD_OLD_ARCHIVE
-# -------------------
-m4_defun([_LT_CMD_OLD_ARCHIVE],
-[_LT_PROG_AR
-
-AC_CHECK_TOOL(STRIP, strip, :)
-test -z "$STRIP" && STRIP=:
-_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-test -z "$RANLIB" && RANLIB=:
-_LT_DECL([], [RANLIB], [1],
- [Commands used to install an old-style archive])
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
- darwin*)
- lock_old_archive_extraction=yes ;;
- *)
- lock_old_archive_extraction=no ;;
-esac
-_LT_DECL([], [old_postinstall_cmds], [2])
-_LT_DECL([], [old_postuninstall_cmds], [2])
-_LT_TAGDECL([], [old_archive_cmds], [2],
- [Commands used to build an old-style archive])
-_LT_DECL([], [lock_old_archive_extraction], [0],
- [Whether to use a lock for old archive extraction])
-])# _LT_CMD_OLD_ARCHIVE
-
-
-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([_LT_COMPILER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$3"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- fi
- $RM conftest*
-])
-
-if test x"[$]$2" = xyes; then
- m4_if([$5], , :, [$5])
-else
- m4_if([$6], , :, [$6])
-fi
-])# _LT_COMPILER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-
-
-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------
-# Check whether the given linker option works
-AC_DEFUN([_LT_LINKER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $3"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- else
- $2=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
- m4_if([$4], , :, [$4])
-else
- m4_if([$5], , :, [$5])
-fi
-])# _LT_LINKER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-
-
-# LT_CMD_MAX_LEN
-#---------------
-AC_DEFUN([LT_CMD_MAX_LEN],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw* | cegcc*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- mint*)
- # On MiNT this can take a long time and run out of memory.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- os2*)
- # The test takes a long time on OS/2.
- lt_cv_sys_max_cmd_len=8192
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- # Make teststring a little bigger before we do anything with it.
- # a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8 ; do
- teststring=$teststring$teststring
- done
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
- = "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- # Only check the string length outside the loop.
- lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
- teststring=
- # Add a significant safety factor because C++ compilers can tack on
- # massive amounts of additional arguments before passing them to the
- # linker. It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
- AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
- AC_MSG_RESULT(none)
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-_LT_DECL([], [max_cmd_len], [0],
- [What is the maximum length of a command?])
-])# LT_CMD_MAX_LEN
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-
-
-# _LT_HEADER_DLFCN
-# ----------------
-m4_defun([_LT_HEADER_DLFCN],
-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
-])# _LT_HEADER_DLFCN
-
-
-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ----------------------------------------------------------------
-m4_defun([_LT_TRY_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
- [$4]
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-[#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}]
-_LT_EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) $1 ;;
- x$lt_dlneed_uscore) $2 ;;
- x$lt_dlunknown|x*) $3 ;;
- esac
- else :
- # compilation failed
- $3
- fi
-fi
-rm -fr conftest*
-])# _LT_TRY_DLOPEN_SELF
-
-
-# LT_SYS_DLOPEN_SELF
-# ------------------
-AC_DEFUN([LT_SYS_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32* | cegcc*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ])
- ;;
-
- *)
- AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen="shl_load"],
- [AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
- [AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="dlopen"],
- [AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
- ])
- ])
- ])
- ])
- ])
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- AC_CACHE_CHECK([whether a program can dlopen itself],
- lt_cv_dlopen_self, [dnl
- _LT_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
- ])
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
- ])
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-_LT_DECL([dlopen_support], [enable_dlopen], [0],
- [Whether dlopen is supported])
-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
- [Whether dlopen of programs is supported])
-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
- [Whether dlopen of statically linked programs is supported])
-])# LT_SYS_DLOPEN_SELF
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-
-
-# _LT_COMPILER_C_O([TAGNAME])
-# ---------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler.
-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
-m4_defun([_LT_COMPILER_C_O],
-[m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
- [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
- [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
- fi
- fi
- chmod u+w . 2>&AS_MESSAGE_LOG_FD
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-])
-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
- [Does compiler simultaneously support -c and -o options?])
-])# _LT_COMPILER_C_O
-
-
-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
-# ----------------------------------
-# Check to see if we can do hard links to lock some files if needed
-m4_defun([_LT_COMPILER_FILE_LOCKS],
-[m4_require([_LT_ENABLE_LOCK])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_COMPILER_C_O([$1])
-
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- AC_MSG_CHECKING([if we can lock with hard links])
- hard_links=yes
- $RM conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- AC_MSG_RESULT([$hard_links])
- if test "$hard_links" = no; then
- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
-])# _LT_COMPILER_FILE_LOCKS
-
-
-# _LT_CHECK_OBJDIR
-# ----------------
-m4_defun([_LT_CHECK_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-_LT_DECL([], [objdir], [0],
- [The name of the directory that contains temporary libtool files])dnl
-m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
- [Define to the sub-directory in which libtool stores uninstalled libraries.])
-])# _LT_CHECK_OBJDIR
-
-
-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
-# --------------------------------------
-# Check hardcoding attributes.
-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
- test -n "$_LT_TAGVAR(runpath_var, $1)" ||
- test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
- # We can hardcode non-existent directories.
- if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
- test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
- # Linking always hardcodes the temporary library directory.
- _LT_TAGVAR(hardcode_action, $1)=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- _LT_TAGVAR(hardcode_action, $1)=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- _LT_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
- test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-_LT_TAGDECL([], [hardcode_action], [0],
- [How to hardcode a shared library path into an executable])
-])# _LT_LINKER_HARDCODE_LIBPATH
-
-
-# _LT_CMD_STRIPLIB
-# ----------------
-m4_defun([_LT_CMD_STRIPLIB],
-[m4_require([_LT_DECL_EGREP])
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
-fi
-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
-_LT_DECL([], [striplib], [1])
-])# _LT_CMD_STRIPLIB
-
-
-# _LT_SYS_DYNAMIC_LINKER([TAG])
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_OBJDUMP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-m4_if([$1],
- [], [
-if test "$GCC" = yes; then
- case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
- esac
- case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
- *) lt_sed_strip_eq="s,=/,/,g" ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
- case $lt_search_path_spec in
- *\;*)
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
- ;;
- *)
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
- ;;
- esac
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[[lt_foo]]++; }
- if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
- # AWK program above erroneously prepends '/' to C:/dos/paths
- # for these hosts.
- case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
- esac
- sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix[[4-9]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[[01]] | aix4.[[01]].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[[45]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$cc_basename in
- yes,*)
- # gcc
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
- ;;
- mingw* | cegcc*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- ;;
-
- *,cl*)
- # Native MSVC
- libname_spec='$name'
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- library_names_spec='${libname}.dll.lib'
-
- case $build_os in
- mingw*)
- sys_lib_search_path_spec=
- lt_save_ifs=$IFS
- IFS=';'
- for lt_path in $LIB
- do
- IFS=$lt_save_ifs
- # Let DOS variable expansion print the short 8.3 style file name.
- lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
- sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
- done
- IFS=$lt_save_ifs
- # Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
- ;;
- cygwin*)
- # Convert to unix form, then to dos form, then back to unix form
- # but this time dos style (no spaces!) so that the unix form looks
- # like /cygdrive/c/PROGRA~1:/cygdr...
- sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
- sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
- sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- ;;
- *)
- sys_lib_search_path_spec="$LIB"
- if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
- # It is most probably a Windows format PATH.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # FIXME: find the short name or the path components, as spaces are
- # common. (e.g. "Program Files" -> "PROGRA~1")
- ;;
- esac
-
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
- dynamic_linker='Win32 link.exe'
- ;;
-
- *)
- # Assume MSVC wrapper
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
- dynamic_linker='Win32 ld.exe'
- ;;
- esac
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[[23]].*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2.*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[[01]]* | freebsdelf3.[[01]]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- dynamic_linker="$host_os runtime_loader"
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
- postinstall_cmds='chmod 555 $lib'
- # or fails outright, so override atomically:
- install_override_mode=555
- ;;
-
-interix[[3-9]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux # correct to gnu/linux during the next big refactor
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
-
- # Some binutils ld are patched to set DT_RUNPATH
- AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
- [lt_cv_shlibpath_overrides_runpath=no
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
- LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
- [lt_cv_shlibpath_overrides_runpath=yes])])
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
- ])
- shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-*nto* | *qnx*)
- version_type=qnx
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[[89]] | openbsd2.[[89]].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-_LT_DECL([], [variables_saved_for_relink], [1],
- [Variables whose values should be saved in libtool wrapper scripts and
- restored at link time])
-_LT_DECL([], [need_lib_prefix], [0],
- [Do we need the "lib" prefix for modules?])
-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
-_LT_DECL([], [version_type], [0], [Library versioning type])
-_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
-_LT_DECL([], [shlibpath_overrides_runpath], [0],
- [Is shlibpath searched before the hard-coded library search path?])
-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
-_LT_DECL([], [library_names_spec], [1],
- [[List of archive names. First name is the real one, the rest are links.
- The last name is the one that the linker finds with -lNAME]])
-_LT_DECL([], [soname_spec], [1],
- [[The coded name of the library, if different from the real name]])
-_LT_DECL([], [install_override_mode], [1],
- [Permission mode override for installation of shared libraries])
-_LT_DECL([], [postinstall_cmds], [2],
- [Command to use after installation of a shared archive])
-_LT_DECL([], [postuninstall_cmds], [2],
- [Command to use after uninstallation of a shared archive])
-_LT_DECL([], [finish_cmds], [2],
- [Commands used to finish a libtool library installation in a directory])
-_LT_DECL([], [finish_eval], [1],
- [[As "finish_cmds", except a single script fragment to be evaled but
- not shown]])
-_LT_DECL([], [hardcode_into_libs], [0],
- [Whether we should hardcode library paths into libraries])
-_LT_DECL([], [sys_lib_search_path_spec], [2],
- [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
- [Run-time system search path for libraries])
-])# _LT_SYS_DYNAMIC_LINKER
-
-
-# _LT_PATH_TOOL_PREFIX(TOOL)
-# --------------------------
-# find a file program which can recognize shared library
-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
-[m4_require([_LT_DECL_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] | ?:[\\/]*])
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="m4_if([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC_CMD="$ac_dir/$1"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
-else
- AC_MSG_RESULT(no)
-fi
-_LT_DECL([], [MAGIC_CMD], [0],
- [Used to examine libraries when file_magic_cmd begins with "file"])dnl
-])# _LT_PATH_TOOL_PREFIX
-
-# Old name:
-AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
-
-
-# _LT_PATH_MAGIC
-# --------------
-# find a file program which can recognize a shared library
-m4_defun([_LT_PATH_MAGIC],
-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
- else
- MAGIC_CMD=:
- fi
-fi
-])# _LT_PATH_MAGIC
-
-
-# LT_PATH_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([LT_PATH_LD],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
-
-AC_ARG_WITH([gnu-ld],
- [AS_HELP_STRING([--with-gnu-ld],
- [assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
- [with_gnu_ld=no])dnl
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
- while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-_LT_PATH_LD_GNU
-AC_SUBST([LD])
-
-_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
-])# LT_PATH_LD
-
-# Old names:
-AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
-AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_LD], [])
-dnl AC_DEFUN([AC_PROG_LD], [])
-
-
-# _LT_PATH_LD_GNU
-#- --------------
-m4_defun([_LT_PATH_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# _LT_PATH_LD_GNU
-
-
-# _LT_CMD_RELOAD
-# --------------
-# find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-m4_defun([_LT_CMD_RELOAD],
-[AC_CACHE_CHECK([for $LD option to reload object files],
- lt_cv_ld_reload_flag,
- [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- if test "$GCC" != yes; then
- reload_cmds=false
- fi
- ;;
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_TAGDECL([], [reload_cmds], [2])dnl
-])# _LT_CMD_RELOAD
-
-
-# _LT_CHECK_MAGIC_METHOD
-# ----------------------
-# how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_MAGIC_METHOD],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[[45]]*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- # Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-cegcc*)
- # use the weaker test based on 'objdump'. See mingw*.
- lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-haiku*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[[3-9]]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-*nto* | *qnx*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-tpf*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-])
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
- case $host_os in
- mingw* | pw32*)
- if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
- want_nocaseglob=yes
- else
- file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
- fi
- ;;
- esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-_LT_DECL([], [deplibs_check_method], [1],
- [Method to check whether dependent libraries are shared objects])
-_LT_DECL([], [file_magic_cmd], [1],
- [Command to use when deplibs_check_method = "file_magic"])
-_LT_DECL([], [file_magic_glob], [1],
- [How to find potential files when deplibs_check_method = "file_magic"])
-_LT_DECL([], [want_nocaseglob], [1],
- [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
-])# _LT_CHECK_MAGIC_METHOD
-
-
-# LT_PATH_NM
-# ----------
-# find the pathname to a BSD- or MS-compatible name lister
-AC_DEFUN([LT_PATH_NM],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- : ${lt_cv_path_NM=no}
-fi])
-if test "$lt_cv_path_NM" != "no"; then
- NM="$lt_cv_path_NM"
-else
- # Didn't find any BSD compatible name lister, look for dumpbin.
- if test -n "$DUMPBIN"; then :
- # Let the user override the test.
- else
- AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
- *COFF*)
- DUMPBIN="$DUMPBIN -symbols"
- ;;
- *)
- DUMPBIN=:
- ;;
- esac
- fi
- AC_SUBST([DUMPBIN])
- if test "$DUMPBIN" != ":"; then
- NM="$DUMPBIN"
- fi
-fi
-test -z "$NM" && NM=nm
-AC_SUBST([NM])
-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
-
-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
- [lt_cv_nm_interface="BSD nm"
- echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$ac_compile" 2>conftest.err)
- cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
- (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
- cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
- cat conftest.out >&AS_MESSAGE_LOG_FD
- if $GREP 'External.*some_variable' conftest.out > /dev/null; then
- lt_cv_nm_interface="MS dumpbin"
- fi
- rm -f conftest*])
-])# LT_PATH_NM
-
-# Old names:
-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_NM], [])
-dnl AC_DEFUN([AC_PROG_NM], [])
-
-# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-# --------------------------------
-# how to determine the name of the shared library
-# associated with a specific link library.
-# -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-m4_require([_LT_DECL_DLLTOOL])
-AC_CACHE_CHECK([how to associate runtime and link libraries],
-lt_cv_sharedlib_from_linklib_cmd,
-[lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
- # two different shell functions defined in ltmain.sh
- # decide which to use based on capabilities of $DLLTOOL
- case `$DLLTOOL --help 2>&1` in
- *--identify-strict*)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
- ;;
- *)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
- ;;
- esac
- ;;
-*)
- # fallback: assume linklib IS sharedlib
- lt_cv_sharedlib_from_linklib_cmd="$ECHO"
- ;;
-esac
-])
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
- [Command to associate shared and link libraries])
-])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-
-
-# _LT_PATH_MANIFEST_TOOL
-# ----------------------
-# locate the manifest tool
-m4_defun([_LT_PATH_MANIFEST_TOOL],
-[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
- [lt_cv_path_mainfest_tool=no
- echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
- $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
- cat conftest.err >&AS_MESSAGE_LOG_FD
- if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
- fi
- rm -f conftest*])
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
- MANIFEST_TOOL=:
-fi
-_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
-])# _LT_PATH_MANIFEST_TOOL
-
-
-# LT_LIB_M
-# --------
-# check for math library
-AC_DEFUN([LT_LIB_M],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
- # These system don't have libm, or don't need it
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, cos, LIBM="-lm")
- ;;
-esac
-AC_SUBST([LIBM])
-])# LT_LIB_M
-
-# Old name:
-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_CHECK_LIBM], [])
-
-
-# _LT_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------
-m4_defun([_LT_COMPILER_NO_RTTI],
-[m4_require([_LT_TAG_COMPILER])dnl
-
-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
- case $cc_basename in
- nvcc*)
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
- esac
-
- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
- lt_cv_prog_compiler_rtti_exceptions,
- [-fno-rtti -fno-exceptions], [],
- [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
- [Compiler flag to turn off builtin functions])
-])# _LT_COMPILER_NO_RTTI
-
-
-# _LT_CMD_GLOBAL_SYMBOLS
-# ----------------------
-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[[BCDT]]'
- ;;
-cygwin* | mingw* | pw32* | cegcc*)
- symcode='[[ABCDGISTW]]'
- ;;
-hpux*)
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDEGRST]]'
- fi
- ;;
-irix* | nonstopux*)
- symcode='[[BCDEGRST]]'
- ;;
-osf*)
- symcode='[[BCDEGQRST]]'
- ;;
-solaris*)
- symcode='[[BDRT]]'
- ;;
-sco3.2v5*)
- symcode='[[DT]]'
- ;;
-sysv4.2uw2*)
- symcode='[[DT]]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[[ABDT]]'
- ;;
-sysv4)
- symcode='[[DFNSTU]]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function
- # and D for any global variable.
- # Also find C++ and __fastcall symbols from MSVC++,
- # which start with @ or ?.
- lt_cv_sys_global_symbol_pipe="$AWK ['"\
-" {last_section=section; section=\$ 3};"\
-" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-" \$ 0!~/External *\|/{next};"\
-" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-" {if(hide[section]) next};"\
-" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-" s[1]~/^[@?]/{print s[1], s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-" ' prfx=^$ac_symprfx]"
- else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
- fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT@&t@_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data. */
-# define LT@&t@_DLSYM_CONST
-#else
-# define LT@&t@_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
- cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols. */
-LT@&t@_DLSYM_CONST struct {
- const char *name;
- void *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[[]] =
-{
- { "@PROGRAM@", (void *) 0 },
-_LT_EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
- cat <<\_LT_EOF >> conftest.$ac_ext
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_globsym_save_LIBS=$LIBS
- lt_globsym_save_CFLAGS=$CFLAGS
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS=$lt_globsym_save_LIBS
- CFLAGS=$lt_globsym_save_CFLAGS
- else
- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&5
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- AC_MSG_RESULT(failed)
-else
- AC_MSG_RESULT(ok)
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
- nm_file_list_spec='@'
-fi
-
-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
- [Take the output of nm and produce a listing of raw symbols and C names])
-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
- [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_c_name_address],
- [lt_cv_sys_global_symbol_to_c_name_address], [1],
- [Transform the output of nm in a C name address pair])
-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
- [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
- [Transform the output of nm in a C name address pair when lib prefix is needed])
-_LT_DECL([], [nm_file_list_spec], [1],
- [Specify filename containing input files for $NM])
-]) # _LT_CMD_GLOBAL_SYMBOLS
-
-
-# _LT_COMPILER_PIC([TAGNAME])
-# ---------------------------
-m4_defun([_LT_COMPILER_PIC],
-[m4_require([_LT_TAG_COMPILER])dnl
-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_TAGVAR(lt_prog_compiler_static, $1)=
-
-m4_if([$1], [CXX], [
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- _LT_TAGVAR(lt_prog_compiler_static, $1)=
- ;;
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix[[4-9]]*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- fi
- ;;
- aCC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- ecpc* )
- # old Intel C++ for x86_64 which still supported -KPIC.
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- icpc* )
- # Intel C++, used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
- # IBM XL 8.0, 9.0 on PPC and BlueGene
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu)
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- lcc*)
- # Lucid
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-],
-[
- if test "$GCC" = yes; then
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
-
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- _LT_TAGVAR(lt_prog_compiler_static, $1)=
- ;;
-
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
-
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- enable_shared=no
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
-
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
-
- case $cc_basename in
- nvcc*) # Cuda Compiler Driver 2.2
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
- if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
- fi
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- hpux9* | hpux10* | hpux11*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC (with -KPIC) is the default.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
- case $cc_basename in
- # old Intel for x86_64 which still supported -KPIC.
- ecc*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- # icc used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- icc* | ifort*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- # Lahey Fortran 8.1.
- lf95*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
- ;;
- nagfor*)
- # NAG Fortran compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- ccc*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All Alpha code is PIC.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- xl* | bgxl* | bgf* | mpixl*)
- # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
- ;;
- *Sun\ F* | *Sun*Fortran*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- *Sun\ C*)
- # Sun C 5.9
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- *Intel*\ [[CF]]*Compiler*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- *Portland\ Group*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- esac
- ;;
-
- newsos6)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
-
- osf3* | osf4* | osf5*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All OSF/1 code is PIC.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- rdos*)
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- solaris*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
- *)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
- esac
- ;;
-
- sunos4*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- unicos*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
-
- uts4*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *)
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-])
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
- ;;
-esac
-
-AC_CACHE_CHECK([for $compiler option to produce PIC],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
- [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
- [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
- "" | " "*) ;;
- *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
- esac],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
- [Additional compiler flags for building library objects])
-
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
- [How to pass a linker flag through the compiler])
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
-_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
- $lt_tmp_static_flag,
- [],
- [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
-_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
- [Compiler flag to prevent dynamic linking])
-])# _LT_COMPILER_PIC
-
-
-# _LT_LINKER_SHLIBS([TAGNAME])
-# ----------------------------
-# See if the linker supports building shared libraries.
-m4_defun([_LT_LINKER_SHLIBS],
-[AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-m4_if([$1], [CXX], [
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
- case $host_os in
- aix[[4-9]]*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global defined
- # symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
- cygwin* | mingw* | cegcc*)
- case $cc_basename in
- cl*)
- _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- ;;
- *)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
- *)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-], [
- runpath_var=
- _LT_TAGVAR(allow_undefined_flag, $1)=
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(archive_cmds, $1)=
- _LT_TAGVAR(archive_expsym_cmds, $1)=
- _LT_TAGVAR(compiler_needs_object, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(hardcode_automatic, $1)=no
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- _LT_TAGVAR(hardcode_minus_L, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_TAGVAR(inherit_rpath, $1)=no
- _LT_TAGVAR(link_all_deplibs, $1)=unknown
- _LT_TAGVAR(module_cmds, $1)=
- _LT_TAGVAR(module_expsym_cmds, $1)=
- _LT_TAGVAR(old_archive_from_new_cmds, $1)=
- _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
- _LT_TAGVAR(thread_safe_flag_spec, $1)=
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- _LT_TAGVAR(include_expsyms, $1)=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
- extract_expsyms_cmds=
-
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
- esac
-
- _LT_TAGVAR(ld_shlibs, $1)=yes
-
- # On some targets, GNU ld is compatible enough with the native linker
- # that we're better off using the native interface for both.
- lt_use_gnu_ld_interface=no
- if test "$with_gnu_ld" = yes; then
- case $host_os in
- aix*)
- # The AIX port of GNU ld has always aspired to compatibility
- # with the native linker. However, as the warning in the GNU ld
- # block says, versions before 2.19.5* couldn't really create working
- # shared libraries, regardless of the interface used.
- case `$LD -v 2>&1` in
- *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
- *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
- *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- fi
-
- if test "$lt_use_gnu_ld_interface" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>&1` in
- *GNU\ gold*) supports_anon_versioning=yes ;;
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix[[3-9]]*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)=''
- ;;
- m68k)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- interix[[3-9]]*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
- tmp_diet=no
- if test "$host_os" = linux-dietlibc; then
- case $cc_basename in
- diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
- esac
- fi
- if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test "$tmp_diet" = no
- then
- tmp_addflag=' $pic_flag'
- tmp_sharedflag='-shared'
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group f77 and f90 compilers
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- lf95*) # Lahey Fortran 8.1
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- tmp_sharedflag='--shared' ;;
- xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
- tmp_sharedflag='-qmkshrobj'
- tmp_addflag= ;;
- nvcc*) # Cuda Compiler Driver 2.2
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
- ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- esac
- _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
-
- case $cc_basename in
- xlf* | bgf* | bgxlf* | mpixlf*)
- # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
- _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- fi
- ;;
- esac
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
-
- if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
- runpath_var=
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- fi
- ;;
-
- aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_TAGVAR(archive_cmds, $1)=''
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=no
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
- # We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)=''
- ;;
- m68k)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- ;;
-
- bsdi[[45]]*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- case $cc_basename in
- cl*)
- # Native MSVC
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
- # Don't use ranlib
- _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
- _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # Assume MSVC wrapper
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- ;;
- esac
- ;;
-
- darwin* | rhapsody*)
- _LT_DARWIN_LINKER_FEATURES($1)
- ;;
-
- dgux*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2.*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_direct, $1)=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- m4_if($1, [], [
- # Older versions of the 11.00 compiler do not understand -b yet
- # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
- _LT_LINKER_OPTION([if $CC understands -b],
- _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
- [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- # Try to use the -exported_symbol ld option, if it does not
- # work, assume that -exports_file does not work either and
- # implicitly export all symbols.
- # This should be the same for all languages, so no per-tag cache variable.
- AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
- [lt_cv_irix_exported_symbol],
- [save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- AC_LINK_IFELSE(
- [AC_LANG_SOURCE(
- [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
- [C++], [[int foo (void) { return 0; }]],
- [Fortran 77], [[
- subroutine foo
- end]],
- [Fortran], [[
- subroutine foo
- end]])])],
- [lt_cv_irix_exported_symbol=yes],
- [lt_cv_irix_exported_symbol=no])
- LDFLAGS="$save_LDFLAGS"])
- if test "$lt_cv_irix_exported_symbol" = yes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
- fi
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(inherit_rpath, $1)=yes
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- newsos6)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *nto* | *qnx*)
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- os2*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- else
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- solaris*)
- _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- else
- case `$CC -V 2>&1` in
- *"Compilers 5.0"*)
- wlarc=''
- _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
- ;;
- *)
- wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- ;;
- esac
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
- _LT_TAGVAR(hardcode_direct, $1)=no
- ;;
- motorola)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4.3*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- _LT_TAGVAR(ld_shlibs, $1)=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
-
- if test x$host_vendor = xsni; then
- case $host in
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
- ;;
- esac
- fi
- fi
-])
-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
-
-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
-_LT_DECL([], [extract_expsyms_cmds], [2],
- [The commands to extract the exported symbol list from a shared archive])
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
- # Assume -lc should be added
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $_LT_TAGVAR(archive_cmds, $1) in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- AC_CACHE_CHECK([whether -lc should be explicitly linked in],
- [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
- [$RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
- pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
- _LT_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
- then
- lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
- else
- lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- fi
- _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
- ])
- _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
- ;;
- esac
- fi
- ;;
-esac
-
-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
- [Whether or not to add -lc for building shared libraries])
-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
- [enable_shared_with_static_runtimes], [0],
- [Whether or not to disallow shared libs when runtime libs are static])
-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
- [Compiler flag to allow reflexive dlopens])
-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
- [Compiler flag to generate shared objects directly from archives])
-_LT_TAGDECL([], [compiler_needs_object], [1],
- [Whether the compiler copes with passing no objects directly])
-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
- [Create an old-style archive from a shared archive])
-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
- [Create a temporary old-style archive to link instead of a shared archive])
-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
-_LT_TAGDECL([], [archive_expsym_cmds], [2])
-_LT_TAGDECL([], [module_cmds], [2],
- [Commands used to build a loadable module if different from building
- a shared archive.])
-_LT_TAGDECL([], [module_expsym_cmds], [2])
-_LT_TAGDECL([], [with_gnu_ld], [1],
- [Whether we are building with GNU ld or not])
-_LT_TAGDECL([], [allow_undefined_flag], [1],
- [Flag that allows shared libraries with undefined symbols to be built])
-_LT_TAGDECL([], [no_undefined_flag], [1],
- [Flag that enforces no undefined symbols])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
- [Flag to hardcode $libdir into a binary during linking.
- This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
- [Whether we need a single "-rpath" flag with a separated argument])
-_LT_TAGDECL([], [hardcode_direct], [0],
- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
- DIR into the resulting binary])
-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
- DIR into the resulting binary and the resulting library dependency is
- "absolute", i.e impossible to change by setting ${shlibpath_var} if the
- library is relocated])
-_LT_TAGDECL([], [hardcode_minus_L], [0],
- [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
- into the resulting binary])
-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
- [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
- into the resulting binary])
-_LT_TAGDECL([], [hardcode_automatic], [0],
- [Set to "yes" if building a shared library automatically hardcodes DIR
- into the library and all subsequent libraries and executables linked
- against it])
-_LT_TAGDECL([], [inherit_rpath], [0],
- [Set to yes if linker adds runtime paths of dependent libraries
- to runtime path list])
-_LT_TAGDECL([], [link_all_deplibs], [0],
- [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [always_export_symbols], [0],
- [Set to "yes" if exported symbols are required])
-_LT_TAGDECL([], [export_symbols_cmds], [2],
- [The commands to list exported symbols])
-_LT_TAGDECL([], [exclude_expsyms], [1],
- [Symbols that should not be listed in the preloaded symbols])
-_LT_TAGDECL([], [include_expsyms], [1],
- [Symbols that must always be exported])
-_LT_TAGDECL([], [prelink_cmds], [2],
- [Commands necessary for linking programs (against libraries) with templates])
-_LT_TAGDECL([], [postlink_cmds], [2],
- [Commands necessary for finishing linking programs])
-_LT_TAGDECL([], [file_list_spec], [1],
- [Specify filename containing input files])
-dnl FIXME: Not yet implemented
-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
-dnl [Compiler flag to generate thread safe objects])
-])# _LT_LINKER_SHLIBS
-
-
-# _LT_LANG_C_CONFIG([TAG])
-# ------------------------
-# Ensure that the configuration variables for a C compiler are suitably
-# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_C_CONFIG],
-[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_TAG_COMPILER
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
- LT_SYS_DLOPEN_SELF
- _LT_CMD_STRIPLIB
-
- # Report which library types will actually be built
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_CONFIG($1)
-fi
-AC_LANG_POP
-CC="$lt_save_CC"
-])# _LT_LANG_C_CONFIG
-
-
-# _LT_LANG_CXX_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a C++ compiler are suitably
-# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_CXX_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_PROG_CXXCPP
-else
- _lt_caught_CXX_error=yes
-fi
-
-AC_LANG_PUSH(C++)
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(compiler_needs_object, $1)=no
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="int some_variable = 0;"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC=$CC
- lt_save_CFLAGS=$CFLAGS
- lt_save_LD=$LD
- lt_save_GCC=$GCC
- GCC=$GXX
- lt_save_with_gnu_ld=$with_gnu_ld
- lt_save_path_LD=$lt_cv_path_LD
- if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
- else
- $as_unset lt_cv_prog_gnu_ld
- fi
- if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
- else
- $as_unset lt_cv_path_LD
- fi
- test -z "${LDCXX+set}" || LD=$LDCXX
- CC=${CXX-"c++"}
- CFLAGS=$CXXFLAGS
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-
- if test -n "$compiler"; then
- # We don't want -fno-exception when compiling C++ code, so set the
- # no_builtin_flag separately
- if test "$GXX" = yes; then
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
- else
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
- fi
-
- if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
- LT_PATH_LD
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- GXX=no
- with_gnu_ld=no
- wlarc=
- fi
-
- # PORTME: fill in a description of your system's C++ link characteristics
- AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
- _LT_TAGVAR(ld_shlibs, $1)=yes
- case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_TAGVAR(archive_cmds, $1)=''
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to
- # export.
- _LT_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty
- # executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
- # We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared
- # libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- case $GXX,$cc_basename in
- ,cl* | no,cl*)
- # Native MSVC
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- # Don't use ranlib
- _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
- _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- func_to_tool_file "$lt_outputfile"~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # g++
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- darwin* | rhapsody*)
- _LT_DARWIN_LINKER_FEATURES($1)
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- freebsd2.*)
- # C++ shared libraries reported to be fairly broken before
- # switch to ELF
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- freebsd-elf*)
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
-
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- _LT_TAGVAR(ld_shlibs, $1)=yes
- ;;
-
- gnu*)
- ;;
-
- haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- hpux9*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- interix[[3-9]]*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
- fi
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
- esac
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(inherit_rpath, $1)=yes
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc* | ecpc* )
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- case `$CC -V` in
- *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
- _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
- _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
- $RANLIB $oldlib'
- _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- ;;
- *) # Version 6 and above use weak symbols
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
- ;;
- xl* | mpixl* | bgxl*)
- # IBM XL 8.0 on PPC, with GNU ld
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
-
- lynxos*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- m88k*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
-
- *nto* | *qnx*)
- _LT_TAGVAR(ld_shlibs, $1)=yes
- ;;
-
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd=func_echo_all
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- case $host in
- osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
- *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
- esac
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- case $host in
- osf3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- ;;
- *)
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
- $RM $lib.exp'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- case $host in
- osf3*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- psos*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
- _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- ;;
- esac
- _LT_TAGVAR(link_all_deplibs, $1)=yes
-
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
- if $CC --version | $GREP -v '^2\.7' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- fi
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
- '"$_LT_TAGVAR(old_archive_cmds, $1)"
- _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
- '"$_LT_TAGVAR(reload_cmds, $1)"
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- vxworks*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
-
- AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
- test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
- _LT_TAGVAR(GCC, $1)="$GXX"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_SYS_HIDDEN_LIBDEPS($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- CC=$lt_save_CC
- CFLAGS=$lt_save_CFLAGS
- LDCXX=$LD
- LD=$lt_save_LD
- GCC=$lt_save_GCC
- with_gnu_ld=$lt_save_with_gnu_ld
- lt_cv_path_LDCXX=$lt_cv_path_LD
- lt_cv_path_LD=$lt_save_path_LD
- lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
- lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-AC_LANG_POP
-])# _LT_LANG_CXX_CONFIG
-
-
-# _LT_FUNC_STRIPNAME_CNF
-# ----------------------
-# func_stripname_cnf prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-#
-# This function is identical to the (non-XSI) version of func_stripname,
-# except this one can be used by m4 code that may be executed by configure,
-# rather than the libtool script.
-m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
-AC_REQUIRE([_LT_DECL_SED])
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
-func_stripname_cnf ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-} # func_stripname_cnf
-])# _LT_FUNC_STRIPNAME_CNF
-
-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
-# ---------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
-# Dependencies to place before and after the object being linked:
-_LT_TAGVAR(predep_objects, $1)=
-_LT_TAGVAR(postdep_objects, $1)=
-_LT_TAGVAR(predeps, $1)=
-_LT_TAGVAR(postdeps, $1)=
-_LT_TAGVAR(compiler_lib_search_path, $1)=
-
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library. It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
-int a;
-void foo (void) { a = 0; }
-_LT_EOF
-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-_LT_EOF
-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-_LT_EOF
-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
- subroutine foo
- implicit none
- integer a
- a=0
- return
- end
-_LT_EOF
-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-_LT_EOF
-], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
-package foo
-func foo() {
-}
-_LT_EOF
-])
-
-_lt_libdeps_save_CFLAGS=$CFLAGS
-case "$CC $CFLAGS " in #(
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
-esac
-
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- for p in `eval "$output_verbose_link_cmd"`; do
- case ${prev}${p} in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" ||
- test $p = "-R"; then
- prev=$p
- continue
- fi
-
- # Expand the sysroot to ease extracting the directories later.
- if test -z "$prev"; then
- case $p in
- -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
- -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
- -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
- esac
- fi
- case $p in
- =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
- esac
- if test "$pre_test_object_deps_done" = no; then
- case ${prev} in
- -L | -R)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
- else
- _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_TAGVAR(postdeps, $1)"; then
- _LT_TAGVAR(postdeps, $1)="${prev}${p}"
- else
- _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
- fi
- fi
- prev=
- ;;
-
- *.lto.$objext) ;; # Ignore GCC LTO objects
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
- _LT_TAGVAR(predep_objects, $1)="$p"
- else
- _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
- _LT_TAGVAR(postdep_objects, $1)="$p"
- else
- _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$RM -f confest.$objext
-CFLAGS=$_lt_libdeps_save_CFLAGS
-
-# PORTME: override above test on systems where it is broken
-m4_if([$1], [CXX],
-[case $host_os in
-interix[[3-9]]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- _LT_TAGVAR(predep_objects,$1)=
- _LT_TAGVAR(postdep_objects,$1)=
- _LT_TAGVAR(postdeps,$1)=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
-
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- if test "$solaris_use_stlport4" != yes; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-])
-
-case " $_LT_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
- [The directories searched by this compiler when creating a shared library])
-_LT_TAGDECL([], [predep_objects], [1],
- [Dependencies to place before and after the objects being linked to
- create a shared library])
-_LT_TAGDECL([], [postdep_objects], [1])
-_LT_TAGDECL([], [predeps], [1])
-_LT_TAGDECL([], [postdeps], [1])
-_LT_TAGDECL([], [compiler_lib_search_path], [1],
- [The library search path used internally by the compiler when linking
- a shared library])
-])# _LT_SYS_HIDDEN_LIBDEPS
-
-
-# _LT_LANG_F77_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a Fortran 77 compiler are
-# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_F77_CONFIG],
-[AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
- _lt_disable_F77=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the F77 compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code="\
- program t
- end
-"
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
- lt_save_GCC=$GCC
- lt_save_CFLAGS=$CFLAGS
- CC=${F77-"f77"}
- CFLAGS=$FFLAGS
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
- GCC=$G77
- if test -n "$compiler"; then
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_TAGVAR(GCC, $1)="$G77"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- GCC=$lt_save_GCC
- CC="$lt_save_CC"
- CFLAGS="$lt_save_CFLAGS"
-fi # test "$_lt_disable_F77" != yes
-
-AC_LANG_POP
-])# _LT_LANG_F77_CONFIG
-
-
-# _LT_LANG_FC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for a Fortran compiler are
-# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_FC_CONFIG],
-[AC_LANG_PUSH(Fortran)
-
-if test -z "$FC" || test "X$FC" = "Xno"; then
- _lt_disable_FC=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for fc test sources.
-ac_ext=${ac_fc_srcext-f}
-
-# Object file extension for compiled fc test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the FC compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code="\
- program t
- end
-"
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
- lt_save_GCC=$GCC
- lt_save_CFLAGS=$CFLAGS
- CC=${FC-"f95"}
- CFLAGS=$FCFLAGS
- compiler=$CC
- GCC=$ac_cv_fc_compiler_gnu
-
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-
- if test -n "$compiler"; then
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_SYS_HIDDEN_LIBDEPS($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- GCC=$lt_save_GCC
- CC=$lt_save_CC
- CFLAGS=$lt_save_CFLAGS
-fi # test "$_lt_disable_FC" != yes
-
-AC_LANG_POP
-])# _LT_LANG_FC_CONFIG
-
-
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GCJ-"gcj"}
-CFLAGS=$GCJFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GCJ_CONFIG
-
-
-# _LT_LANG_GO_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Go compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GO_CONFIG],
-[AC_REQUIRE([LT_PROG_GO])dnl
-AC_LANG_SAVE
-
-# Source file extension for Go test sources.
-ac_ext=go
-
-# Object file extension for compiled Go test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="package main; func main() { }"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='package main; func main() { }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GOC-"gccgo"}
-CFLAGS=$GOFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# Go did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GO_CONFIG
-
-
-# _LT_LANG_RC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for the Windows resource compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_RC_CONFIG],
-[AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-CFLAGS=
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-if test -n "$compiler"; then
- :
- _LT_CONFIG($1)
-fi
-
-GCC=$lt_save_GCC
-AC_LANG_RESTORE
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_RC_CONFIG
-
-
-# LT_PROG_GCJ
-# -----------
-AC_DEFUN([LT_PROG_GCJ],
-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
- [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
- [AC_CHECK_TOOL(GCJ, gcj,)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)])])[]dnl
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-
-
-# LT_PROG_GO
-# ----------
-AC_DEFUN([LT_PROG_GO],
-[AC_CHECK_TOOL(GOC, gccgo,)
-])
-
-
-# LT_PROG_RC
-# ----------
-AC_DEFUN([LT_PROG_RC],
-[AC_CHECK_TOOL(RC, windres,)
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_RC], [])
-
-
-# _LT_DECL_EGREP
-# --------------
-# If we don't have a new enough Autoconf to choose the best grep
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_EGREP],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_REQUIRE([AC_PROG_FGREP])dnl
-test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
-AC_SUBST([GREP])
-])
-
-
-# _LT_DECL_OBJDUMP
-# --------------
-# If we don't have a new enough Autoconf to choose the best objdump
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_OBJDUMP],
-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
-AC_SUBST([OBJDUMP])
-])
-
-# _LT_DECL_DLLTOOL
-# ----------------
-# Ensure DLLTOOL variable is set.
-m4_defun([_LT_DECL_DLLTOOL],
-[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
-AC_SUBST([DLLTOOL])
-])
-
-# _LT_DECL_SED
-# ------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible. Prefer GNU sed if found.
-m4_defun([_LT_DECL_SED],
-[AC_PROG_SED
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
- [Sed that helps us avoid accidentally triggering echo(1) options like -n])
-])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_SED], [])
-
-
-# _LT_CHECK_SHELL_FEATURES
-# ------------------------
-# Find out whether the shell is Bourne or XSI compatible,
-# or has some other useful features.
-m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,b/c, \
- && eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
- && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
- >/dev/null 2>&1 \
- && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- lt_unset=unset
-else
- lt_unset=false
-fi
-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- lt_SP2NL='tr \040 \012'
- lt_NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- lt_SP2NL='tr \100 \n'
- lt_NL2SP='tr \r\n \100\100'
- ;;
-esac
-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
-])# _LT_CHECK_SHELL_FEATURES
-
-
-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-# ------------------------------------------------------
-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-m4_defun([_LT_PROG_FUNCTION_REPLACE],
-[dnl {
-sed -e '/^$1 ()$/,/^} # $1 /c\
-$1 ()\
-{\
-m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-])
-
-
-# _LT_PROG_REPLACE_SHELLFNS
-# -------------------------
-# Replace existing portable implementations of several shell functions with
-# equivalent extended shell implementations where those features are available..
-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-[if test x"$xsi_shell" = xyes; then
- _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac])
-
- _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
- func_basename_result="${1##*/}"])
-
- _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
- func_basename_result="${1##*/}"])
-
- _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary parameter first.
- func_stripname_result=${3}
- func_stripname_result=${func_stripname_result#"${1}"}
- func_stripname_result=${func_stripname_result%"${2}"}])
-
- _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
- func_split_long_opt_name=${1%%=*}
- func_split_long_opt_arg=${1#*=}])
-
- _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
- func_split_short_opt_arg=${1#??}
- func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-
- _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
- case ${1} in
- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
- *) func_lo2o_result=${1} ;;
- esac])
-
- _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
-
- _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
-
- _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
-fi
-
-if test x"$lt_shell_append" = xyes; then
- _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
-
- _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
- func_quote_for_eval "${2}"
-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
- eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-
- # Save a `func_append' function call where possible by direct use of '+='
- sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-else
- # Save a `func_append' function call even when '+=' is not available
- sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
- AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-fi
-])
-
-# _LT_PATH_CONVERSION_FUNCTIONS
-# -----------------------------
-# Determine which file name conversion functions should be used by
-# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
-# for certain cross-compile configurations and native mingw.
-m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_MSG_CHECKING([how to convert $build file names to $host format])
-AC_CACHE_VAL(lt_cv_to_host_file_cmd,
-[case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
- ;;
- esac
- ;;
- *-*-cygwin* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
- ;;
- esac
- ;;
- * ) # unhandled hosts (and "normal" native builds)
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
-esac
-])
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
-_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
- [0], [convert $build file names to $host format])dnl
-
-AC_MSG_CHECKING([how to convert $build file names to toolchain format])
-AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
-[#assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
- ;;
- esac
- ;;
-esac
-])
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
-_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
- [0], [convert $build files to toolchain format])dnl
-])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
deleted file mode 100644
index 5d9acd8..0000000
--- a/m4/ltoptions.m4
+++ /dev/null
@@ -1,384 +0,0 @@
-# Helper functions for option handling. -*- Autoconf -*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 7 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it. Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
- _LT_MANGLE_DEFUN([$1], [$2]),
- [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
- [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME. If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
- dnl
- dnl Simply set some default values (i.e off) if boolean options were not
- dnl specified:
- _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
- ])
- _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
- ])
- dnl
- dnl If no reference was made to various pairs of opposing options, then
- dnl we run the default mode handler for the pair. For example, if neither
- dnl `shared' nor `disable-shared' was passed, we enable building of shared
- dnl archives by default:
- _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
- _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
- [_LT_ENABLE_FAST_INSTALL])
- ])
-])# _LT_SET_OPTIONS
-
-
-## --------------------------------- ##
-## Macros to handle LT_INIT options. ##
-## --------------------------------- ##
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS], [1], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
- [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
- _LT_DECL([build_libtool_libs], [enable_shared], [0],
- [Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], [disable-shared])
-])
-
-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
-
-
-
-# _LT_ENABLE_STATIC([DEFAULT])
-# ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_STATIC],
-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([static],
- [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
- [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
-
- _LT_DECL([build_old_libs], [enable_static], [0],
- [Whether or not to build static libraries])
-])# _LT_ENABLE_STATIC
-
-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
-])
-
-AC_DEFUN([AC_DISABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], [disable-static])
-])
-
-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
-
-
-
-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
-# ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_FAST_INSTALL],
-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([fast-install],
- [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
- [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
-
-_LT_DECL([fast_install], [enable_fast_install], [0],
- [Whether or not to optimize for fast installation])dnl
-])# _LT_ENABLE_FAST_INSTALL
-
-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
-
-# Old names:
-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
-])
-
-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
-# LT_INIT options.
-# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for lt_pkg in $withval; do
- IFS="$lt_save_ifs"
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-## ----------------- ##
-## LTDL_INIT Options ##
-## ----------------- ##
-
-m4_define([_LTDL_MODE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
- [m4_define([_LTDL_MODE], [nonrecursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
- [m4_define([_LTDL_MODE], [recursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
- [m4_define([_LTDL_MODE], [subproject])])
-
-m4_define([_LTDL_TYPE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [installable],
- [m4_define([_LTDL_TYPE], [installable])])
-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
- [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
deleted file mode 100644
index 9000a05..0000000
--- a/m4/ltsugar.m4
+++ /dev/null
@@ -1,123 +0,0 @@
-# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
- [$#], [2], [[$2]],
- [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
- [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
- [$#], 1, [],
- [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
- m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
- [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
- [m4_foreach([_Lt_suffix],
- ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
- [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
- [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
- [lt_append([$1], [$2], [$3])$4],
- [$5])],
- [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
- m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
- m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
- [$5],
- [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
- [lt_join(m4_quote(m4_default([$4], [[, ]])),
- lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
- [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
deleted file mode 100644
index 07a8602..0000000
--- a/m4/ltversion.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-# ltversion.m4 -- version numbers -*- Autoconf -*-
-#
-# Copyright (C) 2004 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# @configure_input@
-
-# serial 3337 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
deleted file mode 100644
index c573da9..0000000
--- a/m4/lt~obsolete.m4
+++ /dev/null
@@ -1,98 +0,0 @@
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004.
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 5 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else. This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
-m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
-m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
-m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
-m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/missing b/missing
index 28055d2..6a37006 100755
--- a/missing
+++ b/missing
@@ -1,10 +1,6 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-
-scriptversion=2009-04-28.21; # UTC
-
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -18,7 +14,9 @@ scriptversion=2009-04-28.21; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -31,8 +29,6 @@ if test $# -eq 0; then
fi
run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
@@ -42,24 +38,18 @@ else
configure_ac=configure.in
fi
-msg="missing on your system"
-
-case $1 in
+case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
- # Exit code 63 means version mismatch. This often happens
- # when the user try to use an ancient version of a tool on
- # a file that requires a minimum version. In this case we
- # we should proceed has if the program had been absent, or
- # if --run hadn't been passed.
- if test $? = 63; then
- run=:
- msg="probably too old"
- fi
;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
-h|--h|--he|--hel|--help)
echo "\
@@ -77,7 +67,6 @@ Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
- autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
@@ -85,18 +74,11 @@ Supported PROGRAM values:
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]
-
-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
-\`g' are ignored when checking the name.
-
-Send bug reports to <bug-automake@gnu.org>."
- exit $?
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
- exit $?
+ echo "missing 0.4 - GNU automake"
;;
-*)
@@ -105,69 +87,42 @@ Send bug reports to <bug-automake@gnu.org>."
exit 1
;;
-esac
-
-# normalize program name to check for.
-program=`echo "$1" | sed '
- s/^gnu-//; t
- s/^gnu//; t
- s/^g//; t'`
-
-# Now exit if we have it, but it failed. Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program). This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
- lex*|yacc*)
- # Not GNU programs, they don't have --version.
- ;;
-
- tar*)
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- exit 1
- fi
- ;;
-
- *)
+ aclocal*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- # Could not run --version or --help. This is probably someone
- # running `$TOOL --version' or `$TOOL --help' to check whether
- # $TOOL exists and not knowing $TOOL uses missing.
- exit 1
fi
- ;;
-esac
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
- aclocal*)
echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
+WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
- autoconf*)
+ autoconf)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
+WARNING: \`$1' is missing on your system. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
- autoheader*)
+ autoheader)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
+WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
@@ -175,7 +130,7 @@ WARNING: \`$1' is $msg. You should only need it if
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
- case $f in
+ case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@@ -185,8 +140,13 @@ WARNING: \`$1' is $msg. You should only need it if
;;
automake*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
+WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
@@ -195,16 +155,21 @@ WARNING: \`$1' is $msg. You should only need it if
while read f; do touch "$f"; done
;;
- autom4te*)
+ autom4te)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
- You might have modified some files without having the
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
proper tools for further handling them.
- You can get \`$1' as part of \`Autoconf' from any GNU
+ You can get \`$1Help2man' as part of \`Autoconf' from any GNU
archive site."
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
@@ -218,108 +183,111 @@ WARNING: \`$1' is needed, but is $msg.
fi
;;
- bison*|yacc*)
+ bison|yacc)
echo 1>&2 "\
-WARNING: \`$1' $msg. You should only need it if
+WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
- if test $# -ne 1; then
+ if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
- case $LASTARG in
+ case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if test -f "$SRCFILE"; then
+ if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if test -f "$SRCFILE"; then
+ if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
- if test ! -f y.tab.h; then
+ if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
- if test ! -f y.tab.c; then
+ if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
- lex*|flex*)
+ lex|flex)
echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
+WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
- if test $# -ne 1; then
+ if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
- case $LASTARG in
+ case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if test -f "$SRCFILE"; then
+ if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
- if test ! -f lex.yy.c; then
+ if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
- help2man*)
+ help2man)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
+WARNING: \`$1' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
- exit $?
+ exit 1
fi
;;
- makeinfo*)
+ makeinfo)
+ if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+ # We have makeinfo, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
+WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
- # The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
- # ... or it is the one specified with @setfilename ...
- infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '
- /^@setfilename/{
- s/.* \([^ ]*\) *$/\1/
- p
- q
- }' $infile`
- # ... or it is derived from the source name (dir/f.texi becomes f.info)
- test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
- # If the file does not exist, the user really needs makeinfo;
- # let's fail without touching anything.
- test -f $file || exit 1
touch $file
;;
- tar*)
+ tar)
shift
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
@@ -332,13 +300,13 @@ WARNING: \`$1' is $msg. You should only need it if
fi
firstarg="$1"
if shift; then
- case $firstarg in
+ case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
- case $firstarg in
+ case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
@@ -355,10 +323,10 @@ WARNING: I can't seem to be able to run \`tar' with the given arguments.
*)
echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
- You might have modified some files without having the
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequisites for installing
+ it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
@@ -366,11 +334,3 @@ WARNING: \`$1' is needed, and is $msg.
esac
exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 0000000..d2d5f21
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,111 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage" 1>&2
+ exit 0
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+case $dirmode in
+ '')
+ if mkdir -p -- . 2>/dev/null; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ fi
+ ;;
+esac
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=""
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# End:
+# mkinstalldirs ends here
diff --git a/openwrt/Makefile.am b/openwrt/Makefile.am
new file mode 100644
index 0000000..6bb5b8c
--- /dev/null
+++ b/openwrt/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST=conffiles control lighttpd.conf S51lighttpd lighttpd.mk
diff --git a/doc/scripts/Makefile.in b/openwrt/Makefile.in
index 009fb20..6d4fc07 100644
--- a/doc/scripts/Makefile.in
+++ b/openwrt/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,12 +13,15 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -34,31 +36,23 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
-subdir = doc/scripts
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+subdir = openwrt
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/control.in $(srcdir)/lighttpd.mk.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
+CONFIG_CLEAN_FILES = control lighttpd.mk
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ATTR_LIB = @ATTR_LIB@
AUTOCONF = @AUTOCONF@
@@ -69,73 +63,69 @@ BZ_LIB = @BZ_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@
+CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
+CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
CRYPT_LIB = @CRYPT_LIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
+ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
FAM_CFLAGS = @FAM_CFLAGS@
FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
+FFLAGS = @FFLAGS@
GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LBER_LIB = @LBER_LIB@
-LD = @LD@
LDAP_LIB = @LDAP_LIB@
LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LUACONFIG = @LUACONFIG@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
+NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@
+NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@
OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
PCRE_LIB = @PCRE_LIB@
PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
-SED = @SED@
SENDFILE_LIB = @SENDFILE_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -144,18 +134,20 @@ SQLITE_LIBS = @SQLITE_LIBS@
SSL_LIB = @SSL_LIB@
STRIP = @STRIP@
U = @U@
-UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -167,63 +159,48 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
-builddir = @builddir@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
-localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-EXTRA_DIST = \
- rrdtool-graph.sh \
- spawn-php.sh
-
+EXTRA_DIST = conffiles control lighttpd.conf S51lighttpd lighttpd.mk
all: all-am
.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/scripts/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign doc/scripts/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu openwrt/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu openwrt/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -237,17 +214,24 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
+control: $(top_builddir)/config.status $(srcdir)/control.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+lighttpd.mk: $(top_builddir)/config.status $(srcdir)/lighttpd.mk.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
tags: TAGS
TAGS:
@@ -256,32 +240,29 @@ CTAGS:
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
@@ -299,22 +280,16 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -325,7 +300,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
-distclean-am: clean-am distclean-generic
+distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
@@ -333,38 +308,18 @@ dvi-am:
html: html-am
-html-am:
-
info: info-am
info-am:
install-data-am:
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
install-exec-am:
-install-html: install-html-am
-
-install-html-am:
-
install-info: install-info-am
-install-info-am:
-
install-man:
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -383,21 +338,17 @@ ps: ps-am
ps-am:
-uninstall-am:
-
-.MAKE: install-am install-strip
+uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
-
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/openwrt/S51lighttpd b/openwrt/S51lighttpd
new file mode 100755
index 0000000..c9aa1f9
--- /dev/null
+++ b/openwrt/S51lighttpd
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+/usr/sbin/lighttpd -f /etc/lighttpd.conf
+exit $?
diff --git a/openwrt/conffiles b/openwrt/conffiles
new file mode 100644
index 0000000..e90f8e1
--- /dev/null
+++ b/openwrt/conffiles
@@ -0,0 +1 @@
+/etc/lighttpd.conf
diff --git a/openwrt/control b/openwrt/control
new file mode 100644
index 0000000..d7a7de3
--- /dev/null
+++ b/openwrt/control
@@ -0,0 +1,9 @@
+Package: lighttpd
+Version: 1.4.8
+Architecture: mipsel
+Maintainer: Jan Kneschke <jan@kneschke.de>
+Source: http://jan.kneschke.de/projects/lighttpd/download/lighttpd-1.4.8.tar.gz
+Section: net
+Priority: optional
+Depends:
+Description: Flexible and Lightweight Webserver
diff --git a/openwrt/control.in b/openwrt/control.in
new file mode 100644
index 0000000..3a4c571
--- /dev/null
+++ b/openwrt/control.in
@@ -0,0 +1,9 @@
+Package: lighttpd
+Version: @VERSION@
+Architecture: mipsel
+Maintainer: Jan Kneschke <jan@kneschke.de>
+Source: http://jan.kneschke.de/projects/lighttpd/download/lighttpd-@VERSION@.tar.gz
+Section: net
+Priority: optional
+Depends:
+Description: Flexible and Lightweight Webserver
diff --git a/openwrt/lighttpd.conf b/openwrt/lighttpd.conf
new file mode 100644
index 0000000..42d2f76
--- /dev/null
+++ b/openwrt/lighttpd.conf
@@ -0,0 +1,231 @@
+# lighttpd configuration file
+#
+# use a it as base for lighttpd 1.0.0 and above
+#
+# $Id: lighttpd.conf,v 1.6 2004/08/29 09:44:53 weigon Exp $
+
+############ Options you really have to take care of ####################
+
+## modules to load
+# at least mod_access and mod_accesslog should be loaded
+# all other module should only be loaded if really neccesary
+# - saves some time
+# - saves memory
+server.modules = (
+# "mod_rewrite",
+# "mod_redirect",
+ "mod_access",
+# "mod_auth",
+# "mod_status",
+# "mod_fastcgi",
+# "mod_simple_vhost",
+# "mod_evhost",
+# "mod_cgi",
+# "mod_compress",
+# "mod_ssi",
+# "mod_usertrack",
+# "mod_rrdtool",
+# "mod_accesslog"
+)
+
+## a static document-root, for virtual-hosting take look at the
+## server.virtual-* options
+server.document-root = "/www/"
+
+## where to send error-messages to
+# server.errorlog = ""
+
+# files to check for if .../ is requested
+server.indexfiles = ( "index.php", "index.html",
+ "index.htm", "default.htm" )
+
+# mimetype mapping
+mimetype.assign = (
+ ".pdf" => "application/pdf",
+ ".sig" => "application/pgp-signature",
+ ".spl" => "application/futuresplash",
+ ".class" => "application/octet-stream",
+ ".ps" => "application/postscript",
+ ".torrent" => "application/x-bittorrent",
+ ".dvi" => "application/x-dvi",
+ ".gz" => "application/x-gzip",
+ ".pac" => "application/x-ns-proxy-autoconfig",
+ ".swf" => "application/x-shockwave-flash",
+ ".tar.gz" => "application/x-tgz",
+ ".tgz" => "application/x-tgz",
+ ".tar" => "application/x-tar",
+ ".zip" => "application/zip",
+ ".mp3" => "audio/mpeg",
+ ".m3u" => "audio/x-mpegurl",
+ ".wma" => "audio/x-ms-wma",
+ ".wax" => "audio/x-ms-wax",
+ ".ogg" => "audio/x-wav",
+ ".wav" => "audio/x-wav",
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".xbm" => "image/x-xbitmap",
+ ".xpm" => "image/x-xpixmap",
+ ".xwd" => "image/x-xwindowdump",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".asc" => "text/plain",
+ ".c" => "text/plain",
+ ".conf" => "text/plain",
+ ".text" => "text/plain",
+ ".txt" => "text/plain",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml",
+ ".mpeg" => "video/mpeg",
+ ".mpg" => "video/mpeg",
+ ".mov" => "video/quicktime",
+ ".qt" => "video/quicktime",
+ ".avi" => "video/x-msvideo",
+ ".asf" => "video/x-ms-asf",
+ ".asx" => "video/x-ms-asf",
+ ".wmv" => "video/x-ms-wmv"
+ )
+
+# Use the "Content-Type" extended attribute to obtain mime type if possible
+# mimetypes.use-xattr = "enable"
+
+#### accesslog module
+# accesslog.filename = "/www/logs/access.log"
+
+## deny access the file-extensions
+#
+# ~ is for backupfiles from vi, emacs, joe, ...
+# .inc is often used for code includes which should in general not be part
+# of the document-root
+url.access-deny = ( "~", ".inc" )
+
+
+
+######### Options that are good to be but not neccesary to be changed #######
+
+## bind to port (default: 80)
+#server.port = 81
+
+## bind to localhost (default: all interfaces)
+#server.bind = "grisu.home.kneschke.de"
+
+## error-handler for status 404
+#server.error-handler-404 = "/error-handler.html"
+#server.error-handler-404 = "/error-handler.php"
+
+
+###### virtual hosts
+##
+## If you want name-based virtual hosting add the next three settings and load
+## mod_simple_vhost
+##
+## document-root =
+## virtual-server-root + virtual-server-default-host + virtual-server-docroot or
+## virtual-server-root + http-host + virtual-server-docroot
+##
+#simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
+#simple-vhost.default-host = "grisu.home.kneschke.de"
+#simple-vhost.document-root = "/pages/"
+
+
+##
+## Format: <errorfile-prefix><status>.html
+## -> ..../status-404.html for 'File not found'
+#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-"
+
+## virtual directory listings
+#server.dir-listing = "enable"
+
+## send unhandled HTTP-header headers to error-log
+#debug.dump-unknown-headers = "enable"
+
+### only root can use these options
+#
+# chroot() to directory (default: no chroot() )
+#server.chroot = "/"
+
+## change uid to <uid> (default: don't care)
+#server.username = "wwwrun"
+
+## change uid to <uid> (default: don't care)
+#server.groupname = "wwwrun"
+
+#### compress module
+#compress.cache-dir = "/tmp/lighttpd/cache/compress/"
+#compress.filetype = ("text/plain", "text/html")
+
+#### fastcgi module
+## read fastcgi.txt for more info
+#fastcgi.server = ( ".php" =>
+# ( "grisu" =>
+# (
+# "host" => "192.168.2.10",
+# "port" => 1026
+# )
+# )
+# )
+
+#### CGI module
+#cgi.assign = ( ".pl" => "/usr/bin/perl",
+# ".cgi" => "/usr/bin/perl" )
+#
+
+#### SSL engine
+#ssl.engine = "enable"
+#ssl.pemfile = "server.pem"
+
+#### status module
+# status.status-url = "/server-status"
+# status.config-url = "/server-config"
+
+#### auth module
+## read authentification.txt for more info
+# auth.backend = "plain"
+# auth.backend.plain.userfile = "lighttpd.user"
+# auth.backend.plain.groupfile = "lighttpd.group"
+
+# auth.backend.ldap.hostname = "localhost"
+# auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
+# auth.backend.ldap.filter = "(uid=$)"
+
+# auth.require = ( "/server-status" =>
+# (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "group=www|user=jan|host=192.168.2.10"
+# ),
+# "/server-info" =>
+# (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "group=www|user=jan|host=192.168.2.10"
+# )
+# )
+
+#### url handling modules (rewrite, redirect, access)
+# url.rewrite = ( "^/$" => "/server-status" )
+# url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
+
+#
+# define a pattern for the host url finding
+# %% => % sign
+# %0 => domain name + tld
+# %1 => tld
+# %2 => domain name without tld
+# %3 => subdomain 1 name
+# %4 => subdomain 2 name
+#
+# evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
+
+#### expire module
+# expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
+
+#### ssi
+# ssi.extension = ( ".shtml" )
+
+#### rrdtool
+# rrdtool.binary = "/usr/bin/rrdtool"
+# rrdtool.db-name = "/var/www/lighttpd.rrd"
diff --git a/openwrt/lighttpd.mk b/openwrt/lighttpd.mk
new file mode 100644
index 0000000..08debee
--- /dev/null
+++ b/openwrt/lighttpd.mk
@@ -0,0 +1,72 @@
+######################################################
+#
+# An example makefile to fetch a package from sources
+# then fetch the ipkg updates required to the base package
+# extract the archives into the build tree
+# and then build the source
+#
+######################################################
+
+
+# For this example we'll use a fairly simple package that compiles easily
+# and has sources available for download at sourceforge
+LIGHTTPD=lighttpd-1.4.8
+LIGHTTPD_TARGET=.built
+LIGHTTPD_DIR=$(BUILD_DIR)/$(LIGHTTPD)
+LIGHTTPD_IPK=$(BUILD_DIR)/$(LIGHTTPD)_mipsel.ipk
+LIGHTTPD_IPK_DIR=$(BUILD_DIR)/$(LIGHTTPD)-ipk
+
+LIGHTTPD_SITE=http://jan.kneschke.de/projects/lighttpd/download/
+LIGHTTPD_SOURCE=$(LIGHTTPD).tar.gz
+
+
+# We need to download sources if we dont have them
+$(DL_DIR)/$(LIGHTTPD_SOURCE) :
+ $(WGET) -P $(DL_DIR) $(LIGHTTPD_SITE)/$(LIGHTTPD_SOURCE)
+
+# if we have the sources, they do no good unless they are unpacked
+$(LIGHTTPD_DIR)/.unpacked: $(DL_DIR)/$(LIGHTTPD_SOURCE)
+ gzip -cd $(DL_DIR)/$(LIGHTTPD_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+ touch $(LIGHTTPD_DIR)/.unpacked
+
+# if we have the sources unpacked, we need to configure them
+$(LIGHTTPD_DIR)/.configured: $(LIGHTTPD_DIR)/.unpacked
+ (cd $(LIGHTTPD_DIR); rm -rf config.cache; \
+ $(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LD=$(TARGET_CROSS)ld \
+ ./configure \
+ --target=$(GNU_TARGET_NAME) \
+ --host=$(GNU_TARGET_NAME) \
+ --build=$(GNU_HOST_NAME) \
+ --prefix=/usr \
+ --exec-prefix=/usr \
+ --bindir=/usr/bin \
+ --sbindir=/usr/sbin \
+ --disable-zlib \
+ --sysconfdir=/etc \
+ --program-transform-name="s,y,y," \
+ );
+ touch $(LIGHTTPD_DIR)/.configured
+
+
+# now that we have it all in place, just build it
+$(LIGHTTPD_DIR)/$(LIGHTTPD_TARGET): $(LIGHTTPD_DIR)/.configured
+ cd $(LIGHTTPD_DIR) && $(MAKE) CC=$(TARGET_CC) DESTDIR="$(LIGHTTPD_IPK_DIR)" install
+ $(STAGING_DIR)/bin/sstrip $(LIGHTTPD_IPK_DIR)/usr/sbin/lighttpd
+ touch $(LIGHTTPD_DIR)/$(LIGHTTPD_TARGET)
+
+$(LIGHTTPD_IPK): uclibc $(LIGHTTPD_DIR)/$(LIGHTTPD_TARGET)
+ mkdir -p $(LIGHTTPD_IPK_DIR)/CONTROL
+ mkdir -p $(LIGHTTPD_IPK_DIR)/etc/init.d
+ cp $(LIGHTTPD_DIR)/openwrt/conffiles $(LIGHTTPD_IPK_DIR)/CONTROL
+ cp $(LIGHTTPD_DIR)/openwrt/control $(LIGHTTPD_IPK_DIR)/CONTROL
+ cp $(LIGHTTPD_DIR)/openwrt/S51lighttpd $(LIGHTTPD_IPK_DIR)/etc/init.d/
+ cp $(LIGHTTPD_DIR)/openwrt/lighttpd.conf $(LIGHTTPD_IPK_DIR)/etc/
+
+ rm -f $(LIGHTTPD_IPK_DIR)/usr/lib/*.a
+ rm -f $(LIGHTTPD_IPK_DIR)/usr/lib/*.la
+
+ cd $(BUILD_DIR); $(IPKG_BUILD) $(LIGHTTPD_IPK_DIR)
+
+lighttpd-ipk: $(LIGHTTPD_IPK)
diff --git a/openwrt/lighttpd.mk.in b/openwrt/lighttpd.mk.in
new file mode 100644
index 0000000..9ee6170
--- /dev/null
+++ b/openwrt/lighttpd.mk.in
@@ -0,0 +1,72 @@
+######################################################
+#
+# An example makefile to fetch a package from sources
+# then fetch the ipkg updates required to the base package
+# extract the archives into the build tree
+# and then build the source
+#
+######################################################
+
+
+# For this example we'll use a fairly simple package that compiles easily
+# and has sources available for download at sourceforge
+LIGHTTPD=lighttpd-@VERSION@
+LIGHTTPD_TARGET=.built
+LIGHTTPD_DIR=$(BUILD_DIR)/$(LIGHTTPD)
+LIGHTTPD_IPK=$(BUILD_DIR)/$(LIGHTTPD)_mipsel.ipk
+LIGHTTPD_IPK_DIR=$(BUILD_DIR)/$(LIGHTTPD)-ipk
+
+LIGHTTPD_SITE=http://jan.kneschke.de/projects/lighttpd/download/
+LIGHTTPD_SOURCE=$(LIGHTTPD).tar.gz
+
+
+# We need to download sources if we dont have them
+$(DL_DIR)/$(LIGHTTPD_SOURCE) :
+ $(WGET) -P $(DL_DIR) $(LIGHTTPD_SITE)/$(LIGHTTPD_SOURCE)
+
+# if we have the sources, they do no good unless they are unpacked
+$(LIGHTTPD_DIR)/.unpacked: $(DL_DIR)/$(LIGHTTPD_SOURCE)
+ gzip -cd $(DL_DIR)/$(LIGHTTPD_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+ touch $(LIGHTTPD_DIR)/.unpacked
+
+# if we have the sources unpacked, we need to configure them
+$(LIGHTTPD_DIR)/.configured: $(LIGHTTPD_DIR)/.unpacked
+ (cd $(LIGHTTPD_DIR); rm -rf config.cache; \
+ $(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LD=$(TARGET_CROSS)ld \
+ ./configure \
+ --target=$(GNU_TARGET_NAME) \
+ --host=$(GNU_TARGET_NAME) \
+ --build=$(GNU_HOST_NAME) \
+ --prefix=/usr \
+ --exec-prefix=/usr \
+ --bindir=/usr/bin \
+ --sbindir=/usr/sbin \
+ --disable-zlib \
+ --sysconfdir=/etc \
+ --program-transform-name="s,y,y," \
+ );
+ touch $(LIGHTTPD_DIR)/.configured
+
+
+# now that we have it all in place, just build it
+$(LIGHTTPD_DIR)/$(LIGHTTPD_TARGET): $(LIGHTTPD_DIR)/.configured
+ cd $(LIGHTTPD_DIR) && $(MAKE) CC=$(TARGET_CC) DESTDIR="$(LIGHTTPD_IPK_DIR)" install
+ $(STAGING_DIR)/bin/sstrip $(LIGHTTPD_IPK_DIR)/usr/sbin/lighttpd
+ touch $(LIGHTTPD_DIR)/$(LIGHTTPD_TARGET)
+
+$(LIGHTTPD_IPK): uclibc $(LIGHTTPD_DIR)/$(LIGHTTPD_TARGET)
+ mkdir -p $(LIGHTTPD_IPK_DIR)/CONTROL
+ mkdir -p $(LIGHTTPD_IPK_DIR)/etc/init.d
+ cp $(LIGHTTPD_DIR)/openwrt/conffiles $(LIGHTTPD_IPK_DIR)/CONTROL
+ cp $(LIGHTTPD_DIR)/openwrt/control $(LIGHTTPD_IPK_DIR)/CONTROL
+ cp $(LIGHTTPD_DIR)/openwrt/S51lighttpd $(LIGHTTPD_IPK_DIR)/etc/init.d/
+ cp $(LIGHTTPD_DIR)/openwrt/lighttpd.conf $(LIGHTTPD_IPK_DIR)/etc/
+
+ rm -f $(LIGHTTPD_IPK_DIR)/usr/lib/*.a
+ rm -f $(LIGHTTPD_IPK_DIR)/usr/lib/*.la
+
+ cd $(BUILD_DIR); $(IPKG_BUILD) $(LIGHTTPD_IPK_DIR)
+
+lighttpd-ipk: $(LIGHTTPD_IPK)
diff --git a/src/Makefile.am b/src/Makefile.am
index 367f5d9..8caace2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,60 +1,31 @@
-AM_CFLAGS = $(FAM_CFLAGS)
-
noinst_PROGRAMS=proc_open lemon # simple-fcgi #graphic evalo bench ajp ssl error_test adserver gen-license
-sbin_PROGRAMS=lighttpd lighttpd-angel
-LEMON=$(top_builddir)/src/lemon$(EXEEXT)
+sbin_PROGRAMS=lighttpd
+bin_PROGRAMS=spawn-fcgi
+LEMON=$(top_builddir)/src/lemon
lemon_SOURCES=lemon.c
-lighttpd_angel_SOURCES=lighttpd-angel.c
-
-.PHONY: versionstamp parsers
-
-versionstamp:
- @test -f versionstamp.h || touch versionstamp.h; \
- REVISION=""; \
- if test -d "$(top_srcdir)/.svn" -a -x "`which svnversion`"; then \
- REVISION="$$(LANG= LC_ALL=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
- if test "$$REVISION" = "exported"; then \
- REVISION=""; \
- fi; \
- fi; \
- if test -z "$$REVISION" -a -d "$(top_srcdir)/.git" -a -x "`which git`"; then \
- REVISION="$$(cd "$(top_srcdir)"; LANG= LC_ALL=C git describe --always 2>/dev/null || echo)"; \
- fi; \
- if test -n "$$REVISION"; then \
- echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
- else \
- echo "#define REPO_VERSION \"\"" > versionstamp.h.tmp; \
- fi; \
- if ! diff versionstamp.h.tmp versionstamp.h >/dev/null 2>/dev/null; then \
- mv versionstamp.h.tmp versionstamp.h; \
- else \
- rm versionstamp.h.tmp; \
- fi
+#simple_fcgi_SOURCES=simple-fcgi.c
+#simple_fcgi_LDADD=-lfcgi
if CROSS_COMPILING
-configparser.c configparser.h:
-mod_ssi_exprparser.c mod_ssi_exprparser.h:
-
-parsers:
+configparser.c configparser.h:
+mod_ssi_exprparser.c mod_ssi_exprparser.h:
else
-configparser.h: configparser.c
-configparser.c: $(srcdir)/configparser.y $(srcdir)/lempar.c lemon$(EXEEXT)
+configparser.y: lemon
+mod_ssi_exprparser.y: lemon
+
+configparser.c configparser.h: configparser.y
rm -f configparser.h
$(LEMON) -q $(srcdir)/configparser.y $(srcdir)/lempar.c
-mod_ssi_exprparser.h: mod_ssi_exprparser.c
-mod_ssi_exprparser.c: $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c lemon$(EXEEXT)
+mod_ssi_exprparser.c mod_ssi_exprparser.h: mod_ssi_exprparser.y
rm -f mod_ssi_exprparser.h
$(LEMON) -q $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c
-
-parsers: configparser.c mod_ssi_exprparser.c
endif
-BUILT_SOURCES = parsers versionstamp
-MAINTAINERCLEANFILES = configparser.c configparser.h mod_ssi_exprparser.c mod_ssi_exprparser.h
-CLEANFILES = versionstamp.h versionstamp.h.tmp
+configfile.c: configparser.h
+mod_ssi_expr.c: mod_ssi_exprparser.h
common_src=buffer.c log.c \
keyvalue.c chunk.c \
@@ -62,10 +33,9 @@ common_src=buffer.c log.c \
stat_cache.c plugin.c joblist.c etag.c array.c \
data_string.c data_count.c data_array.c \
data_integer.c md5.c data_fastcgi.c \
- fdevent_select.c fdevent_libev.c \
+ fdevent_select.c fdevent_linux_rtsig.c \
fdevent_poll.c fdevent_linux_sysepoll.c \
- fdevent_solaris_devpoll.c fdevent_solaris_port.c \
- fdevent_freebsd_kqueue.c \
+ fdevent_solaris_devpoll.c fdevent_freebsd_kqueue.c \
data_config.c bitset.c \
inet_ntop_cache.c crc32.c \
connections-glue.c \
@@ -74,12 +44,14 @@ common_src=buffer.c log.c \
network_write.c network_linux_sendfile.c \
network_freebsd_sendfile.c network_writev.c \
network_solaris_sendfilev.c network_openssl.c \
- splaytree.c status_counter.c
-
+ splaytree.c
+
src = server.c response.c connections.c network.c \
configfile.c configparser.c request.c proc_open.c
-lib_LTLIBRARIES =
+spawn_fcgi_SOURCES=spawn-fcgi.c
+
+lib_LTLIBRARIES =
if NO_RDYNAMIC
# if the linker doesn't allow referencing symbols of the binary
@@ -87,36 +59,20 @@ if NO_RDYNAMIC
# everything
lib_LTLIBRARIES += liblightcomp.la
liblightcomp_la_SOURCES=$(common_src)
-liblightcomp_la_CFLAGS=$(AM_CFLAGS) $(LIBEV_CFLAGS)
+liblightcomp_la_CFLAGS=$(AM_CFLAGS) $(FAM_CFLAGS)
liblightcomp_la_LDFLAGS = -avoid-version -no-undefined
-liblightcomp_la_LIBADD = $(PCRE_LIB) $(SSL_LIB) $(FAM_LIBS) $(LIBEV_LIBS)
+liblightcomp_la_LIBADD = $(PCRE_LIB) $(SSL_LIB) $(FAM_LIBS)
common_libadd = liblightcomp.la
else
src += $(common_src)
-common_libadd =
+common_libadd =
endif
-lib_LTLIBRARIES += mod_flv_streaming.la
-mod_flv_streaming_la_SOURCES = mod_flv_streaming.c
-mod_flv_streaming_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
-mod_flv_streaming_la_LIBADD = $(common_libadd)
-
-lib_LTLIBRARIES += mod_evasive.la
-mod_evasive_la_SOURCES = mod_evasive.c
-mod_evasive_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
-mod_evasive_la_LIBADD = $(common_libadd)
-
lib_LTLIBRARIES += mod_webdav.la
mod_webdav_la_SOURCES = mod_webdav.c
-mod_webdav_la_CFLAGS = $(AM_CFLAGS) $(XML_CFLAGS) $(SQLITE_CFLAGS)
+mod_webdav_la_CFLAGS = $(XML_CFLAGS)
mod_webdav_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
-mod_webdav_la_LIBADD = $(common_libadd) $(XML_LIBS) $(SQLITE_LIBS) $(UUID_LIBS)
-
-lib_LTLIBRARIES += mod_magnet.la
-mod_magnet_la_SOURCES = mod_magnet.c mod_magnet_cache.c
-mod_magnet_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
-mod_magnet_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
-mod_magnet_la_LIBADD = $(common_libadd) $(LUA_LIBS) -lm
+mod_webdav_la_LIBADD = $(common_libadd) $(XML_LIBS) $(SQLITE_LIBS)
lib_LTLIBRARIES += mod_cml.la
mod_cml_la_SOURCES = mod_cml.c mod_cml_lua.c mod_cml_funcs.c
@@ -136,42 +92,42 @@ mod_mysql_vhost_la_LIBADD = $(MYSQL_LIBS) $(common_libadd)
mod_mysql_vhost_la_CPPFLAGS = $(MYSQL_INCLUDE)
lib_LTLIBRARIES += mod_cgi.la
-mod_cgi_la_SOURCES = mod_cgi.c
+mod_cgi_la_SOURCES = mod_cgi.c
mod_cgi_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_cgi_la_LIBADD = $(common_libadd)
lib_LTLIBRARIES += mod_scgi.la
-mod_scgi_la_SOURCES = mod_scgi.c
+mod_scgi_la_SOURCES = mod_scgi.c
mod_scgi_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_scgi_la_LIBADD = $(common_libadd)
lib_LTLIBRARIES += mod_staticfile.la
-mod_staticfile_la_SOURCES = mod_staticfile.c
+mod_staticfile_la_SOURCES = mod_staticfile.c
mod_staticfile_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_staticfile_la_LIBADD = $(common_libadd)
lib_LTLIBRARIES += mod_dirlisting.la
-mod_dirlisting_la_SOURCES = mod_dirlisting.c
+mod_dirlisting_la_SOURCES = mod_dirlisting.c
mod_dirlisting_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_dirlisting_la_LIBADD = $(common_libadd) $(PCRE_LIB)
lib_LTLIBRARIES += mod_indexfile.la
-mod_indexfile_la_SOURCES = mod_indexfile.c
+mod_indexfile_la_SOURCES = mod_indexfile.c
mod_indexfile_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_indexfile_la_LIBADD = $(common_libadd)
lib_LTLIBRARIES += mod_setenv.la
-mod_setenv_la_SOURCES = mod_setenv.c
+mod_setenv_la_SOURCES = mod_setenv.c
mod_setenv_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_setenv_la_LIBADD = $(common_libadd)
lib_LTLIBRARIES += mod_alias.la
-mod_alias_la_SOURCES = mod_alias.c
+mod_alias_la_SOURCES = mod_alias.c
mod_alias_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_alias_la_LIBADD = $(common_libadd)
lib_LTLIBRARIES += mod_userdir.la
-mod_userdir_la_SOURCES = mod_userdir.c
+mod_userdir_la_SOURCES = mod_userdir.c
mod_userdir_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_userdir_la_LIBADD = $(common_libadd)
@@ -191,7 +147,7 @@ mod_proxy_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_proxy_la_LIBADD = $(common_libadd)
lib_LTLIBRARIES += mod_ssi.la
-mod_ssi_la_SOURCES = mod_ssi_exprparser.c mod_ssi_expr.c mod_ssi.c
+mod_ssi_la_SOURCES = mod_ssi_exprparser.c mod_ssi_expr.c mod_ssi.c
mod_ssi_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_ssi_la_LIBADD = $(common_libadd) $(PCRE_LIB)
@@ -219,29 +175,24 @@ lib_LTLIBRARIES += mod_simple_vhost.la
mod_simple_vhost_la_SOURCES = mod_simple_vhost.c
mod_simple_vhost_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_simple_vhost_la_LIBADD = $(common_libadd)
-
+
lib_LTLIBRARIES += mod_fastcgi.la
mod_fastcgi_la_SOURCES = mod_fastcgi.c
mod_fastcgi_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_fastcgi_la_LIBADD = $(common_libadd)
-lib_LTLIBRARIES += mod_extforward.la
-mod_extforward_la_SOURCES = mod_extforward.c
-mod_extforward_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
-mod_extforward_la_LIBADD = $(common_libadd)
-
lib_LTLIBRARIES += mod_access.la
mod_access_la_SOURCES = mod_access.c
mod_access_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_access_la_LIBADD = $(common_libadd)
lib_LTLIBRARIES += mod_compress.la
-mod_compress_la_SOURCES = mod_compress.c
+mod_compress_la_SOURCES = mod_compress.c
mod_compress_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_compress_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)
lib_LTLIBRARIES += mod_auth.la
-mod_auth_la_SOURCES = mod_auth.c http_auth.c
+mod_auth_la_SOURCES = mod_auth.c http_auth_digest.c http_auth.c
mod_auth_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_auth_la_LIBADD = $(CRYPT_LIB) $(LDAP_LIB) $(LBER_LIB) $(common_libadd)
@@ -268,7 +219,7 @@ mod_accesslog_la_LIBADD = $(common_libadd)
hdr = server.h buffer.h network.h log.h keyvalue.h \
response.h request.h fastcgi.h chunk.h \
- settings.h http_chunk.h \
+ settings.h http_chunk.h http_auth_digest.h \
md5.h http_auth.h stream.h \
fdevent.h connections.h base.h stat_cache.h \
plugin.h mod_auth.h \
@@ -277,16 +228,14 @@ hdr = server.h buffer.h network.h log.h keyvalue.h \
mod_ssi.h mod_ssi_expr.h inet_ntop_cache.h \
configparser.h mod_ssi_exprparser.h \
sys-mmap.h sys-socket.h mod_cml.h mod_cml_funcs.h \
- splaytree.h proc_open.h status_counter.h \
- mod_magnet_cache.h \
- version.h
+ splaytree.h proc_open.h
-DEFS= @DEFS@ -DHAVE_VERSION_H -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
+DEFS= @DEFS@ -DLIBRARY_DIR="\"$(libdir)\""
lighttpd_SOURCES = $(src)
-lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(SSL_LIB) $(FAM_LIBS) $(LIBEV_LIBS)
+lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(SSL_LIB) $(FAM_LIBS)
lighttpd_LDFLAGS = -export-dynamic
-lighttpd_CCPFLAGS = $(FAM_CFLAGS) $(LIBEV_CFLAGS)
+lighttpd_CCPFLAGS = $(FAM_CFLAGS)
proc_open_SOURCES = proc_open.c buffer.c
proc_open_CPPFLAGS= -DDEBUG_PROC_OPEN
@@ -306,5 +255,4 @@ proc_open_CPPFLAGS= -DDEBUG_PROC_OPEN
#ajp_SOURCES = ajp.c
noinst_HEADERS = $(hdr)
-EXTRA_DIST = mod_skeleton.c configparser.y mod_ssi_exprparser.y lempar.c SConscript
-
+EXTRA_DIST = mod_skeleton.c configparser.y mod_ssi_exprparser.y lempar.c
diff --git a/src/Makefile.in b/src/Makefile.in
index 559e1f2..e892092 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -17,12 +16,17 @@
+SOURCES = $(liblightcomp_la_SOURCES) $(mod_access_la_SOURCES) $(mod_accesslog_la_SOURCES) $(mod_alias_la_SOURCES) $(mod_auth_la_SOURCES) $(mod_cgi_la_SOURCES) $(mod_cml_la_SOURCES) $(mod_compress_la_SOURCES) $(mod_dirlisting_la_SOURCES) $(mod_evhost_la_SOURCES) $(mod_expire_la_SOURCES) $(mod_fastcgi_la_SOURCES) $(mod_indexfile_la_SOURCES) $(mod_mysql_vhost_la_SOURCES) $(mod_proxy_la_SOURCES) $(mod_redirect_la_SOURCES) $(mod_rewrite_la_SOURCES) $(mod_rrdtool_la_SOURCES) $(mod_scgi_la_SOURCES) $(mod_secdownload_la_SOURCES) $(mod_setenv_la_SOURCES) $(mod_simple_vhost_la_SOURCES) $(mod_ssi_la_SOURCES) $(mod_staticfile_la_SOURCES) $(mod_status_la_SOURCES) $(mod_trigger_b4_dl_la_SOURCES) $(mod_userdir_la_SOURCES) $(mod_usertrack_la_SOURCES) $(mod_webdav_la_SOURCES) $(lemon_SOURCES) $(lighttpd_SOURCES) $(proc_open_SOURCES) $(spawn_fcgi_SOURCES)
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -38,7 +42,8 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
noinst_PROGRAMS = proc_open$(EXEEXT) lemon$(EXEEXT)
-sbin_PROGRAMS = lighttpd$(EXEEXT) lighttpd-angel$(EXEEXT)
+sbin_PROGRAMS = lighttpd$(EXEEXT)
+bin_PROGRAMS = spawn-fcgi$(EXEEXT)
# if the linker doesn't allow referencing symbols of the binary
# we have to put everything into a shared-lib and link it into
@@ -49,61 +54,37 @@ subdir = src
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)"
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
+ "$(DESTDIR)$(sbindir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
am__DEPENDENCIES_1 =
@NO_RDYNAMIC_TRUE@liblightcomp_la_DEPENDENCIES = \
@NO_RDYNAMIC_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-@NO_RDYNAMIC_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+@NO_RDYNAMIC_TRUE@ $(am__DEPENDENCIES_1)
am__liblightcomp_la_SOURCES_DIST = buffer.c log.c keyvalue.c chunk.c \
http_chunk.c stream.c fdevent.c stat_cache.c plugin.c \
joblist.c etag.c array.c data_string.c data_count.c \
data_array.c data_integer.c md5.c data_fastcgi.c \
- fdevent_select.c fdevent_libev.c fdevent_poll.c \
+ fdevent_select.c fdevent_linux_rtsig.c fdevent_poll.c \
fdevent_linux_sysepoll.c fdevent_solaris_devpoll.c \
- fdevent_solaris_port.c fdevent_freebsd_kqueue.c data_config.c \
- bitset.c inet_ntop_cache.c crc32.c connections-glue.c \
- configfile-glue.c http-header-glue.c network_write.c \
- network_linux_sendfile.c network_freebsd_sendfile.c \
- network_writev.c network_solaris_sendfilev.c network_openssl.c \
- splaytree.c status_counter.c
+ fdevent_freebsd_kqueue.c data_config.c bitset.c \
+ inet_ntop_cache.c crc32.c connections-glue.c configfile-glue.c \
+ http-header-glue.c network_write.c network_linux_sendfile.c \
+ network_freebsd_sendfile.c network_writev.c \
+ network_solaris_sendfilev.c network_openssl.c splaytree.c
am__objects_1 = liblightcomp_la-buffer.lo liblightcomp_la-log.lo \
liblightcomp_la-keyvalue.lo liblightcomp_la-chunk.lo \
liblightcomp_la-http_chunk.lo liblightcomp_la-stream.lo \
@@ -114,11 +95,10 @@ am__objects_1 = liblightcomp_la-buffer.lo liblightcomp_la-log.lo \
liblightcomp_la-data_array.lo liblightcomp_la-data_integer.lo \
liblightcomp_la-md5.lo liblightcomp_la-data_fastcgi.lo \
liblightcomp_la-fdevent_select.lo \
- liblightcomp_la-fdevent_libev.lo \
+ liblightcomp_la-fdevent_linux_rtsig.lo \
liblightcomp_la-fdevent_poll.lo \
liblightcomp_la-fdevent_linux_sysepoll.lo \
liblightcomp_la-fdevent_solaris_devpoll.lo \
- liblightcomp_la-fdevent_solaris_port.lo \
liblightcomp_la-fdevent_freebsd_kqueue.lo \
liblightcomp_la-data_config.lo liblightcomp_la-bitset.lo \
liblightcomp_la-inet_ntop_cache.lo liblightcomp_la-crc32.lo \
@@ -131,244 +111,110 @@ am__objects_1 = liblightcomp_la-buffer.lo liblightcomp_la-log.lo \
liblightcomp_la-network_writev.lo \
liblightcomp_la-network_solaris_sendfilev.lo \
liblightcomp_la-network_openssl.lo \
- liblightcomp_la-splaytree.lo liblightcomp_la-status_counter.lo
+ liblightcomp_la-splaytree.lo
@NO_RDYNAMIC_TRUE@am_liblightcomp_la_OBJECTS = $(am__objects_1)
liblightcomp_la_OBJECTS = $(am_liblightcomp_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-liblightcomp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(liblightcomp_la_CFLAGS) $(CFLAGS) $(liblightcomp_la_LDFLAGS) \
- $(LDFLAGS) -o $@
@NO_RDYNAMIC_TRUE@am_liblightcomp_la_rpath = -rpath $(libdir)
@NO_RDYNAMIC_TRUE@am__DEPENDENCIES_2 = liblightcomp.la
mod_access_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_access_la_OBJECTS = mod_access.lo
mod_access_la_OBJECTS = $(am_mod_access_la_OBJECTS)
-mod_access_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(mod_access_la_LDFLAGS) $(LDFLAGS) -o $@
mod_accesslog_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_accesslog_la_OBJECTS = mod_accesslog.lo
mod_accesslog_la_OBJECTS = $(am_mod_accesslog_la_OBJECTS)
-mod_accesslog_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_accesslog_la_LDFLAGS) $(LDFLAGS) \
- -o $@
mod_alias_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_alias_la_OBJECTS = mod_alias.lo
mod_alias_la_OBJECTS = $(am_mod_alias_la_OBJECTS)
-mod_alias_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(mod_alias_la_LDFLAGS) $(LDFLAGS) -o $@
mod_auth_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
-am_mod_auth_la_OBJECTS = mod_auth.lo http_auth.lo
+am_mod_auth_la_OBJECTS = mod_auth.lo http_auth_digest.lo http_auth.lo
mod_auth_la_OBJECTS = $(am_mod_auth_la_OBJECTS)
-mod_auth_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(mod_auth_la_LDFLAGS) $(LDFLAGS) -o $@
mod_cgi_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_cgi_la_OBJECTS = mod_cgi.lo
mod_cgi_la_OBJECTS = $(am_mod_cgi_la_OBJECTS)
-mod_cgi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(mod_cgi_la_LDFLAGS) $(LDFLAGS) -o $@
mod_cml_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
$(am__DEPENDENCIES_1)
am_mod_cml_la_OBJECTS = mod_cml_la-mod_cml.lo \
mod_cml_la-mod_cml_lua.lo mod_cml_la-mod_cml_funcs.lo
mod_cml_la_OBJECTS = $(am_mod_cml_la_OBJECTS)
-mod_cml_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mod_cml_la_CFLAGS) \
- $(CFLAGS) $(mod_cml_la_LDFLAGS) $(LDFLAGS) -o $@
mod_compress_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
am_mod_compress_la_OBJECTS = mod_compress.lo
mod_compress_la_OBJECTS = $(am_mod_compress_la_OBJECTS)
-mod_compress_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_compress_la_LDFLAGS) $(LDFLAGS) \
- -o $@
mod_dirlisting_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \
$(am__DEPENDENCIES_1)
am_mod_dirlisting_la_OBJECTS = mod_dirlisting.lo
mod_dirlisting_la_OBJECTS = $(am_mod_dirlisting_la_OBJECTS)
-mod_dirlisting_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_dirlisting_la_LDFLAGS) $(LDFLAGS) \
- -o $@
-mod_evasive_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
-am_mod_evasive_la_OBJECTS = mod_evasive.lo
-mod_evasive_la_OBJECTS = $(am_mod_evasive_la_OBJECTS)
-mod_evasive_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_evasive_la_LDFLAGS) $(LDFLAGS) -o \
- $@
mod_evhost_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_evhost_la_OBJECTS = mod_evhost.lo
mod_evhost_la_OBJECTS = $(am_mod_evhost_la_OBJECTS)
-mod_evhost_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(mod_evhost_la_LDFLAGS) $(LDFLAGS) -o $@
mod_expire_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_expire_la_OBJECTS = mod_expire.lo
mod_expire_la_OBJECTS = $(am_mod_expire_la_OBJECTS)
-mod_expire_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(mod_expire_la_LDFLAGS) $(LDFLAGS) -o $@
-mod_extforward_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
-am_mod_extforward_la_OBJECTS = mod_extforward.lo
-mod_extforward_la_OBJECTS = $(am_mod_extforward_la_OBJECTS)
-mod_extforward_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_extforward_la_LDFLAGS) $(LDFLAGS) \
- -o $@
mod_fastcgi_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_fastcgi_la_OBJECTS = mod_fastcgi.lo
mod_fastcgi_la_OBJECTS = $(am_mod_fastcgi_la_OBJECTS)
-mod_fastcgi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_fastcgi_la_LDFLAGS) $(LDFLAGS) -o \
- $@
-mod_flv_streaming_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
-am_mod_flv_streaming_la_OBJECTS = mod_flv_streaming.lo
-mod_flv_streaming_la_OBJECTS = $(am_mod_flv_streaming_la_OBJECTS)
-mod_flv_streaming_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_flv_streaming_la_LDFLAGS) \
- $(LDFLAGS) -o $@
mod_indexfile_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_indexfile_la_OBJECTS = mod_indexfile.lo
mod_indexfile_la_OBJECTS = $(am_mod_indexfile_la_OBJECTS)
-mod_indexfile_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_indexfile_la_LDFLAGS) $(LDFLAGS) \
- -o $@
-mod_magnet_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \
- $(am__DEPENDENCIES_1)
-am_mod_magnet_la_OBJECTS = mod_magnet_la-mod_magnet.lo \
- mod_magnet_la-mod_magnet_cache.lo
-mod_magnet_la_OBJECTS = $(am_mod_magnet_la_OBJECTS)
-mod_magnet_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mod_magnet_la_CFLAGS) \
- $(CFLAGS) $(mod_magnet_la_LDFLAGS) $(LDFLAGS) -o $@
mod_mysql_vhost_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2)
am_mod_mysql_vhost_la_OBJECTS = mod_mysql_vhost_la-mod_mysql_vhost.lo
mod_mysql_vhost_la_OBJECTS = $(am_mod_mysql_vhost_la_OBJECTS)
-mod_mysql_vhost_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_mysql_vhost_la_LDFLAGS) \
- $(LDFLAGS) -o $@
mod_proxy_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_proxy_la_OBJECTS = mod_proxy.lo
mod_proxy_la_OBJECTS = $(am_mod_proxy_la_OBJECTS)
-mod_proxy_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(mod_proxy_la_LDFLAGS) $(LDFLAGS) -o $@
mod_redirect_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2)
am_mod_redirect_la_OBJECTS = mod_redirect.lo
mod_redirect_la_OBJECTS = $(am_mod_redirect_la_OBJECTS)
-mod_redirect_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_redirect_la_LDFLAGS) $(LDFLAGS) \
- -o $@
mod_rewrite_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2)
am_mod_rewrite_la_OBJECTS = mod_rewrite.lo
mod_rewrite_la_OBJECTS = $(am_mod_rewrite_la_OBJECTS)
-mod_rewrite_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_rewrite_la_LDFLAGS) $(LDFLAGS) -o \
- $@
mod_rrdtool_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_rrdtool_la_OBJECTS = mod_rrdtool.lo
mod_rrdtool_la_OBJECTS = $(am_mod_rrdtool_la_OBJECTS)
-mod_rrdtool_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_rrdtool_la_LDFLAGS) $(LDFLAGS) -o \
- $@
mod_scgi_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_scgi_la_OBJECTS = mod_scgi.lo
mod_scgi_la_OBJECTS = $(am_mod_scgi_la_OBJECTS)
-mod_scgi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(mod_scgi_la_LDFLAGS) $(LDFLAGS) -o $@
mod_secdownload_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_secdownload_la_OBJECTS = mod_secure_download.lo
mod_secdownload_la_OBJECTS = $(am_mod_secdownload_la_OBJECTS)
-mod_secdownload_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_secdownload_la_LDFLAGS) \
- $(LDFLAGS) -o $@
mod_setenv_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_setenv_la_OBJECTS = mod_setenv.lo
mod_setenv_la_OBJECTS = $(am_mod_setenv_la_OBJECTS)
-mod_setenv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(mod_setenv_la_LDFLAGS) $(LDFLAGS) -o $@
mod_simple_vhost_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_simple_vhost_la_OBJECTS = mod_simple_vhost.lo
mod_simple_vhost_la_OBJECTS = $(am_mod_simple_vhost_la_OBJECTS)
-mod_simple_vhost_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_simple_vhost_la_LDFLAGS) \
- $(LDFLAGS) -o $@
mod_ssi_la_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
am_mod_ssi_la_OBJECTS = mod_ssi_exprparser.lo mod_ssi_expr.lo \
mod_ssi.lo
mod_ssi_la_OBJECTS = $(am_mod_ssi_la_OBJECTS)
-mod_ssi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(mod_ssi_la_LDFLAGS) $(LDFLAGS) -o $@
mod_staticfile_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_staticfile_la_OBJECTS = mod_staticfile.lo
mod_staticfile_la_OBJECTS = $(am_mod_staticfile_la_OBJECTS)
-mod_staticfile_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_staticfile_la_LDFLAGS) $(LDFLAGS) \
- -o $@
mod_status_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_status_la_OBJECTS = mod_status.lo
mod_status_la_OBJECTS = $(am_mod_status_la_OBJECTS)
-mod_status_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(mod_status_la_LDFLAGS) $(LDFLAGS) -o $@
mod_trigger_b4_dl_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2)
am_mod_trigger_b4_dl_la_OBJECTS = mod_trigger_b4_dl.lo
mod_trigger_b4_dl_la_OBJECTS = $(am_mod_trigger_b4_dl_la_OBJECTS)
-mod_trigger_b4_dl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_trigger_b4_dl_la_LDFLAGS) \
- $(LDFLAGS) -o $@
mod_userdir_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_userdir_la_OBJECTS = mod_userdir.lo
mod_userdir_la_OBJECTS = $(am_mod_userdir_la_OBJECTS)
-mod_userdir_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_userdir_la_LDFLAGS) $(LDFLAGS) -o \
- $@
mod_usertrack_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_mod_usertrack_la_OBJECTS = mod_usertrack.lo
mod_usertrack_la_OBJECTS = $(am_mod_usertrack_la_OBJECTS)
-mod_usertrack_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(mod_usertrack_la_LDFLAGS) $(LDFLAGS) \
- -o $@
mod_webdav_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
am_mod_webdav_la_OBJECTS = mod_webdav_la-mod_webdav.lo
mod_webdav_la_OBJECTS = $(am_mod_webdav_la_OBJECTS)
-mod_webdav_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mod_webdav_la_CFLAGS) \
- $(CFLAGS) $(mod_webdav_la_LDFLAGS) $(LDFLAGS) -o $@
-PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS)
am_lemon_OBJECTS = lemon.$(OBJEXT)
lemon_OBJECTS = $(am_lemon_OBJECTS)
lemon_LDADD = $(LDADD)
@@ -377,14 +223,14 @@ am__lighttpd_SOURCES_DIST = server.c response.c connections.c \
buffer.c log.c keyvalue.c chunk.c http_chunk.c stream.c \
fdevent.c stat_cache.c plugin.c joblist.c etag.c array.c \
data_string.c data_count.c data_array.c data_integer.c md5.c \
- data_fastcgi.c fdevent_select.c fdevent_libev.c fdevent_poll.c \
- fdevent_linux_sysepoll.c fdevent_solaris_devpoll.c \
- fdevent_solaris_port.c fdevent_freebsd_kqueue.c data_config.c \
- bitset.c inet_ntop_cache.c crc32.c connections-glue.c \
- configfile-glue.c http-header-glue.c network_write.c \
- network_linux_sendfile.c network_freebsd_sendfile.c \
- network_writev.c network_solaris_sendfilev.c network_openssl.c \
- splaytree.c status_counter.c
+ data_fastcgi.c fdevent_select.c fdevent_linux_rtsig.c \
+ fdevent_poll.c fdevent_linux_sysepoll.c \
+ fdevent_solaris_devpoll.c fdevent_freebsd_kqueue.c \
+ data_config.c bitset.c inet_ntop_cache.c crc32.c \
+ connections-glue.c configfile-glue.c http-header-glue.c \
+ network_write.c network_linux_sendfile.c \
+ network_freebsd_sendfile.c network_writev.c \
+ network_solaris_sendfilev.c network_openssl.c splaytree.c
am__objects_2 = buffer.$(OBJEXT) log.$(OBJEXT) keyvalue.$(OBJEXT) \
chunk.$(OBJEXT) http_chunk.$(OBJEXT) stream.$(OBJEXT) \
fdevent.$(OBJEXT) stat_cache.$(OBJEXT) plugin.$(OBJEXT) \
@@ -392,10 +238,9 @@ am__objects_2 = buffer.$(OBJEXT) log.$(OBJEXT) keyvalue.$(OBJEXT) \
data_string.$(OBJEXT) data_count.$(OBJEXT) \
data_array.$(OBJEXT) data_integer.$(OBJEXT) md5.$(OBJEXT) \
data_fastcgi.$(OBJEXT) fdevent_select.$(OBJEXT) \
- fdevent_libev.$(OBJEXT) fdevent_poll.$(OBJEXT) \
+ fdevent_linux_rtsig.$(OBJEXT) fdevent_poll.$(OBJEXT) \
fdevent_linux_sysepoll.$(OBJEXT) \
fdevent_solaris_devpoll.$(OBJEXT) \
- fdevent_solaris_port.$(OBJEXT) \
fdevent_freebsd_kqueue.$(OBJEXT) data_config.$(OBJEXT) \
bitset.$(OBJEXT) inet_ntop_cache.$(OBJEXT) crc32.$(OBJEXT) \
connections-glue.$(OBJEXT) configfile-glue.$(OBJEXT) \
@@ -403,7 +248,7 @@ am__objects_2 = buffer.$(OBJEXT) log.$(OBJEXT) keyvalue.$(OBJEXT) \
network_linux_sendfile.$(OBJEXT) \
network_freebsd_sendfile.$(OBJEXT) network_writev.$(OBJEXT) \
network_solaris_sendfilev.$(OBJEXT) network_openssl.$(OBJEXT) \
- splaytree.$(OBJEXT) status_counter.$(OBJEXT)
+ splaytree.$(OBJEXT)
@NO_RDYNAMIC_FALSE@am__objects_3 = $(am__objects_2)
am__objects_4 = server.$(OBJEXT) response.$(OBJEXT) \
connections.$(OBJEXT) network.$(OBJEXT) configfile.$(OBJEXT) \
@@ -414,52 +259,32 @@ lighttpd_OBJECTS = $(am_lighttpd_OBJECTS)
lighttpd_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-lighttpd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(lighttpd_LDFLAGS) $(LDFLAGS) -o $@
-am_lighttpd_angel_OBJECTS = lighttpd-angel.$(OBJEXT)
-lighttpd_angel_OBJECTS = $(am_lighttpd_angel_OBJECTS)
-lighttpd_angel_LDADD = $(LDADD)
+ $(am__DEPENDENCIES_1)
am_proc_open_OBJECTS = proc_open-proc_open.$(OBJEXT) \
proc_open-buffer.$(OBJEXT)
proc_open_OBJECTS = $(am_proc_open_OBJECTS)
proc_open_LDADD = $(LDADD)
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+am_spawn_fcgi_OBJECTS = spawn-fcgi.$(OBJEXT)
+spawn_fcgi_OBJECTS = $(am_spawn_fcgi_OBJECTS)
+spawn_fcgi_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
-am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
SOURCES = $(liblightcomp_la_SOURCES) $(mod_access_la_SOURCES) \
$(mod_accesslog_la_SOURCES) $(mod_alias_la_SOURCES) \
$(mod_auth_la_SOURCES) $(mod_cgi_la_SOURCES) \
$(mod_cml_la_SOURCES) $(mod_compress_la_SOURCES) \
- $(mod_dirlisting_la_SOURCES) $(mod_evasive_la_SOURCES) \
- $(mod_evhost_la_SOURCES) $(mod_expire_la_SOURCES) \
- $(mod_extforward_la_SOURCES) $(mod_fastcgi_la_SOURCES) \
- $(mod_flv_streaming_la_SOURCES) $(mod_indexfile_la_SOURCES) \
- $(mod_magnet_la_SOURCES) $(mod_mysql_vhost_la_SOURCES) \
+ $(mod_dirlisting_la_SOURCES) $(mod_evhost_la_SOURCES) \
+ $(mod_expire_la_SOURCES) $(mod_fastcgi_la_SOURCES) \
+ $(mod_indexfile_la_SOURCES) $(mod_mysql_vhost_la_SOURCES) \
$(mod_proxy_la_SOURCES) $(mod_redirect_la_SOURCES) \
$(mod_rewrite_la_SOURCES) $(mod_rrdtool_la_SOURCES) \
$(mod_scgi_la_SOURCES) $(mod_secdownload_la_SOURCES) \
@@ -468,16 +293,14 @@ SOURCES = $(liblightcomp_la_SOURCES) $(mod_access_la_SOURCES) \
$(mod_status_la_SOURCES) $(mod_trigger_b4_dl_la_SOURCES) \
$(mod_userdir_la_SOURCES) $(mod_usertrack_la_SOURCES) \
$(mod_webdav_la_SOURCES) $(lemon_SOURCES) $(lighttpd_SOURCES) \
- $(lighttpd_angel_SOURCES) $(proc_open_SOURCES)
+ $(proc_open_SOURCES) $(spawn_fcgi_SOURCES)
DIST_SOURCES = $(am__liblightcomp_la_SOURCES_DIST) \
$(mod_access_la_SOURCES) $(mod_accesslog_la_SOURCES) \
$(mod_alias_la_SOURCES) $(mod_auth_la_SOURCES) \
$(mod_cgi_la_SOURCES) $(mod_cml_la_SOURCES) \
$(mod_compress_la_SOURCES) $(mod_dirlisting_la_SOURCES) \
- $(mod_evasive_la_SOURCES) $(mod_evhost_la_SOURCES) \
- $(mod_expire_la_SOURCES) $(mod_extforward_la_SOURCES) \
- $(mod_fastcgi_la_SOURCES) $(mod_flv_streaming_la_SOURCES) \
- $(mod_indexfile_la_SOURCES) $(mod_magnet_la_SOURCES) \
+ $(mod_evhost_la_SOURCES) $(mod_expire_la_SOURCES) \
+ $(mod_fastcgi_la_SOURCES) $(mod_indexfile_la_SOURCES) \
$(mod_mysql_vhost_la_SOURCES) $(mod_proxy_la_SOURCES) \
$(mod_redirect_la_SOURCES) $(mod_rewrite_la_SOURCES) \
$(mod_rrdtool_la_SOURCES) $(mod_scgi_la_SOURCES) \
@@ -487,14 +310,15 @@ DIST_SOURCES = $(am__liblightcomp_la_SOURCES_DIST) \
$(mod_trigger_b4_dl_la_SOURCES) $(mod_userdir_la_SOURCES) \
$(mod_usertrack_la_SOURCES) $(mod_webdav_la_SOURCES) \
$(lemon_SOURCES) $(am__lighttpd_SOURCES_DIST) \
- $(lighttpd_angel_SOURCES) $(proc_open_SOURCES)
+ $(proc_open_SOURCES) $(spawn_fcgi_SOURCES)
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ATTR_LIB = @ATTR_LIB@
AUTOCONF = @AUTOCONF@
@@ -505,73 +329,69 @@ BZ_LIB = @BZ_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@
+CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
+CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
CRYPT_LIB = @CRYPT_LIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@ -DHAVE_VERSION_H -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
+DEFS = @DEFS@ -DLIBRARY_DIR="\"$(libdir)\""
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
+ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
FAM_CFLAGS = @FAM_CFLAGS@
FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
+FFLAGS = @FFLAGS@
GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LBER_LIB = @LBER_LIB@
-LD = @LD@
LDAP_LIB = @LDAP_LIB@
LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LUACONFIG = @LUACONFIG@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
+NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@
+NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@
OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
PCRE_LIB = @PCRE_LIB@
PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
-SED = @SED@
SENDFILE_LIB = @SENDFILE_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -580,18 +400,20 @@ SQLITE_LIBS = @SQLITE_LIBS@
SSL_LIB = @SSL_LIB@
STRIP = @STRIP@
U = @U@
-UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -603,61 +425,43 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
-builddir = @builddir@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
-localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CFLAGS = $(FAM_CFLAGS)
-LEMON = $(top_builddir)/src/lemon$(EXEEXT)
+LEMON = $(top_builddir)/src/lemon
lemon_SOURCES = lemon.c
-lighttpd_angel_SOURCES = lighttpd-angel.c
-BUILT_SOURCES = parsers versionstamp
-MAINTAINERCLEANFILES = configparser.c configparser.h mod_ssi_exprparser.c mod_ssi_exprparser.h
-CLEANFILES = versionstamp.h versionstamp.h.tmp
common_src = buffer.c log.c \
keyvalue.c chunk.c \
http_chunk.c stream.c fdevent.c \
stat_cache.c plugin.c joblist.c etag.c array.c \
data_string.c data_count.c data_array.c \
data_integer.c md5.c data_fastcgi.c \
- fdevent_select.c fdevent_libev.c \
+ fdevent_select.c fdevent_linux_rtsig.c \
fdevent_poll.c fdevent_linux_sysepoll.c \
- fdevent_solaris_devpoll.c fdevent_solaris_port.c \
- fdevent_freebsd_kqueue.c \
+ fdevent_solaris_devpoll.c fdevent_freebsd_kqueue.c \
data_config.c bitset.c \
inet_ntop_cache.c crc32.c \
connections-glue.c \
@@ -666,44 +470,34 @@ common_src = buffer.c log.c \
network_write.c network_linux_sendfile.c \
network_freebsd_sendfile.c network_writev.c \
network_solaris_sendfilev.c network_openssl.c \
- splaytree.c status_counter.c
+ splaytree.c
src = server.c response.c connections.c network.c configfile.c \
configparser.c request.c proc_open.c $(am__append_2)
+spawn_fcgi_SOURCES = spawn-fcgi.c
#lib_LTLIBRARIES += mod_httptls.la
#mod_httptls_la_SOURCES = mod_httptls.c
#mod_httptls_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
#mod_httptls_la_LIBADD = $(common_libadd)
-lib_LTLIBRARIES = $(am__append_1) mod_flv_streaming.la mod_evasive.la \
- mod_webdav.la mod_magnet.la mod_cml.la mod_trigger_b4_dl.la \
- mod_mysql_vhost.la mod_cgi.la mod_scgi.la mod_staticfile.la \
- mod_dirlisting.la mod_indexfile.la mod_setenv.la mod_alias.la \
- mod_userdir.la mod_rrdtool.la mod_usertrack.la mod_proxy.la \
- mod_ssi.la mod_secdownload.la mod_expire.la mod_evhost.la \
- mod_simple_vhost.la mod_fastcgi.la mod_extforward.la \
+lib_LTLIBRARIES = $(am__append_1) mod_webdav.la mod_cml.la \
+ mod_trigger_b4_dl.la mod_mysql_vhost.la mod_cgi.la mod_scgi.la \
+ mod_staticfile.la mod_dirlisting.la mod_indexfile.la \
+ mod_setenv.la mod_alias.la mod_userdir.la mod_rrdtool.la \
+ mod_usertrack.la mod_proxy.la mod_ssi.la mod_secdownload.la \
+ mod_expire.la mod_evhost.la mod_simple_vhost.la mod_fastcgi.la \
mod_access.la mod_compress.la mod_auth.la mod_rewrite.la \
mod_redirect.la mod_status.la mod_accesslog.la
@NO_RDYNAMIC_TRUE@liblightcomp_la_SOURCES = $(common_src)
-@NO_RDYNAMIC_TRUE@liblightcomp_la_CFLAGS = $(AM_CFLAGS) $(LIBEV_CFLAGS)
+@NO_RDYNAMIC_TRUE@liblightcomp_la_CFLAGS = $(AM_CFLAGS) $(FAM_CFLAGS)
@NO_RDYNAMIC_TRUE@liblightcomp_la_LDFLAGS = -avoid-version -no-undefined
-@NO_RDYNAMIC_TRUE@liblightcomp_la_LIBADD = $(PCRE_LIB) $(SSL_LIB) $(FAM_LIBS) $(LIBEV_LIBS)
+@NO_RDYNAMIC_TRUE@liblightcomp_la_LIBADD = $(PCRE_LIB) $(SSL_LIB) $(FAM_LIBS)
@NO_RDYNAMIC_FALSE@common_libadd =
@NO_RDYNAMIC_TRUE@common_libadd = liblightcomp.la
-mod_flv_streaming_la_SOURCES = mod_flv_streaming.c
-mod_flv_streaming_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
-mod_flv_streaming_la_LIBADD = $(common_libadd)
-mod_evasive_la_SOURCES = mod_evasive.c
-mod_evasive_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
-mod_evasive_la_LIBADD = $(common_libadd)
mod_webdav_la_SOURCES = mod_webdav.c
-mod_webdav_la_CFLAGS = $(AM_CFLAGS) $(XML_CFLAGS) $(SQLITE_CFLAGS)
+mod_webdav_la_CFLAGS = $(XML_CFLAGS)
mod_webdav_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
-mod_webdav_la_LIBADD = $(common_libadd) $(XML_LIBS) $(SQLITE_LIBS) $(UUID_LIBS)
-mod_magnet_la_SOURCES = mod_magnet.c mod_magnet_cache.c
-mod_magnet_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
-mod_magnet_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
-mod_magnet_la_LIBADD = $(common_libadd) $(LUA_LIBS) -lm
+mod_webdav_la_LIBADD = $(common_libadd) $(XML_LIBS) $(SQLITE_LIBS)
mod_cml_la_SOURCES = mod_cml.c mod_cml_lua.c mod_cml_funcs.c
mod_cml_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
mod_cml_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
@@ -715,28 +509,28 @@ mod_mysql_vhost_la_SOURCES = mod_mysql_vhost.c
mod_mysql_vhost_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_mysql_vhost_la_LIBADD = $(MYSQL_LIBS) $(common_libadd)
mod_mysql_vhost_la_CPPFLAGS = $(MYSQL_INCLUDE)
-mod_cgi_la_SOURCES = mod_cgi.c
+mod_cgi_la_SOURCES = mod_cgi.c
mod_cgi_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_cgi_la_LIBADD = $(common_libadd)
-mod_scgi_la_SOURCES = mod_scgi.c
+mod_scgi_la_SOURCES = mod_scgi.c
mod_scgi_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_scgi_la_LIBADD = $(common_libadd)
-mod_staticfile_la_SOURCES = mod_staticfile.c
+mod_staticfile_la_SOURCES = mod_staticfile.c
mod_staticfile_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_staticfile_la_LIBADD = $(common_libadd)
-mod_dirlisting_la_SOURCES = mod_dirlisting.c
+mod_dirlisting_la_SOURCES = mod_dirlisting.c
mod_dirlisting_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_dirlisting_la_LIBADD = $(common_libadd) $(PCRE_LIB)
-mod_indexfile_la_SOURCES = mod_indexfile.c
+mod_indexfile_la_SOURCES = mod_indexfile.c
mod_indexfile_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_indexfile_la_LIBADD = $(common_libadd)
-mod_setenv_la_SOURCES = mod_setenv.c
+mod_setenv_la_SOURCES = mod_setenv.c
mod_setenv_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_setenv_la_LIBADD = $(common_libadd)
-mod_alias_la_SOURCES = mod_alias.c
+mod_alias_la_SOURCES = mod_alias.c
mod_alias_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_alias_la_LIBADD = $(common_libadd)
-mod_userdir_la_SOURCES = mod_userdir.c
+mod_userdir_la_SOURCES = mod_userdir.c
mod_userdir_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_userdir_la_LIBADD = $(common_libadd)
mod_rrdtool_la_SOURCES = mod_rrdtool.c
@@ -748,7 +542,7 @@ mod_usertrack_la_LIBADD = $(common_libadd)
mod_proxy_la_SOURCES = mod_proxy.c
mod_proxy_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_proxy_la_LIBADD = $(common_libadd)
-mod_ssi_la_SOURCES = mod_ssi_exprparser.c mod_ssi_expr.c mod_ssi.c
+mod_ssi_la_SOURCES = mod_ssi_exprparser.c mod_ssi_expr.c mod_ssi.c
mod_ssi_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_ssi_la_LIBADD = $(common_libadd) $(PCRE_LIB)
mod_secdownload_la_SOURCES = mod_secure_download.c
@@ -766,16 +560,13 @@ mod_simple_vhost_la_LIBADD = $(common_libadd)
mod_fastcgi_la_SOURCES = mod_fastcgi.c
mod_fastcgi_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_fastcgi_la_LIBADD = $(common_libadd)
-mod_extforward_la_SOURCES = mod_extforward.c
-mod_extforward_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
-mod_extforward_la_LIBADD = $(common_libadd)
mod_access_la_SOURCES = mod_access.c
mod_access_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_access_la_LIBADD = $(common_libadd)
-mod_compress_la_SOURCES = mod_compress.c
+mod_compress_la_SOURCES = mod_compress.c
mod_compress_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_compress_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)
-mod_auth_la_SOURCES = mod_auth.c http_auth.c
+mod_auth_la_SOURCES = mod_auth.c http_auth_digest.c http_auth.c
mod_auth_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_auth_la_LIBADD = $(CRYPT_LIB) $(LDAP_LIB) $(LBER_LIB) $(common_libadd)
mod_rewrite_la_SOURCES = mod_rewrite.c
@@ -792,7 +583,7 @@ mod_accesslog_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_accesslog_la_LIBADD = $(common_libadd)
hdr = server.h buffer.h network.h log.h keyvalue.h \
response.h request.h fastcgi.h chunk.h \
- settings.h http_chunk.h \
+ settings.h http_chunk.h http_auth_digest.h \
md5.h http_auth.h stream.h \
fdevent.h connections.h base.h stat_cache.h \
plugin.h mod_auth.h \
@@ -801,14 +592,12 @@ hdr = server.h buffer.h network.h log.h keyvalue.h \
mod_ssi.h mod_ssi_expr.h inet_ntop_cache.h \
configparser.h mod_ssi_exprparser.h \
sys-mmap.h sys-socket.h mod_cml.h mod_cml_funcs.h \
- splaytree.h proc_open.h status_counter.h \
- mod_magnet_cache.h \
- version.h
+ splaytree.h proc_open.h
lighttpd_SOURCES = $(src)
-lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(SSL_LIB) $(FAM_LIBS) $(LIBEV_LIBS)
+lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(SSL_LIB) $(FAM_LIBS)
lighttpd_LDFLAGS = -export-dynamic
-lighttpd_CCPFLAGS = $(FAM_CFLAGS) $(LIBEV_CFLAGS)
+lighttpd_CCPFLAGS = $(FAM_CFLAGS)
proc_open_SOURCES = proc_open.c buffer.c
proc_open_CPPFLAGS = -DDEBUG_PROC_OPEN
@@ -825,24 +614,23 @@ proc_open_CPPFLAGS = -DDEBUG_PROC_OPEN
#bench_SOURCES = buffer.c bench.c
#ajp_SOURCES = ajp.c
noinst_HEADERS = $(hdr)
-EXTRA_DIST = mod_skeleton.c configparser.y mod_ssi_exprparser.y lempar.c SConscript
-all: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) all-am
+EXTRA_DIST = mod_skeleton.c configparser.y mod_ssi_exprparser.y lempar.c
+all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -856,32 +644,27 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
- test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
- list2=; for p in $$list; do \
+ test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
- list2="$$list2 $$p"; \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
- done; \
- test -z "$$list2" || { \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
- }
+ done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+ @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
@@ -892,136 +675,139 @@ clean-libLTLIBRARIES:
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
-liblightcomp.la: $(liblightcomp_la_OBJECTS) $(liblightcomp_la_DEPENDENCIES) $(EXTRA_liblightcomp_la_DEPENDENCIES)
- $(AM_V_CCLD)$(liblightcomp_la_LINK) $(am_liblightcomp_la_rpath) $(liblightcomp_la_OBJECTS) $(liblightcomp_la_LIBADD) $(LIBS)
-mod_access.la: $(mod_access_la_OBJECTS) $(mod_access_la_DEPENDENCIES) $(EXTRA_mod_access_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_access_la_LINK) -rpath $(libdir) $(mod_access_la_OBJECTS) $(mod_access_la_LIBADD) $(LIBS)
-mod_accesslog.la: $(mod_accesslog_la_OBJECTS) $(mod_accesslog_la_DEPENDENCIES) $(EXTRA_mod_accesslog_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_accesslog_la_LINK) -rpath $(libdir) $(mod_accesslog_la_OBJECTS) $(mod_accesslog_la_LIBADD) $(LIBS)
-mod_alias.la: $(mod_alias_la_OBJECTS) $(mod_alias_la_DEPENDENCIES) $(EXTRA_mod_alias_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_alias_la_LINK) -rpath $(libdir) $(mod_alias_la_OBJECTS) $(mod_alias_la_LIBADD) $(LIBS)
-mod_auth.la: $(mod_auth_la_OBJECTS) $(mod_auth_la_DEPENDENCIES) $(EXTRA_mod_auth_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_auth_la_LINK) -rpath $(libdir) $(mod_auth_la_OBJECTS) $(mod_auth_la_LIBADD) $(LIBS)
-mod_cgi.la: $(mod_cgi_la_OBJECTS) $(mod_cgi_la_DEPENDENCIES) $(EXTRA_mod_cgi_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_cgi_la_LINK) -rpath $(libdir) $(mod_cgi_la_OBJECTS) $(mod_cgi_la_LIBADD) $(LIBS)
-mod_cml.la: $(mod_cml_la_OBJECTS) $(mod_cml_la_DEPENDENCIES) $(EXTRA_mod_cml_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_cml_la_LINK) -rpath $(libdir) $(mod_cml_la_OBJECTS) $(mod_cml_la_LIBADD) $(LIBS)
-mod_compress.la: $(mod_compress_la_OBJECTS) $(mod_compress_la_DEPENDENCIES) $(EXTRA_mod_compress_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_compress_la_LINK) -rpath $(libdir) $(mod_compress_la_OBJECTS) $(mod_compress_la_LIBADD) $(LIBS)
-mod_dirlisting.la: $(mod_dirlisting_la_OBJECTS) $(mod_dirlisting_la_DEPENDENCIES) $(EXTRA_mod_dirlisting_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_dirlisting_la_LINK) -rpath $(libdir) $(mod_dirlisting_la_OBJECTS) $(mod_dirlisting_la_LIBADD) $(LIBS)
-mod_evasive.la: $(mod_evasive_la_OBJECTS) $(mod_evasive_la_DEPENDENCIES) $(EXTRA_mod_evasive_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_evasive_la_LINK) -rpath $(libdir) $(mod_evasive_la_OBJECTS) $(mod_evasive_la_LIBADD) $(LIBS)
-mod_evhost.la: $(mod_evhost_la_OBJECTS) $(mod_evhost_la_DEPENDENCIES) $(EXTRA_mod_evhost_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_evhost_la_LINK) -rpath $(libdir) $(mod_evhost_la_OBJECTS) $(mod_evhost_la_LIBADD) $(LIBS)
-mod_expire.la: $(mod_expire_la_OBJECTS) $(mod_expire_la_DEPENDENCIES) $(EXTRA_mod_expire_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_expire_la_LINK) -rpath $(libdir) $(mod_expire_la_OBJECTS) $(mod_expire_la_LIBADD) $(LIBS)
-mod_extforward.la: $(mod_extforward_la_OBJECTS) $(mod_extforward_la_DEPENDENCIES) $(EXTRA_mod_extforward_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_extforward_la_LINK) -rpath $(libdir) $(mod_extforward_la_OBJECTS) $(mod_extforward_la_LIBADD) $(LIBS)
-mod_fastcgi.la: $(mod_fastcgi_la_OBJECTS) $(mod_fastcgi_la_DEPENDENCIES) $(EXTRA_mod_fastcgi_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_fastcgi_la_LINK) -rpath $(libdir) $(mod_fastcgi_la_OBJECTS) $(mod_fastcgi_la_LIBADD) $(LIBS)
-mod_flv_streaming.la: $(mod_flv_streaming_la_OBJECTS) $(mod_flv_streaming_la_DEPENDENCIES) $(EXTRA_mod_flv_streaming_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_flv_streaming_la_LINK) -rpath $(libdir) $(mod_flv_streaming_la_OBJECTS) $(mod_flv_streaming_la_LIBADD) $(LIBS)
-mod_indexfile.la: $(mod_indexfile_la_OBJECTS) $(mod_indexfile_la_DEPENDENCIES) $(EXTRA_mod_indexfile_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_indexfile_la_LINK) -rpath $(libdir) $(mod_indexfile_la_OBJECTS) $(mod_indexfile_la_LIBADD) $(LIBS)
-mod_magnet.la: $(mod_magnet_la_OBJECTS) $(mod_magnet_la_DEPENDENCIES) $(EXTRA_mod_magnet_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_magnet_la_LINK) -rpath $(libdir) $(mod_magnet_la_OBJECTS) $(mod_magnet_la_LIBADD) $(LIBS)
-mod_mysql_vhost.la: $(mod_mysql_vhost_la_OBJECTS) $(mod_mysql_vhost_la_DEPENDENCIES) $(EXTRA_mod_mysql_vhost_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_mysql_vhost_la_LINK) -rpath $(libdir) $(mod_mysql_vhost_la_OBJECTS) $(mod_mysql_vhost_la_LIBADD) $(LIBS)
-mod_proxy.la: $(mod_proxy_la_OBJECTS) $(mod_proxy_la_DEPENDENCIES) $(EXTRA_mod_proxy_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_proxy_la_LINK) -rpath $(libdir) $(mod_proxy_la_OBJECTS) $(mod_proxy_la_LIBADD) $(LIBS)
-mod_redirect.la: $(mod_redirect_la_OBJECTS) $(mod_redirect_la_DEPENDENCIES) $(EXTRA_mod_redirect_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_redirect_la_LINK) -rpath $(libdir) $(mod_redirect_la_OBJECTS) $(mod_redirect_la_LIBADD) $(LIBS)
-mod_rewrite.la: $(mod_rewrite_la_OBJECTS) $(mod_rewrite_la_DEPENDENCIES) $(EXTRA_mod_rewrite_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_rewrite_la_LINK) -rpath $(libdir) $(mod_rewrite_la_OBJECTS) $(mod_rewrite_la_LIBADD) $(LIBS)
-mod_rrdtool.la: $(mod_rrdtool_la_OBJECTS) $(mod_rrdtool_la_DEPENDENCIES) $(EXTRA_mod_rrdtool_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_rrdtool_la_LINK) -rpath $(libdir) $(mod_rrdtool_la_OBJECTS) $(mod_rrdtool_la_LIBADD) $(LIBS)
-mod_scgi.la: $(mod_scgi_la_OBJECTS) $(mod_scgi_la_DEPENDENCIES) $(EXTRA_mod_scgi_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_scgi_la_LINK) -rpath $(libdir) $(mod_scgi_la_OBJECTS) $(mod_scgi_la_LIBADD) $(LIBS)
-mod_secdownload.la: $(mod_secdownload_la_OBJECTS) $(mod_secdownload_la_DEPENDENCIES) $(EXTRA_mod_secdownload_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_secdownload_la_LINK) -rpath $(libdir) $(mod_secdownload_la_OBJECTS) $(mod_secdownload_la_LIBADD) $(LIBS)
-mod_setenv.la: $(mod_setenv_la_OBJECTS) $(mod_setenv_la_DEPENDENCIES) $(EXTRA_mod_setenv_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_setenv_la_LINK) -rpath $(libdir) $(mod_setenv_la_OBJECTS) $(mod_setenv_la_LIBADD) $(LIBS)
-mod_simple_vhost.la: $(mod_simple_vhost_la_OBJECTS) $(mod_simple_vhost_la_DEPENDENCIES) $(EXTRA_mod_simple_vhost_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_simple_vhost_la_LINK) -rpath $(libdir) $(mod_simple_vhost_la_OBJECTS) $(mod_simple_vhost_la_LIBADD) $(LIBS)
-mod_ssi.la: $(mod_ssi_la_OBJECTS) $(mod_ssi_la_DEPENDENCIES) $(EXTRA_mod_ssi_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_ssi_la_LINK) -rpath $(libdir) $(mod_ssi_la_OBJECTS) $(mod_ssi_la_LIBADD) $(LIBS)
-mod_staticfile.la: $(mod_staticfile_la_OBJECTS) $(mod_staticfile_la_DEPENDENCIES) $(EXTRA_mod_staticfile_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_staticfile_la_LINK) -rpath $(libdir) $(mod_staticfile_la_OBJECTS) $(mod_staticfile_la_LIBADD) $(LIBS)
-mod_status.la: $(mod_status_la_OBJECTS) $(mod_status_la_DEPENDENCIES) $(EXTRA_mod_status_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_status_la_LINK) -rpath $(libdir) $(mod_status_la_OBJECTS) $(mod_status_la_LIBADD) $(LIBS)
-mod_trigger_b4_dl.la: $(mod_trigger_b4_dl_la_OBJECTS) $(mod_trigger_b4_dl_la_DEPENDENCIES) $(EXTRA_mod_trigger_b4_dl_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_trigger_b4_dl_la_LINK) -rpath $(libdir) $(mod_trigger_b4_dl_la_OBJECTS) $(mod_trigger_b4_dl_la_LIBADD) $(LIBS)
-mod_userdir.la: $(mod_userdir_la_OBJECTS) $(mod_userdir_la_DEPENDENCIES) $(EXTRA_mod_userdir_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_userdir_la_LINK) -rpath $(libdir) $(mod_userdir_la_OBJECTS) $(mod_userdir_la_LIBADD) $(LIBS)
-mod_usertrack.la: $(mod_usertrack_la_OBJECTS) $(mod_usertrack_la_DEPENDENCIES) $(EXTRA_mod_usertrack_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_usertrack_la_LINK) -rpath $(libdir) $(mod_usertrack_la_OBJECTS) $(mod_usertrack_la_LIBADD) $(LIBS)
-mod_webdav.la: $(mod_webdav_la_OBJECTS) $(mod_webdav_la_DEPENDENCIES) $(EXTRA_mod_webdav_la_DEPENDENCIES)
- $(AM_V_CCLD)$(mod_webdav_la_LINK) -rpath $(libdir) $(mod_webdav_la_OBJECTS) $(mod_webdav_la_LIBADD) $(LIBS)
+liblightcomp.la: $(liblightcomp_la_OBJECTS) $(liblightcomp_la_DEPENDENCIES)
+ $(LINK) $(am_liblightcomp_la_rpath) $(liblightcomp_la_LDFLAGS) $(liblightcomp_la_OBJECTS) $(liblightcomp_la_LIBADD) $(LIBS)
+mod_access.la: $(mod_access_la_OBJECTS) $(mod_access_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_access_la_LDFLAGS) $(mod_access_la_OBJECTS) $(mod_access_la_LIBADD) $(LIBS)
+mod_accesslog.la: $(mod_accesslog_la_OBJECTS) $(mod_accesslog_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_accesslog_la_LDFLAGS) $(mod_accesslog_la_OBJECTS) $(mod_accesslog_la_LIBADD) $(LIBS)
+mod_alias.la: $(mod_alias_la_OBJECTS) $(mod_alias_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_alias_la_LDFLAGS) $(mod_alias_la_OBJECTS) $(mod_alias_la_LIBADD) $(LIBS)
+mod_auth.la: $(mod_auth_la_OBJECTS) $(mod_auth_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_auth_la_LDFLAGS) $(mod_auth_la_OBJECTS) $(mod_auth_la_LIBADD) $(LIBS)
+mod_cgi.la: $(mod_cgi_la_OBJECTS) $(mod_cgi_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_cgi_la_LDFLAGS) $(mod_cgi_la_OBJECTS) $(mod_cgi_la_LIBADD) $(LIBS)
+mod_cml.la: $(mod_cml_la_OBJECTS) $(mod_cml_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_cml_la_LDFLAGS) $(mod_cml_la_OBJECTS) $(mod_cml_la_LIBADD) $(LIBS)
+mod_compress.la: $(mod_compress_la_OBJECTS) $(mod_compress_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_compress_la_LDFLAGS) $(mod_compress_la_OBJECTS) $(mod_compress_la_LIBADD) $(LIBS)
+mod_dirlisting.la: $(mod_dirlisting_la_OBJECTS) $(mod_dirlisting_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_dirlisting_la_LDFLAGS) $(mod_dirlisting_la_OBJECTS) $(mod_dirlisting_la_LIBADD) $(LIBS)
+mod_evhost.la: $(mod_evhost_la_OBJECTS) $(mod_evhost_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_evhost_la_LDFLAGS) $(mod_evhost_la_OBJECTS) $(mod_evhost_la_LIBADD) $(LIBS)
+mod_expire.la: $(mod_expire_la_OBJECTS) $(mod_expire_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_expire_la_LDFLAGS) $(mod_expire_la_OBJECTS) $(mod_expire_la_LIBADD) $(LIBS)
+mod_fastcgi.la: $(mod_fastcgi_la_OBJECTS) $(mod_fastcgi_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_fastcgi_la_LDFLAGS) $(mod_fastcgi_la_OBJECTS) $(mod_fastcgi_la_LIBADD) $(LIBS)
+mod_indexfile.la: $(mod_indexfile_la_OBJECTS) $(mod_indexfile_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_indexfile_la_LDFLAGS) $(mod_indexfile_la_OBJECTS) $(mod_indexfile_la_LIBADD) $(LIBS)
+mod_mysql_vhost.la: $(mod_mysql_vhost_la_OBJECTS) $(mod_mysql_vhost_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_mysql_vhost_la_LDFLAGS) $(mod_mysql_vhost_la_OBJECTS) $(mod_mysql_vhost_la_LIBADD) $(LIBS)
+mod_proxy.la: $(mod_proxy_la_OBJECTS) $(mod_proxy_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_proxy_la_LDFLAGS) $(mod_proxy_la_OBJECTS) $(mod_proxy_la_LIBADD) $(LIBS)
+mod_redirect.la: $(mod_redirect_la_OBJECTS) $(mod_redirect_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_redirect_la_LDFLAGS) $(mod_redirect_la_OBJECTS) $(mod_redirect_la_LIBADD) $(LIBS)
+mod_rewrite.la: $(mod_rewrite_la_OBJECTS) $(mod_rewrite_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_rewrite_la_LDFLAGS) $(mod_rewrite_la_OBJECTS) $(mod_rewrite_la_LIBADD) $(LIBS)
+mod_rrdtool.la: $(mod_rrdtool_la_OBJECTS) $(mod_rrdtool_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_rrdtool_la_LDFLAGS) $(mod_rrdtool_la_OBJECTS) $(mod_rrdtool_la_LIBADD) $(LIBS)
+mod_scgi.la: $(mod_scgi_la_OBJECTS) $(mod_scgi_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_scgi_la_LDFLAGS) $(mod_scgi_la_OBJECTS) $(mod_scgi_la_LIBADD) $(LIBS)
+mod_secdownload.la: $(mod_secdownload_la_OBJECTS) $(mod_secdownload_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_secdownload_la_LDFLAGS) $(mod_secdownload_la_OBJECTS) $(mod_secdownload_la_LIBADD) $(LIBS)
+mod_setenv.la: $(mod_setenv_la_OBJECTS) $(mod_setenv_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_setenv_la_LDFLAGS) $(mod_setenv_la_OBJECTS) $(mod_setenv_la_LIBADD) $(LIBS)
+mod_simple_vhost.la: $(mod_simple_vhost_la_OBJECTS) $(mod_simple_vhost_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_simple_vhost_la_LDFLAGS) $(mod_simple_vhost_la_OBJECTS) $(mod_simple_vhost_la_LIBADD) $(LIBS)
+mod_ssi.la: $(mod_ssi_la_OBJECTS) $(mod_ssi_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_ssi_la_LDFLAGS) $(mod_ssi_la_OBJECTS) $(mod_ssi_la_LIBADD) $(LIBS)
+mod_staticfile.la: $(mod_staticfile_la_OBJECTS) $(mod_staticfile_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_staticfile_la_LDFLAGS) $(mod_staticfile_la_OBJECTS) $(mod_staticfile_la_LIBADD) $(LIBS)
+mod_status.la: $(mod_status_la_OBJECTS) $(mod_status_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_status_la_LDFLAGS) $(mod_status_la_OBJECTS) $(mod_status_la_LIBADD) $(LIBS)
+mod_trigger_b4_dl.la: $(mod_trigger_b4_dl_la_OBJECTS) $(mod_trigger_b4_dl_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_trigger_b4_dl_la_LDFLAGS) $(mod_trigger_b4_dl_la_OBJECTS) $(mod_trigger_b4_dl_la_LIBADD) $(LIBS)
+mod_userdir.la: $(mod_userdir_la_OBJECTS) $(mod_userdir_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_userdir_la_LDFLAGS) $(mod_userdir_la_OBJECTS) $(mod_userdir_la_LIBADD) $(LIBS)
+mod_usertrack.la: $(mod_usertrack_la_OBJECTS) $(mod_usertrack_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_usertrack_la_LDFLAGS) $(mod_usertrack_la_OBJECTS) $(mod_usertrack_la_LIBADD) $(LIBS)
+mod_webdav.la: $(mod_webdav_la_OBJECTS) $(mod_webdav_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(mod_webdav_la_LDFLAGS) $(mod_webdav_la_OBJECTS) $(mod_webdav_la_LIBADD) $(LIBS)
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
- @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p || test -f $$p1; \
- then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
- } \
- ; done
+ test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
uninstall-sbinPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+ @list='$(sbin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(sbindir)/$$f"; \
+ done
clean-sbinPROGRAMS:
- @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-lemon$(EXEEXT): $(lemon_OBJECTS) $(lemon_DEPENDENCIES) $(EXTRA_lemon_DEPENDENCIES)
+ @list='$(sbin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+lemon$(EXEEXT): $(lemon_OBJECTS) $(lemon_DEPENDENCIES)
@rm -f lemon$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(lemon_OBJECTS) $(lemon_LDADD) $(LIBS)
-lighttpd$(EXEEXT): $(lighttpd_OBJECTS) $(lighttpd_DEPENDENCIES) $(EXTRA_lighttpd_DEPENDENCIES)
+ $(LINK) $(lemon_LDFLAGS) $(lemon_OBJECTS) $(lemon_LDADD) $(LIBS)
+lighttpd$(EXEEXT): $(lighttpd_OBJECTS) $(lighttpd_DEPENDENCIES)
@rm -f lighttpd$(EXEEXT)
- $(AM_V_CCLD)$(lighttpd_LINK) $(lighttpd_OBJECTS) $(lighttpd_LDADD) $(LIBS)
-lighttpd-angel$(EXEEXT): $(lighttpd_angel_OBJECTS) $(lighttpd_angel_DEPENDENCIES) $(EXTRA_lighttpd_angel_DEPENDENCIES)
- @rm -f lighttpd-angel$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(lighttpd_angel_OBJECTS) $(lighttpd_angel_LDADD) $(LIBS)
-proc_open$(EXEEXT): $(proc_open_OBJECTS) $(proc_open_DEPENDENCIES) $(EXTRA_proc_open_DEPENDENCIES)
+ $(LINK) $(lighttpd_LDFLAGS) $(lighttpd_OBJECTS) $(lighttpd_LDADD) $(LIBS)
+proc_open$(EXEEXT): $(proc_open_OBJECTS) $(proc_open_DEPENDENCIES)
@rm -f proc_open$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(proc_open_OBJECTS) $(proc_open_LDADD) $(LIBS)
+ $(LINK) $(proc_open_LDFLAGS) $(proc_open_OBJECTS) $(proc_open_LDADD) $(LIBS)
+spawn-fcgi$(EXEEXT): $(spawn_fcgi_OBJECTS) $(spawn_fcgi_DEPENDENCIES)
+ @rm -f spawn-fcgi$(EXEEXT)
+ $(LINK) $(spawn_fcgi_LDFLAGS) $(spawn_fcgi_OBJECTS) $(spawn_fcgi_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -1048,14 +834,14 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/etag.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdevent.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdevent_freebsd_kqueue.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdevent_libev.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdevent_linux_rtsig.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdevent_linux_sysepoll.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdevent_poll.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdevent_select.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdevent_solaris_devpoll.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdevent_solaris_port.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http-header-glue.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_auth.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_auth_digest.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_chunk.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop_cache.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/joblist.Po@am__quote@
@@ -1077,12 +863,11 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-etag.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-fdevent.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-fdevent_libev.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-fdevent_linux_rtsig.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-fdevent_poll.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-fdevent_select.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-fdevent_solaris_port.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-http-header-glue.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-http_chunk.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-inet_ntop_cache.Plo@am__quote@
@@ -1099,9 +884,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-plugin.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-splaytree.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-stat_cache.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-status_counter.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblightcomp_la-stream.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lighttpd-angel.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_access.Plo@am__quote@
@@ -1114,15 +897,10 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_cml_la-mod_cml_lua.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_compress.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_dirlisting.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_evasive.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_evhost.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_expire.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_extforward.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_fastcgi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_flv_streaming.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_indexfile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_magnet_la-mod_magnet.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_magnet_la-mod_magnet_cache.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_proxy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_redirect.Plo@am__quote@
@@ -1155,388 +933,360 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/response.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn-fcgi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splaytree.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat_cache.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/status_counter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
liblightcomp_la-buffer.lo: buffer.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-buffer.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-buffer.Tpo -c -o liblightcomp_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-buffer.Tpo $(DEPDIR)/liblightcomp_la-buffer.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='buffer.c' object='liblightcomp_la-buffer.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-buffer.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-buffer.Tpo" -c -o liblightcomp_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-buffer.Tpo" "$(DEPDIR)/liblightcomp_la-buffer.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-buffer.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='buffer.c' object='liblightcomp_la-buffer.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
liblightcomp_la-log.lo: log.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-log.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-log.Tpo -c -o liblightcomp_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-log.Tpo $(DEPDIR)/liblightcomp_la-log.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='liblightcomp_la-log.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-log.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-log.Tpo" -c -o liblightcomp_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-log.Tpo" "$(DEPDIR)/liblightcomp_la-log.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-log.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='log.c' object='liblightcomp_la-log.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c
liblightcomp_la-keyvalue.lo: keyvalue.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-keyvalue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-keyvalue.Tpo -c -o liblightcomp_la-keyvalue.lo `test -f 'keyvalue.c' || echo '$(srcdir)/'`keyvalue.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-keyvalue.Tpo $(DEPDIR)/liblightcomp_la-keyvalue.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='keyvalue.c' object='liblightcomp_la-keyvalue.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-keyvalue.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-keyvalue.Tpo" -c -o liblightcomp_la-keyvalue.lo `test -f 'keyvalue.c' || echo '$(srcdir)/'`keyvalue.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-keyvalue.Tpo" "$(DEPDIR)/liblightcomp_la-keyvalue.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-keyvalue.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='keyvalue.c' object='liblightcomp_la-keyvalue.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-keyvalue.lo `test -f 'keyvalue.c' || echo '$(srcdir)/'`keyvalue.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-keyvalue.lo `test -f 'keyvalue.c' || echo '$(srcdir)/'`keyvalue.c
liblightcomp_la-chunk.lo: chunk.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-chunk.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-chunk.Tpo -c -o liblightcomp_la-chunk.lo `test -f 'chunk.c' || echo '$(srcdir)/'`chunk.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-chunk.Tpo $(DEPDIR)/liblightcomp_la-chunk.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='chunk.c' object='liblightcomp_la-chunk.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-chunk.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-chunk.Tpo" -c -o liblightcomp_la-chunk.lo `test -f 'chunk.c' || echo '$(srcdir)/'`chunk.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-chunk.Tpo" "$(DEPDIR)/liblightcomp_la-chunk.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-chunk.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='chunk.c' object='liblightcomp_la-chunk.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-chunk.lo `test -f 'chunk.c' || echo '$(srcdir)/'`chunk.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-chunk.lo `test -f 'chunk.c' || echo '$(srcdir)/'`chunk.c
liblightcomp_la-http_chunk.lo: http_chunk.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-http_chunk.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-http_chunk.Tpo -c -o liblightcomp_la-http_chunk.lo `test -f 'http_chunk.c' || echo '$(srcdir)/'`http_chunk.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-http_chunk.Tpo $(DEPDIR)/liblightcomp_la-http_chunk.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_chunk.c' object='liblightcomp_la-http_chunk.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-http_chunk.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-http_chunk.Tpo" -c -o liblightcomp_la-http_chunk.lo `test -f 'http_chunk.c' || echo '$(srcdir)/'`http_chunk.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-http_chunk.Tpo" "$(DEPDIR)/liblightcomp_la-http_chunk.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-http_chunk.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='http_chunk.c' object='liblightcomp_la-http_chunk.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-http_chunk.lo `test -f 'http_chunk.c' || echo '$(srcdir)/'`http_chunk.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-http_chunk.lo `test -f 'http_chunk.c' || echo '$(srcdir)/'`http_chunk.c
liblightcomp_la-stream.lo: stream.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-stream.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-stream.Tpo -c -o liblightcomp_la-stream.lo `test -f 'stream.c' || echo '$(srcdir)/'`stream.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-stream.Tpo $(DEPDIR)/liblightcomp_la-stream.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stream.c' object='liblightcomp_la-stream.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-stream.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-stream.Tpo" -c -o liblightcomp_la-stream.lo `test -f 'stream.c' || echo '$(srcdir)/'`stream.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-stream.Tpo" "$(DEPDIR)/liblightcomp_la-stream.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-stream.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stream.c' object='liblightcomp_la-stream.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-stream.lo `test -f 'stream.c' || echo '$(srcdir)/'`stream.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-stream.lo `test -f 'stream.c' || echo '$(srcdir)/'`stream.c
liblightcomp_la-fdevent.lo: fdevent.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent.Tpo -c -o liblightcomp_la-fdevent.lo `test -f 'fdevent.c' || echo '$(srcdir)/'`fdevent.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-fdevent.Tpo $(DEPDIR)/liblightcomp_la-fdevent.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fdevent.c' object='liblightcomp_la-fdevent.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-fdevent.Tpo" -c -o liblightcomp_la-fdevent.lo `test -f 'fdevent.c' || echo '$(srcdir)/'`fdevent.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-fdevent.Tpo" "$(DEPDIR)/liblightcomp_la-fdevent.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-fdevent.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent.c' object='liblightcomp_la-fdevent.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent.lo `test -f 'fdevent.c' || echo '$(srcdir)/'`fdevent.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent.lo `test -f 'fdevent.c' || echo '$(srcdir)/'`fdevent.c
liblightcomp_la-stat_cache.lo: stat_cache.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-stat_cache.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-stat_cache.Tpo -c -o liblightcomp_la-stat_cache.lo `test -f 'stat_cache.c' || echo '$(srcdir)/'`stat_cache.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-stat_cache.Tpo $(DEPDIR)/liblightcomp_la-stat_cache.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat_cache.c' object='liblightcomp_la-stat_cache.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-stat_cache.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-stat_cache.Tpo" -c -o liblightcomp_la-stat_cache.lo `test -f 'stat_cache.c' || echo '$(srcdir)/'`stat_cache.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-stat_cache.Tpo" "$(DEPDIR)/liblightcomp_la-stat_cache.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-stat_cache.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stat_cache.c' object='liblightcomp_la-stat_cache.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-stat_cache.lo `test -f 'stat_cache.c' || echo '$(srcdir)/'`stat_cache.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-stat_cache.lo `test -f 'stat_cache.c' || echo '$(srcdir)/'`stat_cache.c
liblightcomp_la-plugin.lo: plugin.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-plugin.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-plugin.Tpo -c -o liblightcomp_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-plugin.Tpo $(DEPDIR)/liblightcomp_la-plugin.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugin.c' object='liblightcomp_la-plugin.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-plugin.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-plugin.Tpo" -c -o liblightcomp_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-plugin.Tpo" "$(DEPDIR)/liblightcomp_la-plugin.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-plugin.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plugin.c' object='liblightcomp_la-plugin.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c
liblightcomp_la-joblist.lo: joblist.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-joblist.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-joblist.Tpo -c -o liblightcomp_la-joblist.lo `test -f 'joblist.c' || echo '$(srcdir)/'`joblist.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-joblist.Tpo $(DEPDIR)/liblightcomp_la-joblist.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='joblist.c' object='liblightcomp_la-joblist.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-joblist.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-joblist.Tpo" -c -o liblightcomp_la-joblist.lo `test -f 'joblist.c' || echo '$(srcdir)/'`joblist.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-joblist.Tpo" "$(DEPDIR)/liblightcomp_la-joblist.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-joblist.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='joblist.c' object='liblightcomp_la-joblist.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-joblist.lo `test -f 'joblist.c' || echo '$(srcdir)/'`joblist.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-joblist.lo `test -f 'joblist.c' || echo '$(srcdir)/'`joblist.c
liblightcomp_la-etag.lo: etag.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-etag.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-etag.Tpo -c -o liblightcomp_la-etag.lo `test -f 'etag.c' || echo '$(srcdir)/'`etag.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-etag.Tpo $(DEPDIR)/liblightcomp_la-etag.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='etag.c' object='liblightcomp_la-etag.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-etag.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-etag.Tpo" -c -o liblightcomp_la-etag.lo `test -f 'etag.c' || echo '$(srcdir)/'`etag.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-etag.Tpo" "$(DEPDIR)/liblightcomp_la-etag.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-etag.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='etag.c' object='liblightcomp_la-etag.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-etag.lo `test -f 'etag.c' || echo '$(srcdir)/'`etag.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-etag.lo `test -f 'etag.c' || echo '$(srcdir)/'`etag.c
liblightcomp_la-array.lo: array.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-array.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-array.Tpo -c -o liblightcomp_la-array.lo `test -f 'array.c' || echo '$(srcdir)/'`array.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-array.Tpo $(DEPDIR)/liblightcomp_la-array.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='array.c' object='liblightcomp_la-array.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-array.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-array.Tpo" -c -o liblightcomp_la-array.lo `test -f 'array.c' || echo '$(srcdir)/'`array.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-array.Tpo" "$(DEPDIR)/liblightcomp_la-array.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-array.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='array.c' object='liblightcomp_la-array.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-array.lo `test -f 'array.c' || echo '$(srcdir)/'`array.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-array.lo `test -f 'array.c' || echo '$(srcdir)/'`array.c
liblightcomp_la-data_string.lo: data_string.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_string.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_string.Tpo -c -o liblightcomp_la-data_string.lo `test -f 'data_string.c' || echo '$(srcdir)/'`data_string.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-data_string.Tpo $(DEPDIR)/liblightcomp_la-data_string.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='data_string.c' object='liblightcomp_la-data_string.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_string.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-data_string.Tpo" -c -o liblightcomp_la-data_string.lo `test -f 'data_string.c' || echo '$(srcdir)/'`data_string.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-data_string.Tpo" "$(DEPDIR)/liblightcomp_la-data_string.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-data_string.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='data_string.c' object='liblightcomp_la-data_string.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_string.lo `test -f 'data_string.c' || echo '$(srcdir)/'`data_string.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_string.lo `test -f 'data_string.c' || echo '$(srcdir)/'`data_string.c
liblightcomp_la-data_count.lo: data_count.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_count.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_count.Tpo -c -o liblightcomp_la-data_count.lo `test -f 'data_count.c' || echo '$(srcdir)/'`data_count.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-data_count.Tpo $(DEPDIR)/liblightcomp_la-data_count.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='data_count.c' object='liblightcomp_la-data_count.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_count.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-data_count.Tpo" -c -o liblightcomp_la-data_count.lo `test -f 'data_count.c' || echo '$(srcdir)/'`data_count.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-data_count.Tpo" "$(DEPDIR)/liblightcomp_la-data_count.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-data_count.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='data_count.c' object='liblightcomp_la-data_count.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_count.lo `test -f 'data_count.c' || echo '$(srcdir)/'`data_count.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_count.lo `test -f 'data_count.c' || echo '$(srcdir)/'`data_count.c
liblightcomp_la-data_array.lo: data_array.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_array.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_array.Tpo -c -o liblightcomp_la-data_array.lo `test -f 'data_array.c' || echo '$(srcdir)/'`data_array.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-data_array.Tpo $(DEPDIR)/liblightcomp_la-data_array.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='data_array.c' object='liblightcomp_la-data_array.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_array.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-data_array.Tpo" -c -o liblightcomp_la-data_array.lo `test -f 'data_array.c' || echo '$(srcdir)/'`data_array.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-data_array.Tpo" "$(DEPDIR)/liblightcomp_la-data_array.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-data_array.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='data_array.c' object='liblightcomp_la-data_array.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_array.lo `test -f 'data_array.c' || echo '$(srcdir)/'`data_array.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_array.lo `test -f 'data_array.c' || echo '$(srcdir)/'`data_array.c
liblightcomp_la-data_integer.lo: data_integer.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_integer.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_integer.Tpo -c -o liblightcomp_la-data_integer.lo `test -f 'data_integer.c' || echo '$(srcdir)/'`data_integer.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-data_integer.Tpo $(DEPDIR)/liblightcomp_la-data_integer.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='data_integer.c' object='liblightcomp_la-data_integer.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_integer.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-data_integer.Tpo" -c -o liblightcomp_la-data_integer.lo `test -f 'data_integer.c' || echo '$(srcdir)/'`data_integer.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-data_integer.Tpo" "$(DEPDIR)/liblightcomp_la-data_integer.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-data_integer.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='data_integer.c' object='liblightcomp_la-data_integer.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_integer.lo `test -f 'data_integer.c' || echo '$(srcdir)/'`data_integer.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_integer.lo `test -f 'data_integer.c' || echo '$(srcdir)/'`data_integer.c
liblightcomp_la-md5.lo: md5.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-md5.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-md5.Tpo -c -o liblightcomp_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-md5.Tpo $(DEPDIR)/liblightcomp_la-md5.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='md5.c' object='liblightcomp_la-md5.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-md5.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-md5.Tpo" -c -o liblightcomp_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-md5.Tpo" "$(DEPDIR)/liblightcomp_la-md5.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-md5.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5.c' object='liblightcomp_la-md5.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
liblightcomp_la-data_fastcgi.lo: data_fastcgi.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_fastcgi.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_fastcgi.Tpo -c -o liblightcomp_la-data_fastcgi.lo `test -f 'data_fastcgi.c' || echo '$(srcdir)/'`data_fastcgi.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-data_fastcgi.Tpo $(DEPDIR)/liblightcomp_la-data_fastcgi.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='data_fastcgi.c' object='liblightcomp_la-data_fastcgi.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_fastcgi.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-data_fastcgi.Tpo" -c -o liblightcomp_la-data_fastcgi.lo `test -f 'data_fastcgi.c' || echo '$(srcdir)/'`data_fastcgi.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-data_fastcgi.Tpo" "$(DEPDIR)/liblightcomp_la-data_fastcgi.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-data_fastcgi.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='data_fastcgi.c' object='liblightcomp_la-data_fastcgi.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_fastcgi.lo `test -f 'data_fastcgi.c' || echo '$(srcdir)/'`data_fastcgi.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_fastcgi.lo `test -f 'data_fastcgi.c' || echo '$(srcdir)/'`data_fastcgi.c
liblightcomp_la-fdevent_select.lo: fdevent_select.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_select.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_select.Tpo -c -o liblightcomp_la-fdevent_select.lo `test -f 'fdevent_select.c' || echo '$(srcdir)/'`fdevent_select.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_select.Tpo $(DEPDIR)/liblightcomp_la-fdevent_select.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fdevent_select.c' object='liblightcomp_la-fdevent_select.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_select.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-fdevent_select.Tpo" -c -o liblightcomp_la-fdevent_select.lo `test -f 'fdevent_select.c' || echo '$(srcdir)/'`fdevent_select.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-fdevent_select.Tpo" "$(DEPDIR)/liblightcomp_la-fdevent_select.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-fdevent_select.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent_select.c' object='liblightcomp_la-fdevent_select.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_select.lo `test -f 'fdevent_select.c' || echo '$(srcdir)/'`fdevent_select.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_select.lo `test -f 'fdevent_select.c' || echo '$(srcdir)/'`fdevent_select.c
-liblightcomp_la-fdevent_libev.lo: fdevent_libev.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_libev.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_libev.Tpo -c -o liblightcomp_la-fdevent_libev.lo `test -f 'fdevent_libev.c' || echo '$(srcdir)/'`fdevent_libev.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_libev.Tpo $(DEPDIR)/liblightcomp_la-fdevent_libev.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fdevent_libev.c' object='liblightcomp_la-fdevent_libev.lo' libtool=yes @AMDEPBACKSLASH@
+liblightcomp_la-fdevent_linux_rtsig.lo: fdevent_linux_rtsig.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_linux_rtsig.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-fdevent_linux_rtsig.Tpo" -c -o liblightcomp_la-fdevent_linux_rtsig.lo `test -f 'fdevent_linux_rtsig.c' || echo '$(srcdir)/'`fdevent_linux_rtsig.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-fdevent_linux_rtsig.Tpo" "$(DEPDIR)/liblightcomp_la-fdevent_linux_rtsig.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-fdevent_linux_rtsig.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent_linux_rtsig.c' object='liblightcomp_la-fdevent_linux_rtsig.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_libev.lo `test -f 'fdevent_libev.c' || echo '$(srcdir)/'`fdevent_libev.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_linux_rtsig.lo `test -f 'fdevent_linux_rtsig.c' || echo '$(srcdir)/'`fdevent_linux_rtsig.c
liblightcomp_la-fdevent_poll.lo: fdevent_poll.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_poll.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_poll.Tpo -c -o liblightcomp_la-fdevent_poll.lo `test -f 'fdevent_poll.c' || echo '$(srcdir)/'`fdevent_poll.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_poll.Tpo $(DEPDIR)/liblightcomp_la-fdevent_poll.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fdevent_poll.c' object='liblightcomp_la-fdevent_poll.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_poll.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-fdevent_poll.Tpo" -c -o liblightcomp_la-fdevent_poll.lo `test -f 'fdevent_poll.c' || echo '$(srcdir)/'`fdevent_poll.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-fdevent_poll.Tpo" "$(DEPDIR)/liblightcomp_la-fdevent_poll.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-fdevent_poll.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent_poll.c' object='liblightcomp_la-fdevent_poll.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_poll.lo `test -f 'fdevent_poll.c' || echo '$(srcdir)/'`fdevent_poll.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_poll.lo `test -f 'fdevent_poll.c' || echo '$(srcdir)/'`fdevent_poll.c
liblightcomp_la-fdevent_linux_sysepoll.lo: fdevent_linux_sysepoll.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_linux_sysepoll.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Tpo -c -o liblightcomp_la-fdevent_linux_sysepoll.lo `test -f 'fdevent_linux_sysepoll.c' || echo '$(srcdir)/'`fdevent_linux_sysepoll.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Tpo $(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fdevent_linux_sysepoll.c' object='liblightcomp_la-fdevent_linux_sysepoll.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_linux_sysepoll.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Tpo" -c -o liblightcomp_la-fdevent_linux_sysepoll.lo `test -f 'fdevent_linux_sysepoll.c' || echo '$(srcdir)/'`fdevent_linux_sysepoll.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Tpo" "$(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent_linux_sysepoll.c' object='liblightcomp_la-fdevent_linux_sysepoll.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_linux_sysepoll.lo `test -f 'fdevent_linux_sysepoll.c' || echo '$(srcdir)/'`fdevent_linux_sysepoll.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_linux_sysepoll.lo `test -f 'fdevent_linux_sysepoll.c' || echo '$(srcdir)/'`fdevent_linux_sysepoll.c
liblightcomp_la-fdevent_solaris_devpoll.lo: fdevent_solaris_devpoll.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_solaris_devpoll.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Tpo -c -o liblightcomp_la-fdevent_solaris_devpoll.lo `test -f 'fdevent_solaris_devpoll.c' || echo '$(srcdir)/'`fdevent_solaris_devpoll.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Tpo $(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fdevent_solaris_devpoll.c' object='liblightcomp_la-fdevent_solaris_devpoll.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_solaris_devpoll.lo `test -f 'fdevent_solaris_devpoll.c' || echo '$(srcdir)/'`fdevent_solaris_devpoll.c
-
-liblightcomp_la-fdevent_solaris_port.lo: fdevent_solaris_port.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_solaris_port.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_solaris_port.Tpo -c -o liblightcomp_la-fdevent_solaris_port.lo `test -f 'fdevent_solaris_port.c' || echo '$(srcdir)/'`fdevent_solaris_port.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_solaris_port.Tpo $(DEPDIR)/liblightcomp_la-fdevent_solaris_port.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fdevent_solaris_port.c' object='liblightcomp_la-fdevent_solaris_port.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_solaris_devpoll.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Tpo" -c -o liblightcomp_la-fdevent_solaris_devpoll.lo `test -f 'fdevent_solaris_devpoll.c' || echo '$(srcdir)/'`fdevent_solaris_devpoll.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Tpo" "$(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent_solaris_devpoll.c' object='liblightcomp_la-fdevent_solaris_devpoll.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_solaris_port.lo `test -f 'fdevent_solaris_port.c' || echo '$(srcdir)/'`fdevent_solaris_port.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_solaris_devpoll.lo `test -f 'fdevent_solaris_devpoll.c' || echo '$(srcdir)/'`fdevent_solaris_devpoll.c
liblightcomp_la-fdevent_freebsd_kqueue.lo: fdevent_freebsd_kqueue.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_freebsd_kqueue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Tpo -c -o liblightcomp_la-fdevent_freebsd_kqueue.lo `test -f 'fdevent_freebsd_kqueue.c' || echo '$(srcdir)/'`fdevent_freebsd_kqueue.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Tpo $(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fdevent_freebsd_kqueue.c' object='liblightcomp_la-fdevent_freebsd_kqueue.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_freebsd_kqueue.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Tpo" -c -o liblightcomp_la-fdevent_freebsd_kqueue.lo `test -f 'fdevent_freebsd_kqueue.c' || echo '$(srcdir)/'`fdevent_freebsd_kqueue.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Tpo" "$(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent_freebsd_kqueue.c' object='liblightcomp_la-fdevent_freebsd_kqueue.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_freebsd_kqueue.lo `test -f 'fdevent_freebsd_kqueue.c' || echo '$(srcdir)/'`fdevent_freebsd_kqueue.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_freebsd_kqueue.lo `test -f 'fdevent_freebsd_kqueue.c' || echo '$(srcdir)/'`fdevent_freebsd_kqueue.c
liblightcomp_la-data_config.lo: data_config.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_config.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_config.Tpo -c -o liblightcomp_la-data_config.lo `test -f 'data_config.c' || echo '$(srcdir)/'`data_config.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-data_config.Tpo $(DEPDIR)/liblightcomp_la-data_config.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='data_config.c' object='liblightcomp_la-data_config.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_config.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-data_config.Tpo" -c -o liblightcomp_la-data_config.lo `test -f 'data_config.c' || echo '$(srcdir)/'`data_config.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-data_config.Tpo" "$(DEPDIR)/liblightcomp_la-data_config.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-data_config.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='data_config.c' object='liblightcomp_la-data_config.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_config.lo `test -f 'data_config.c' || echo '$(srcdir)/'`data_config.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_config.lo `test -f 'data_config.c' || echo '$(srcdir)/'`data_config.c
liblightcomp_la-bitset.lo: bitset.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-bitset.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-bitset.Tpo -c -o liblightcomp_la-bitset.lo `test -f 'bitset.c' || echo '$(srcdir)/'`bitset.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-bitset.Tpo $(DEPDIR)/liblightcomp_la-bitset.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bitset.c' object='liblightcomp_la-bitset.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-bitset.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-bitset.Tpo" -c -o liblightcomp_la-bitset.lo `test -f 'bitset.c' || echo '$(srcdir)/'`bitset.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-bitset.Tpo" "$(DEPDIR)/liblightcomp_la-bitset.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-bitset.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bitset.c' object='liblightcomp_la-bitset.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-bitset.lo `test -f 'bitset.c' || echo '$(srcdir)/'`bitset.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-bitset.lo `test -f 'bitset.c' || echo '$(srcdir)/'`bitset.c
liblightcomp_la-inet_ntop_cache.lo: inet_ntop_cache.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-inet_ntop_cache.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-inet_ntop_cache.Tpo -c -o liblightcomp_la-inet_ntop_cache.lo `test -f 'inet_ntop_cache.c' || echo '$(srcdir)/'`inet_ntop_cache.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-inet_ntop_cache.Tpo $(DEPDIR)/liblightcomp_la-inet_ntop_cache.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inet_ntop_cache.c' object='liblightcomp_la-inet_ntop_cache.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-inet_ntop_cache.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-inet_ntop_cache.Tpo" -c -o liblightcomp_la-inet_ntop_cache.lo `test -f 'inet_ntop_cache.c' || echo '$(srcdir)/'`inet_ntop_cache.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-inet_ntop_cache.Tpo" "$(DEPDIR)/liblightcomp_la-inet_ntop_cache.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-inet_ntop_cache.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='inet_ntop_cache.c' object='liblightcomp_la-inet_ntop_cache.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-inet_ntop_cache.lo `test -f 'inet_ntop_cache.c' || echo '$(srcdir)/'`inet_ntop_cache.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-inet_ntop_cache.lo `test -f 'inet_ntop_cache.c' || echo '$(srcdir)/'`inet_ntop_cache.c
liblightcomp_la-crc32.lo: crc32.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-crc32.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-crc32.Tpo -c -o liblightcomp_la-crc32.lo `test -f 'crc32.c' || echo '$(srcdir)/'`crc32.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-crc32.Tpo $(DEPDIR)/liblightcomp_la-crc32.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crc32.c' object='liblightcomp_la-crc32.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-crc32.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-crc32.Tpo" -c -o liblightcomp_la-crc32.lo `test -f 'crc32.c' || echo '$(srcdir)/'`crc32.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-crc32.Tpo" "$(DEPDIR)/liblightcomp_la-crc32.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-crc32.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crc32.c' object='liblightcomp_la-crc32.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-crc32.lo `test -f 'crc32.c' || echo '$(srcdir)/'`crc32.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-crc32.lo `test -f 'crc32.c' || echo '$(srcdir)/'`crc32.c
liblightcomp_la-connections-glue.lo: connections-glue.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-connections-glue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-connections-glue.Tpo -c -o liblightcomp_la-connections-glue.lo `test -f 'connections-glue.c' || echo '$(srcdir)/'`connections-glue.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-connections-glue.Tpo $(DEPDIR)/liblightcomp_la-connections-glue.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='connections-glue.c' object='liblightcomp_la-connections-glue.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-connections-glue.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-connections-glue.Tpo" -c -o liblightcomp_la-connections-glue.lo `test -f 'connections-glue.c' || echo '$(srcdir)/'`connections-glue.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-connections-glue.Tpo" "$(DEPDIR)/liblightcomp_la-connections-glue.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-connections-glue.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='connections-glue.c' object='liblightcomp_la-connections-glue.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-connections-glue.lo `test -f 'connections-glue.c' || echo '$(srcdir)/'`connections-glue.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-connections-glue.lo `test -f 'connections-glue.c' || echo '$(srcdir)/'`connections-glue.c
liblightcomp_la-configfile-glue.lo: configfile-glue.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-configfile-glue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-configfile-glue.Tpo -c -o liblightcomp_la-configfile-glue.lo `test -f 'configfile-glue.c' || echo '$(srcdir)/'`configfile-glue.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-configfile-glue.Tpo $(DEPDIR)/liblightcomp_la-configfile-glue.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='configfile-glue.c' object='liblightcomp_la-configfile-glue.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-configfile-glue.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-configfile-glue.Tpo" -c -o liblightcomp_la-configfile-glue.lo `test -f 'configfile-glue.c' || echo '$(srcdir)/'`configfile-glue.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-configfile-glue.Tpo" "$(DEPDIR)/liblightcomp_la-configfile-glue.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-configfile-glue.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='configfile-glue.c' object='liblightcomp_la-configfile-glue.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-configfile-glue.lo `test -f 'configfile-glue.c' || echo '$(srcdir)/'`configfile-glue.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-configfile-glue.lo `test -f 'configfile-glue.c' || echo '$(srcdir)/'`configfile-glue.c
liblightcomp_la-http-header-glue.lo: http-header-glue.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-http-header-glue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-http-header-glue.Tpo -c -o liblightcomp_la-http-header-glue.lo `test -f 'http-header-glue.c' || echo '$(srcdir)/'`http-header-glue.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-http-header-glue.Tpo $(DEPDIR)/liblightcomp_la-http-header-glue.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http-header-glue.c' object='liblightcomp_la-http-header-glue.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-http-header-glue.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-http-header-glue.Tpo" -c -o liblightcomp_la-http-header-glue.lo `test -f 'http-header-glue.c' || echo '$(srcdir)/'`http-header-glue.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-http-header-glue.Tpo" "$(DEPDIR)/liblightcomp_la-http-header-glue.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-http-header-glue.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='http-header-glue.c' object='liblightcomp_la-http-header-glue.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-http-header-glue.lo `test -f 'http-header-glue.c' || echo '$(srcdir)/'`http-header-glue.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-http-header-glue.lo `test -f 'http-header-glue.c' || echo '$(srcdir)/'`http-header-glue.c
liblightcomp_la-network_write.lo: network_write.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_write.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_write.Tpo -c -o liblightcomp_la-network_write.lo `test -f 'network_write.c' || echo '$(srcdir)/'`network_write.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-network_write.Tpo $(DEPDIR)/liblightcomp_la-network_write.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='network_write.c' object='liblightcomp_la-network_write.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_write.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-network_write.Tpo" -c -o liblightcomp_la-network_write.lo `test -f 'network_write.c' || echo '$(srcdir)/'`network_write.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-network_write.Tpo" "$(DEPDIR)/liblightcomp_la-network_write.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-network_write.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network_write.c' object='liblightcomp_la-network_write.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_write.lo `test -f 'network_write.c' || echo '$(srcdir)/'`network_write.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_write.lo `test -f 'network_write.c' || echo '$(srcdir)/'`network_write.c
liblightcomp_la-network_linux_sendfile.lo: network_linux_sendfile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_linux_sendfile.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_linux_sendfile.Tpo -c -o liblightcomp_la-network_linux_sendfile.lo `test -f 'network_linux_sendfile.c' || echo '$(srcdir)/'`network_linux_sendfile.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-network_linux_sendfile.Tpo $(DEPDIR)/liblightcomp_la-network_linux_sendfile.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='network_linux_sendfile.c' object='liblightcomp_la-network_linux_sendfile.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_linux_sendfile.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-network_linux_sendfile.Tpo" -c -o liblightcomp_la-network_linux_sendfile.lo `test -f 'network_linux_sendfile.c' || echo '$(srcdir)/'`network_linux_sendfile.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-network_linux_sendfile.Tpo" "$(DEPDIR)/liblightcomp_la-network_linux_sendfile.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-network_linux_sendfile.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network_linux_sendfile.c' object='liblightcomp_la-network_linux_sendfile.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_linux_sendfile.lo `test -f 'network_linux_sendfile.c' || echo '$(srcdir)/'`network_linux_sendfile.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_linux_sendfile.lo `test -f 'network_linux_sendfile.c' || echo '$(srcdir)/'`network_linux_sendfile.c
liblightcomp_la-network_freebsd_sendfile.lo: network_freebsd_sendfile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_freebsd_sendfile.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Tpo -c -o liblightcomp_la-network_freebsd_sendfile.lo `test -f 'network_freebsd_sendfile.c' || echo '$(srcdir)/'`network_freebsd_sendfile.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Tpo $(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='network_freebsd_sendfile.c' object='liblightcomp_la-network_freebsd_sendfile.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_freebsd_sendfile.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Tpo" -c -o liblightcomp_la-network_freebsd_sendfile.lo `test -f 'network_freebsd_sendfile.c' || echo '$(srcdir)/'`network_freebsd_sendfile.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Tpo" "$(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network_freebsd_sendfile.c' object='liblightcomp_la-network_freebsd_sendfile.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_freebsd_sendfile.lo `test -f 'network_freebsd_sendfile.c' || echo '$(srcdir)/'`network_freebsd_sendfile.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_freebsd_sendfile.lo `test -f 'network_freebsd_sendfile.c' || echo '$(srcdir)/'`network_freebsd_sendfile.c
liblightcomp_la-network_writev.lo: network_writev.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_writev.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_writev.Tpo -c -o liblightcomp_la-network_writev.lo `test -f 'network_writev.c' || echo '$(srcdir)/'`network_writev.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-network_writev.Tpo $(DEPDIR)/liblightcomp_la-network_writev.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='network_writev.c' object='liblightcomp_la-network_writev.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_writev.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-network_writev.Tpo" -c -o liblightcomp_la-network_writev.lo `test -f 'network_writev.c' || echo '$(srcdir)/'`network_writev.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-network_writev.Tpo" "$(DEPDIR)/liblightcomp_la-network_writev.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-network_writev.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network_writev.c' object='liblightcomp_la-network_writev.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_writev.lo `test -f 'network_writev.c' || echo '$(srcdir)/'`network_writev.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_writev.lo `test -f 'network_writev.c' || echo '$(srcdir)/'`network_writev.c
liblightcomp_la-network_solaris_sendfilev.lo: network_solaris_sendfilev.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_solaris_sendfilev.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Tpo -c -o liblightcomp_la-network_solaris_sendfilev.lo `test -f 'network_solaris_sendfilev.c' || echo '$(srcdir)/'`network_solaris_sendfilev.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Tpo $(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='network_solaris_sendfilev.c' object='liblightcomp_la-network_solaris_sendfilev.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_solaris_sendfilev.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Tpo" -c -o liblightcomp_la-network_solaris_sendfilev.lo `test -f 'network_solaris_sendfilev.c' || echo '$(srcdir)/'`network_solaris_sendfilev.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Tpo" "$(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network_solaris_sendfilev.c' object='liblightcomp_la-network_solaris_sendfilev.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_solaris_sendfilev.lo `test -f 'network_solaris_sendfilev.c' || echo '$(srcdir)/'`network_solaris_sendfilev.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_solaris_sendfilev.lo `test -f 'network_solaris_sendfilev.c' || echo '$(srcdir)/'`network_solaris_sendfilev.c
liblightcomp_la-network_openssl.lo: network_openssl.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_openssl.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_openssl.Tpo -c -o liblightcomp_la-network_openssl.lo `test -f 'network_openssl.c' || echo '$(srcdir)/'`network_openssl.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-network_openssl.Tpo $(DEPDIR)/liblightcomp_la-network_openssl.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='network_openssl.c' object='liblightcomp_la-network_openssl.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_openssl.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-network_openssl.Tpo" -c -o liblightcomp_la-network_openssl.lo `test -f 'network_openssl.c' || echo '$(srcdir)/'`network_openssl.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-network_openssl.Tpo" "$(DEPDIR)/liblightcomp_la-network_openssl.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-network_openssl.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network_openssl.c' object='liblightcomp_la-network_openssl.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_openssl.lo `test -f 'network_openssl.c' || echo '$(srcdir)/'`network_openssl.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_openssl.lo `test -f 'network_openssl.c' || echo '$(srcdir)/'`network_openssl.c
liblightcomp_la-splaytree.lo: splaytree.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-splaytree.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-splaytree.Tpo -c -o liblightcomp_la-splaytree.lo `test -f 'splaytree.c' || echo '$(srcdir)/'`splaytree.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-splaytree.Tpo $(DEPDIR)/liblightcomp_la-splaytree.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='splaytree.c' object='liblightcomp_la-splaytree.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-splaytree.lo `test -f 'splaytree.c' || echo '$(srcdir)/'`splaytree.c
-
-liblightcomp_la-status_counter.lo: status_counter.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-status_counter.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-status_counter.Tpo -c -o liblightcomp_la-status_counter.lo `test -f 'status_counter.c' || echo '$(srcdir)/'`status_counter.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblightcomp_la-status_counter.Tpo $(DEPDIR)/liblightcomp_la-status_counter.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='status_counter.c' object='liblightcomp_la-status_counter.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-splaytree.lo -MD -MP -MF "$(DEPDIR)/liblightcomp_la-splaytree.Tpo" -c -o liblightcomp_la-splaytree.lo `test -f 'splaytree.c' || echo '$(srcdir)/'`splaytree.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblightcomp_la-splaytree.Tpo" "$(DEPDIR)/liblightcomp_la-splaytree.Plo"; else rm -f "$(DEPDIR)/liblightcomp_la-splaytree.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='splaytree.c' object='liblightcomp_la-splaytree.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-status_counter.lo `test -f 'status_counter.c' || echo '$(srcdir)/'`status_counter.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-splaytree.lo `test -f 'splaytree.c' || echo '$(srcdir)/'`splaytree.c
mod_cml_la-mod_cml.lo: mod_cml.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -MT mod_cml_la-mod_cml.lo -MD -MP -MF $(DEPDIR)/mod_cml_la-mod_cml.Tpo -c -o mod_cml_la-mod_cml.lo `test -f 'mod_cml.c' || echo '$(srcdir)/'`mod_cml.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_cml_la-mod_cml.Tpo $(DEPDIR)/mod_cml_la-mod_cml.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod_cml.c' object='mod_cml_la-mod_cml.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -MT mod_cml_la-mod_cml.lo -MD -MP -MF "$(DEPDIR)/mod_cml_la-mod_cml.Tpo" -c -o mod_cml_la-mod_cml.lo `test -f 'mod_cml.c' || echo '$(srcdir)/'`mod_cml.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mod_cml_la-mod_cml.Tpo" "$(DEPDIR)/mod_cml_la-mod_cml.Plo"; else rm -f "$(DEPDIR)/mod_cml_la-mod_cml.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_cml.c' object='mod_cml_la-mod_cml.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -c -o mod_cml_la-mod_cml.lo `test -f 'mod_cml.c' || echo '$(srcdir)/'`mod_cml.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -c -o mod_cml_la-mod_cml.lo `test -f 'mod_cml.c' || echo '$(srcdir)/'`mod_cml.c
mod_cml_la-mod_cml_lua.lo: mod_cml_lua.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -MT mod_cml_la-mod_cml_lua.lo -MD -MP -MF $(DEPDIR)/mod_cml_la-mod_cml_lua.Tpo -c -o mod_cml_la-mod_cml_lua.lo `test -f 'mod_cml_lua.c' || echo '$(srcdir)/'`mod_cml_lua.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_cml_la-mod_cml_lua.Tpo $(DEPDIR)/mod_cml_la-mod_cml_lua.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod_cml_lua.c' object='mod_cml_la-mod_cml_lua.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -MT mod_cml_la-mod_cml_lua.lo -MD -MP -MF "$(DEPDIR)/mod_cml_la-mod_cml_lua.Tpo" -c -o mod_cml_la-mod_cml_lua.lo `test -f 'mod_cml_lua.c' || echo '$(srcdir)/'`mod_cml_lua.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mod_cml_la-mod_cml_lua.Tpo" "$(DEPDIR)/mod_cml_la-mod_cml_lua.Plo"; else rm -f "$(DEPDIR)/mod_cml_la-mod_cml_lua.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_cml_lua.c' object='mod_cml_la-mod_cml_lua.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -c -o mod_cml_la-mod_cml_lua.lo `test -f 'mod_cml_lua.c' || echo '$(srcdir)/'`mod_cml_lua.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -c -o mod_cml_la-mod_cml_lua.lo `test -f 'mod_cml_lua.c' || echo '$(srcdir)/'`mod_cml_lua.c
mod_cml_la-mod_cml_funcs.lo: mod_cml_funcs.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -MT mod_cml_la-mod_cml_funcs.lo -MD -MP -MF $(DEPDIR)/mod_cml_la-mod_cml_funcs.Tpo -c -o mod_cml_la-mod_cml_funcs.lo `test -f 'mod_cml_funcs.c' || echo '$(srcdir)/'`mod_cml_funcs.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_cml_la-mod_cml_funcs.Tpo $(DEPDIR)/mod_cml_la-mod_cml_funcs.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod_cml_funcs.c' object='mod_cml_la-mod_cml_funcs.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -c -o mod_cml_la-mod_cml_funcs.lo `test -f 'mod_cml_funcs.c' || echo '$(srcdir)/'`mod_cml_funcs.c
-
-mod_magnet_la-mod_magnet.lo: mod_magnet.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_magnet_la_CFLAGS) $(CFLAGS) -MT mod_magnet_la-mod_magnet.lo -MD -MP -MF $(DEPDIR)/mod_magnet_la-mod_magnet.Tpo -c -o mod_magnet_la-mod_magnet.lo `test -f 'mod_magnet.c' || echo '$(srcdir)/'`mod_magnet.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_magnet_la-mod_magnet.Tpo $(DEPDIR)/mod_magnet_la-mod_magnet.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod_magnet.c' object='mod_magnet_la-mod_magnet.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_magnet_la_CFLAGS) $(CFLAGS) -c -o mod_magnet_la-mod_magnet.lo `test -f 'mod_magnet.c' || echo '$(srcdir)/'`mod_magnet.c
-
-mod_magnet_la-mod_magnet_cache.lo: mod_magnet_cache.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_magnet_la_CFLAGS) $(CFLAGS) -MT mod_magnet_la-mod_magnet_cache.lo -MD -MP -MF $(DEPDIR)/mod_magnet_la-mod_magnet_cache.Tpo -c -o mod_magnet_la-mod_magnet_cache.lo `test -f 'mod_magnet_cache.c' || echo '$(srcdir)/'`mod_magnet_cache.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_magnet_la-mod_magnet_cache.Tpo $(DEPDIR)/mod_magnet_la-mod_magnet_cache.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod_magnet_cache.c' object='mod_magnet_la-mod_magnet_cache.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -MT mod_cml_la-mod_cml_funcs.lo -MD -MP -MF "$(DEPDIR)/mod_cml_la-mod_cml_funcs.Tpo" -c -o mod_cml_la-mod_cml_funcs.lo `test -f 'mod_cml_funcs.c' || echo '$(srcdir)/'`mod_cml_funcs.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mod_cml_la-mod_cml_funcs.Tpo" "$(DEPDIR)/mod_cml_la-mod_cml_funcs.Plo"; else rm -f "$(DEPDIR)/mod_cml_la-mod_cml_funcs.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_cml_funcs.c' object='mod_cml_la-mod_cml_funcs.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_magnet_la_CFLAGS) $(CFLAGS) -c -o mod_magnet_la-mod_magnet_cache.lo `test -f 'mod_magnet_cache.c' || echo '$(srcdir)/'`mod_magnet_cache.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -c -o mod_cml_la-mod_cml_funcs.lo `test -f 'mod_cml_funcs.c' || echo '$(srcdir)/'`mod_cml_funcs.c
mod_mysql_vhost_la-mod_mysql_vhost.lo: mod_mysql_vhost.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_mysql_vhost_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_mysql_vhost_la-mod_mysql_vhost.lo -MD -MP -MF $(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Tpo -c -o mod_mysql_vhost_la-mod_mysql_vhost.lo `test -f 'mod_mysql_vhost.c' || echo '$(srcdir)/'`mod_mysql_vhost.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Tpo $(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod_mysql_vhost.c' object='mod_mysql_vhost_la-mod_mysql_vhost.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_mysql_vhost_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_mysql_vhost_la-mod_mysql_vhost.lo -MD -MP -MF "$(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Tpo" -c -o mod_mysql_vhost_la-mod_mysql_vhost.lo `test -f 'mod_mysql_vhost.c' || echo '$(srcdir)/'`mod_mysql_vhost.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Tpo" "$(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Plo"; else rm -f "$(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_mysql_vhost.c' object='mod_mysql_vhost_la-mod_mysql_vhost.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_mysql_vhost_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_mysql_vhost_la-mod_mysql_vhost.lo `test -f 'mod_mysql_vhost.c' || echo '$(srcdir)/'`mod_mysql_vhost.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_mysql_vhost_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_mysql_vhost_la-mod_mysql_vhost.lo `test -f 'mod_mysql_vhost.c' || echo '$(srcdir)/'`mod_mysql_vhost.c
mod_webdav_la-mod_webdav.lo: mod_webdav.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_webdav_la_CFLAGS) $(CFLAGS) -MT mod_webdav_la-mod_webdav.lo -MD -MP -MF $(DEPDIR)/mod_webdav_la-mod_webdav.Tpo -c -o mod_webdav_la-mod_webdav.lo `test -f 'mod_webdav.c' || echo '$(srcdir)/'`mod_webdav.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_webdav_la-mod_webdav.Tpo $(DEPDIR)/mod_webdav_la-mod_webdav.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod_webdav.c' object='mod_webdav_la-mod_webdav.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_webdav_la_CFLAGS) $(CFLAGS) -MT mod_webdav_la-mod_webdav.lo -MD -MP -MF "$(DEPDIR)/mod_webdav_la-mod_webdav.Tpo" -c -o mod_webdav_la-mod_webdav.lo `test -f 'mod_webdav.c' || echo '$(srcdir)/'`mod_webdav.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mod_webdav_la-mod_webdav.Tpo" "$(DEPDIR)/mod_webdav_la-mod_webdav.Plo"; else rm -f "$(DEPDIR)/mod_webdav_la-mod_webdav.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_webdav.c' object='mod_webdav_la-mod_webdav.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_webdav_la_CFLAGS) $(CFLAGS) -c -o mod_webdav_la-mod_webdav.lo `test -f 'mod_webdav.c' || echo '$(srcdir)/'`mod_webdav.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_webdav_la_CFLAGS) $(CFLAGS) -c -o mod_webdav_la-mod_webdav.lo `test -f 'mod_webdav.c' || echo '$(srcdir)/'`mod_webdav.c
proc_open-proc_open.o: proc_open.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc_open-proc_open.o -MD -MP -MF $(DEPDIR)/proc_open-proc_open.Tpo -c -o proc_open-proc_open.o `test -f 'proc_open.c' || echo '$(srcdir)/'`proc_open.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/proc_open-proc_open.Tpo $(DEPDIR)/proc_open-proc_open.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='proc_open.c' object='proc_open-proc_open.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc_open-proc_open.o -MD -MP -MF "$(DEPDIR)/proc_open-proc_open.Tpo" -c -o proc_open-proc_open.o `test -f 'proc_open.c' || echo '$(srcdir)/'`proc_open.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/proc_open-proc_open.Tpo" "$(DEPDIR)/proc_open-proc_open.Po"; else rm -f "$(DEPDIR)/proc_open-proc_open.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proc_open.c' object='proc_open-proc_open.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc_open-proc_open.o `test -f 'proc_open.c' || echo '$(srcdir)/'`proc_open.c
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc_open-proc_open.o `test -f 'proc_open.c' || echo '$(srcdir)/'`proc_open.c
proc_open-proc_open.obj: proc_open.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc_open-proc_open.obj -MD -MP -MF $(DEPDIR)/proc_open-proc_open.Tpo -c -o proc_open-proc_open.obj `if test -f 'proc_open.c'; then $(CYGPATH_W) 'proc_open.c'; else $(CYGPATH_W) '$(srcdir)/proc_open.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/proc_open-proc_open.Tpo $(DEPDIR)/proc_open-proc_open.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='proc_open.c' object='proc_open-proc_open.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc_open-proc_open.obj -MD -MP -MF "$(DEPDIR)/proc_open-proc_open.Tpo" -c -o proc_open-proc_open.obj `if test -f 'proc_open.c'; then $(CYGPATH_W) 'proc_open.c'; else $(CYGPATH_W) '$(srcdir)/proc_open.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/proc_open-proc_open.Tpo" "$(DEPDIR)/proc_open-proc_open.Po"; else rm -f "$(DEPDIR)/proc_open-proc_open.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proc_open.c' object='proc_open-proc_open.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc_open-proc_open.obj `if test -f 'proc_open.c'; then $(CYGPATH_W) 'proc_open.c'; else $(CYGPATH_W) '$(srcdir)/proc_open.c'; fi`
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc_open-proc_open.obj `if test -f 'proc_open.c'; then $(CYGPATH_W) 'proc_open.c'; else $(CYGPATH_W) '$(srcdir)/proc_open.c'; fi`
proc_open-buffer.o: buffer.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc_open-buffer.o -MD -MP -MF $(DEPDIR)/proc_open-buffer.Tpo -c -o proc_open-buffer.o `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/proc_open-buffer.Tpo $(DEPDIR)/proc_open-buffer.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='buffer.c' object='proc_open-buffer.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc_open-buffer.o -MD -MP -MF "$(DEPDIR)/proc_open-buffer.Tpo" -c -o proc_open-buffer.o `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/proc_open-buffer.Tpo" "$(DEPDIR)/proc_open-buffer.Po"; else rm -f "$(DEPDIR)/proc_open-buffer.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='buffer.c' object='proc_open-buffer.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc_open-buffer.o `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc_open-buffer.o `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
proc_open-buffer.obj: buffer.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc_open-buffer.obj -MD -MP -MF $(DEPDIR)/proc_open-buffer.Tpo -c -o proc_open-buffer.obj `if test -f 'buffer.c'; then $(CYGPATH_W) 'buffer.c'; else $(CYGPATH_W) '$(srcdir)/buffer.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/proc_open-buffer.Tpo $(DEPDIR)/proc_open-buffer.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='buffer.c' object='proc_open-buffer.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc_open-buffer.obj -MD -MP -MF "$(DEPDIR)/proc_open-buffer.Tpo" -c -o proc_open-buffer.obj `if test -f 'buffer.c'; then $(CYGPATH_W) 'buffer.c'; else $(CYGPATH_W) '$(srcdir)/buffer.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/proc_open-buffer.Tpo" "$(DEPDIR)/proc_open-buffer.Po"; else rm -f "$(DEPDIR)/proc_open-buffer.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='buffer.c' object='proc_open-buffer.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc_open-buffer.obj `if test -f 'buffer.c'; then $(CYGPATH_W) 'buffer.c'; else $(CYGPATH_W) '$(srcdir)/buffer.c'; fi`
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc_open-buffer.obj `if test -f 'buffer.c'; then $(CYGPATH_W) 'buffer.c'; else $(CYGPATH_W) '$(srcdir)/buffer.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
@@ -1544,98 +1294,95 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- set x; \
+ tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
+ $$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
-check: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) check-am
+check: check-am
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
+install-binPROGRAMS: install-libLTLIBRARIES
+
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
-install: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) install-am
+install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
@@ -1645,39 +1392,31 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
- clean-noinstPROGRAMS clean-sbinPROGRAMS mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
+ clean-libtool clean-noinstPROGRAMS clean-sbinPROGRAMS \
+ mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
+ distclean-libtool distclean-tags
dvi: dvi-am
@@ -1685,38 +1424,19 @@ dvi-am:
html: html-am
-html-am:
-
info: info-am
info-am:
install-data-am:
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-libLTLIBRARIES install-sbinPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
+install-exec-am: install-binPROGRAMS install-libLTLIBRARIES \
+ install-sbinPROGRAMS
install-info: install-info-am
-install-info-am:
-
install-man:
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -1737,68 +1457,44 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-libLTLIBRARIES uninstall-sbinPROGRAMS
-
-.MAKE: all check install install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \
- clean-sbinPROGRAMS ctags distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-libLTLIBRARIES \
- install-man install-pdf install-pdf-am install-ps \
- install-ps-am install-sbinPROGRAMS install-strip installcheck \
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am \
+ uninstall-libLTLIBRARIES uninstall-sbinPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libLTLIBRARIES clean-libtool \
+ clean-noinstPROGRAMS clean-sbinPROGRAMS ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-binPROGRAMS install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-libLTLIBRARIES install-man \
+ install-sbinPROGRAMS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-libLTLIBRARIES \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-info-am uninstall-libLTLIBRARIES \
uninstall-sbinPROGRAMS
-.PHONY: versionstamp parsers
-
-versionstamp:
- @test -f versionstamp.h || touch versionstamp.h; \
- REVISION=""; \
- if test -d "$(top_srcdir)/.svn" -a -x "`which svnversion`"; then \
- REVISION="$$(LANG= LC_ALL=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
- if test "$$REVISION" = "exported"; then \
- REVISION=""; \
- fi; \
- fi; \
- if test -z "$$REVISION" -a -d "$(top_srcdir)/.git" -a -x "`which git`"; then \
- REVISION="$$(cd "$(top_srcdir)"; LANG= LC_ALL=C git describe --always 2>/dev/null || echo)"; \
- fi; \
- if test -n "$$REVISION"; then \
- echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
- else \
- echo "#define REPO_VERSION \"\"" > versionstamp.h.tmp; \
- fi; \
- if ! diff versionstamp.h.tmp versionstamp.h >/dev/null 2>/dev/null; then \
- mv versionstamp.h.tmp versionstamp.h; \
- else \
- rm versionstamp.h.tmp; \
- fi
+#simple_fcgi_SOURCES=simple-fcgi.c
+#simple_fcgi_LDADD=-lfcgi
-@CROSS_COMPILING_TRUE@configparser.c configparser.h:
-@CROSS_COMPILING_TRUE@mod_ssi_exprparser.c mod_ssi_exprparser.h:
+@CROSS_COMPILING_TRUE@configparser.c configparser.h:
+@CROSS_COMPILING_TRUE@mod_ssi_exprparser.c mod_ssi_exprparser.h:
+@CROSS_COMPILING_FALSE@configparser.y: lemon
+@CROSS_COMPILING_FALSE@mod_ssi_exprparser.y: lemon
-@CROSS_COMPILING_TRUE@parsers:
-@CROSS_COMPILING_FALSE@configparser.h: configparser.c
-@CROSS_COMPILING_FALSE@configparser.c: $(srcdir)/configparser.y $(srcdir)/lempar.c lemon$(EXEEXT)
+@CROSS_COMPILING_FALSE@configparser.c configparser.h: configparser.y
@CROSS_COMPILING_FALSE@ rm -f configparser.h
@CROSS_COMPILING_FALSE@ $(LEMON) -q $(srcdir)/configparser.y $(srcdir)/lempar.c
-@CROSS_COMPILING_FALSE@mod_ssi_exprparser.h: mod_ssi_exprparser.c
-@CROSS_COMPILING_FALSE@mod_ssi_exprparser.c: $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c lemon$(EXEEXT)
+@CROSS_COMPILING_FALSE@mod_ssi_exprparser.c mod_ssi_exprparser.h: mod_ssi_exprparser.y
@CROSS_COMPILING_FALSE@ rm -f mod_ssi_exprparser.h
@CROSS_COMPILING_FALSE@ $(LEMON) -q $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c
-@CROSS_COMPILING_FALSE@parsers: configparser.c mod_ssi_exprparser.c
-
+configfile.c: configparser.h
+mod_ssi_expr.c: mod_ssi_exprparser.h
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/src/SConscript b/src/SConscript
deleted file mode 100644
index 7565094..0000000
--- a/src/SConscript
+++ /dev/null
@@ -1,192 +0,0 @@
-import os
-import re
-import types
-
-Import('env')
-
-common_src = Split("buffer.c log.c \
- keyvalue.c chunk.c \
- http_chunk.c stream.c fdevent.c \
- stat_cache.c plugin.c joblist.c etag.c array.c \
- data_string.c data_count.c data_array.c \
- data_integer.c md5.c data_fastcgi.c \
- fdevent_select.c fdevent_libev.c \
- fdevent_poll.c fdevent_linux_sysepoll.c \
- fdevent_solaris_devpoll.c fdevent_solaris_port.c \
- fdevent_freebsd_kqueue.c \
- data_config.c bitset.c \
- inet_ntop_cache.c crc32.c \
- connections-glue.c \
- configfile-glue.c \
- http-header-glue.c \
- splaytree.c network_writev.c \
- network_write.c network_linux_sendfile.c \
- network_freebsd_sendfile.c \
- network_solaris_sendfilev.c network_openssl.c \
- status_counter.c \
-")
-
-src = Split("server.c response.c connections.c network.c \
- configfile.c configparser.c request.c proc_open.c")
-
-lemon = env.Program('lemon', 'lemon.c')
-
-configparser = env.Command(['configparser.c', 'configparser.h'], 'configparser.y', '(cd build; ../' + lemon[0].path + ' -q ../$SOURCE ../src/lempar.c; cd ..)')
-env.Depends(configparser, lemon)
-
-mod_ssi_exprparser = env.Command(['mod_ssi_exprparser.c', 'mod_ssi_exprparser.h'], 'mod_ssi_exprparser.y', '(cd build; ../' + lemon[0].path + ' -q ../$SOURCE ../src/lempar.c; cd ..)')
-env.Depends(mod_ssi_exprparser, lemon)
-
-## the modules and how they are built
-modules = {
- 'mod_access' : { 'src' : [ 'mod_access.c' ] },
- 'mod_alias' : { 'src' : [ 'mod_alias.c' ] },
- 'mod_cgi' : { 'src' : [ 'mod_cgi.c' ] },
- 'mod_fastcgi' : { 'src' : [ 'mod_fastcgi.c' ] },
- 'mod_scgi' : { 'src' : [ 'mod_scgi.c' ] },
- 'mod_extforward' : { 'src' : [ 'mod_extforward.c' ] },
- 'mod_staticfile' : { 'src' : [ 'mod_staticfile.c' ] },
- 'mod_dirlisting' : { 'src' : [ 'mod_dirlisting.c' ], 'lib' : [ env['LIBPCRE'] ] },
- 'mod_indexfile' : { 'src' : [ 'mod_indexfile.c' ] },
- 'mod_setenv' : { 'src' : [ 'mod_setenv.c' ] },
- 'mod_rrdtool' : { 'src' : [ 'mod_rrdtool.c' ] },
- 'mod_usertrack' : { 'src' : [ 'mod_usertrack.c' ] },
- 'mod_proxy' : { 'src' : [ 'mod_proxy.c' ] },
- 'mod_userdir' : { 'src' : [ 'mod_userdir.c' ] },
- 'mod_secdownload' : { 'src' : [ 'mod_secure_download.c' ] },
- 'mod_accesslog' : { 'src' : [ 'mod_accesslog.c' ] },
- 'mod_simple_vhost' : { 'src' : [ 'mod_simple_vhost.c' ] },
- 'mod_evhost' : { 'src' : [ 'mod_evhost.c' ] },
- 'mod_expire' : { 'src' : [ 'mod_expire.c' ] },
- 'mod_status' : { 'src' : [ 'mod_status.c' ] },
- 'mod_compress' : { 'src' : [ 'mod_compress.c' ], 'lib' : [ env['LIBZ'], env['LIBBZ2'] ] },
- 'mod_redirect' : { 'src' : [ 'mod_redirect.c' ], 'lib' : [ env['LIBPCRE'] ] },
- 'mod_rewrite' : { 'src' : [ 'mod_rewrite.c' ], 'lib' : [ env['LIBPCRE'] ] },
- 'mod_auth' : {
- 'src' : [ 'mod_auth.c', 'http_auth.c' ],
- 'lib' : [ env['LIBCRYPT'], env['LIBLDAP'], env['LIBLBER'] ] },
- 'mod_webdav' : { 'src' : [ 'mod_webdav.c' ], 'lib' : [ env['LIBXML2'], env['LIBSQLITE3'], env['LIBUUID'] ] },
- 'mod_mysql_vhost' : { 'src' : [ 'mod_mysql_vhost.c' ], 'lib' : [ env['LIBMYSQL'] ] },
- 'mod_trigger_b4_dl' : { 'src' : [ 'mod_trigger_b4_dl.c' ], 'lib' : [ env['LIBPCRE'] ] },
- 'mod_cml' : {
- 'src' : [ 'mod_cml_lua.c', 'mod_cml.c', 'mod_cml_funcs.c' ],
- 'lib' : [ env['LIBPCRE'], env['LIBMEMCACHE'], env['LIBLUA'], env['LIBLUALIB'] ] },
-# 'mod_uploadprogress' : { 'src' : [ 'mod_uploadprogress.c' ] },
- 'mod_evasive' : { 'src' : [ 'mod_evasive.c' ] },
- 'mod_ssi' : { 'src' : [ 'mod_ssi_exprparser.c', 'mod_ssi_expr.c', 'mod_ssi.c' ], 'lib' : [ env['LIBPCRE'] ] },
- 'mod_flv_streaming' : { 'src' : [ 'mod_flv_streaming.c' ] },
- 'mod_magnet' : { 'src' : [ 'mod_magnet.c', 'mod_magnet_cache.c' ], 'lib' : [ env['LIBLUA'] ] },
-}
-
-staticenv = env.Copy(CPPFLAGS=[ env['CPPFLAGS'], '-DLIGHTTPD_STATIC', '-DOPENSSL_NO_KRB5'])
-
-## all the core-sources + the modules
-staticsrc = src + common_src
-
-staticlib = env['LIBS']
-staticinit = ''
-for module in modules.keys():
- staticsrc += modules[module]['src']
- staticinit += "PLUGIN_INIT(%s)\n"%module
- if modules[module].has_key('lib'):
- staticlib += modules[module]['lib']
-
-open('plugin-static.h', 'w+').write(staticinit)
-
-## turn all src-files into objects
-staticobj = []
-for cfile in staticsrc:
- staticobj += [ staticenv.Object('static-' + cfile.replace('.c', ''), cfile) ]
-
-staticbin = staticenv.Program('lighttpd-semi-static',
- staticobj,
- LIBS = staticlib
- )
-
-## you might have to adjust the list of libs and the order for your setup
-## this is tricky, be warned
-fullstaticlib = []
-
-## try to calculate the libs for fullstatic with ldd
-## 1. find the lib
-## 2. check the deps
-## 3. add them to the libs
-searchlibs = os.pathsep.join([ '/lib/', '/usr/lib/', '/usr/local/lib/' ])
-lddre = re.compile(r'^\s+lib([^=-]+)(?:-[\.0-9]+)?\.so\.[0-9]+ =>', re.MULTILINE)
-for libs in staticlib:
- if type(libs) is types.StringType: libs = [ libs ]
- for lib in libs:
- fullstaticlib += [ lib ]
- solibpath = env.WhereIs('lib' + lib + '.so', searchlibs)
- fullstaticlib += [ lib ]
- if solibpath is None:
- continue
-
- f = os.popen('ldd ' + solibpath, 'r')
- for aword in lddre.findall(f.read()):
- fullstaticlib += [ aword ]
- f.close
-
-
-fullstaticbin = staticenv.Program('lighttpd-static',
- staticobj,
- LIBS = fullstaticlib,
- LINKFLAGS= ['-static']
- )
-
-Alias('static', staticbin)
-Alias('fullstatic', fullstaticbin)
-
-implib = 'lighttpd.exe.a'
-bin_targets = ['lighttpd']
-bin_linkflags = [ env['LINKFLAGS'] ]
-if env['COMMON_LIB'] == 'lib':
- common_lib = env.SharedLibrary('liblighttpd', common_src, LINKFLAGS = [ env['LINKFLAGS'], '-Wl,--export-dynamic' ])
-else:
- src += common_src
- common_lib = []
- if env['COMMON_LIB'] == 'bin':
- bin_linkflags += [ '-Wl,--export-all-symbols', '-Wl,--out-implib=build/' + implib ]
- bin_targets += [ implib ]
- else:
- bin_linkflags += [ '-Wl,--export-dynamic' ]
-
-instbin = env.Program(bin_targets, src, LINKFLAGS = bin_linkflags, LIBS= [ env['LIBS'], common_lib, env['LIBDL'] ])
-env.Depends(instbin, configparser)
-
-if env['COMMON_LIB'] == 'bin':
- common_lib = instbin[1]
-
-env['SHLIBPREFIX'] = ''
-instlib = []
-for module in modules.keys():
- libs = [ common_lib ]
- if modules[module].has_key('lib'):
- libs += modules[module]['lib']
- instlib += env.SharedLibrary(module, modules[module]['src'], LIBS= [ libs ])
-
-inst = []
-
-if env['build_dynamic']:
- Default(instbin[0], instlib)
- inst += env.Install('${sbindir}', instbin[0])
- inst += env.Install('${libdir}', instlib)
- if env['COMMON_LIB'] == 'lib':
- Default(common_lib)
- inst += env.Install('${bindir}', common_lib)
-
-if env['build_static']:
- Default(staticbin)
- inst += env.Install('${sbindir}', staticbin)
-
-if env['build_fullstatic']:
- Default(fullstaticbin)
- inst += env.Install('${sbindir}', fullstaticbin)
-
-env.Alias('dynamic', instbin)
-# default all to be installed
-env.Alias('install', inst)
-
-pkgdir = '.'
-tarname = env['package'] + '-' + env['version']
-
diff --git a/src/array.c b/src/array.c
index 05568b3..14afa28 100644
--- a/src/array.c
+++ b/src/array.c
@@ -1,6 +1,3 @@
-#include "array.h"
-#include "buffer.h"
-
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -9,14 +6,17 @@
#include <errno.h>
#include <assert.h>
+#include "array.h"
+#include "buffer.h"
+
array *array_init(void) {
array *a;
-
+
a = calloc(1, sizeof(*a));
assert(a);
-
+
a->next_power_of_2 = 1;
-
+
return a;
}
@@ -43,29 +43,29 @@ array *array_init_array(array *src) {
void array_free(array *a) {
size_t i;
if (!a) return;
-
+
if (!a->is_weakref) {
for (i = 0; i < a->size; i++) {
if (a->data[i]) a->data[i]->free(a->data[i]);
}
}
-
+
if (a->data) free(a->data);
if (a->sorted) free(a->sorted);
-
+
free(a);
}
void array_reset(array *a) {
size_t i;
if (!a) return;
-
+
if (!a->is_weakref) {
for (i = 0; i < a->used; i++) {
a->data[i]->reset(a->data[i]);
}
}
-
+
a->used = 0;
}
@@ -84,20 +84,20 @@ data_unset *array_pop(array *a) {
static int array_get_index(array *a, const char *key, size_t keylen, int *rndx) {
int ndx = -1;
int i, pos = 0;
-
+
if (key == NULL) return -1;
-
+
/* try to find the string */
for (i = pos = a->next_power_of_2 / 2; ; i >>= 1) {
int cmp;
-
+
if (pos < 0) {
pos += i;
} else if (pos >= (int)a->used) {
pos -= i;
} else {
cmp = buffer_caseless_compare(key, keylen, a->data[a->sorted[pos]]->key->ptr, a->data[a->sorted[pos]]->key->used);
-
+
if (cmp == 0) {
/* found */
ndx = a->sorted[pos];
@@ -110,64 +110,46 @@ static int array_get_index(array *a, const char *key, size_t keylen, int *rndx)
}
if (i == 0) break;
}
-
+
if (rndx) *rndx = pos;
-
+
return ndx;
}
data_unset *array_get_element(array *a, const char *key) {
int ndx;
-
+
if (-1 != (ndx = array_get_index(a, key, strlen(key) + 1, NULL))) {
/* found, leave here */
-
+
return a->data[ndx];
- }
-
+ }
+
return NULL;
}
data_unset *array_get_unused_element(array *a, data_type_t t) {
data_unset *ds = NULL;
- unsigned int i;
+
+ UNUSED(t);
- for (i = a->used; i < a->size; i++) {
- if (a->data[i] && a->data[i]->type == t) {
- ds = a->data[i];
+ if (a->size == 0) return NULL;
+
+ if (a->used == a->size) return NULL;
- /* make empty slot at a->used for next insert */
- a->data[i] = a->data[a->used];
- a->data[a->used] = NULL;
-
- return ds;
- }
+ if (a->data[a->used]) {
+ ds = a->data[a->used];
+
+ a->data[a->used] = NULL;
}
-
- return NULL;
-}
-
-void array_set_key_value(array *hdrs, const char *key, size_t key_len, const char *value, size_t val_len) {
- data_string *ds_dst;
-
- if (NULL != (ds_dst = (data_string *)array_get_element(hdrs, key))) {
- buffer_copy_string_len(ds_dst->value, value, val_len);
- return;
- }
-
- if (NULL == (ds_dst = (data_string *)array_get_unused_element(hdrs, TYPE_STRING))) {
- ds_dst = data_string_init();
- }
-
- buffer_copy_string_len(ds_dst->key, key, key_len);
- buffer_copy_string_len(ds_dst->value, value, val_len);
- array_insert_unique(hdrs, (data_unset *)ds_dst);
+
+ return ds;
}
/* replace or insert data, return the old one with the same key */
data_unset *array_replace(array *a, data_unset *du) {
int ndx;
-
+
if (-1 == (ndx = array_get_index(a, du->key->ptr, du->key->used, NULL))) {
array_insert_unique(a, du);
return NULL;
@@ -182,31 +164,31 @@ int array_insert_unique(array *a, data_unset *str) {
int ndx = -1;
int pos = 0;
size_t j;
-
+
/* generate unique index if neccesary */
if (str->key->used == 0 || str->is_index_key) {
buffer_copy_long(str->key, a->unique_ndx++);
str->is_index_key = 1;
}
-
+
/* try to find the string */
if (-1 != (ndx = array_get_index(a, str->key->ptr, str->key->used, &pos))) {
/* found, leave here */
if (a->data[ndx]->type == str->type) {
str->insert_dup(a->data[ndx], str);
} else {
- SEGFAULT();
+ fprintf(stderr, "a\n");
}
return 0;
}
-
+
/* insert */
-
+
if (a->used+1 > INT_MAX) {
/* we can't handle more then INT_MAX entries: see array_get_index() */
return -1;
}
-
+
if (a->size == 0) {
a->size = 16;
a->data = malloc(sizeof(*a->data) * a->size);
@@ -222,37 +204,34 @@ int array_insert_unique(array *a, data_unset *str) {
assert(a->sorted);
for (j = a->used; j < a->size; j++) a->data[j] = NULL;
}
-
+
ndx = (int) a->used;
-
- /* make sure there is nothing here */
- if (a->data[ndx]) a->data[ndx]->free(a->data[ndx]);
-
+
a->data[a->used++] = str;
-
+
if (pos != ndx &&
- ((pos < 0) ||
+ ((pos < 0) ||
buffer_caseless_compare(str->key->ptr, str->key->used, a->data[a->sorted[pos]]->key->ptr, a->data[a->sorted[pos]]->key->used) > 0)) {
pos++;
- }
-
+ }
+
/* move everything on step to the right */
if (pos != ndx) {
memmove(a->sorted + (pos + 1), a->sorted + (pos), (ndx - pos) * sizeof(*a->sorted));
}
-
+
/* insert */
a->sorted[pos] = ndx;
-
+
if (a->next_power_of_2 == (size_t)ndx) a->next_power_of_2 <<= 1;
-
+
return 0;
}
void array_print_indent(int depth) {
int i;
for (i = 0; i < depth; i ++) {
- fprintf(stdout, " ");
+ fprintf(stderr, " ");
}
}
@@ -275,7 +254,7 @@ int array_print(array *a, int depth) {
size_t i;
size_t maxlen;
int oneline = 1;
-
+
if (a->used > 5) {
oneline = 0;
}
@@ -296,20 +275,20 @@ int array_print(array *a, int depth) {
}
}
if (oneline) {
- fprintf(stdout, "(");
+ fprintf(stderr, "(");
for (i = 0; i < a->used; i++) {
data_unset *du = a->data[i];
if (i != 0) {
- fprintf(stdout, ", ");
+ fprintf(stderr, ", ");
}
du->print(du, depth + 1);
}
- fprintf(stdout, ")");
+ fprintf(stderr, ")");
return 0;
}
maxlen = array_get_max_key_length(a);
- fprintf(stdout, "(\n");
+ fprintf(stderr, "(\n");
for (i = 0; i < a->used; i++) {
data_unset *du = a->data[i];
array_print_indent(depth + 1);
@@ -317,25 +296,25 @@ int array_print(array *a, int depth) {
int j;
if (i && (i % 5) == 0) {
- fprintf(stdout, "# %zd\n", i);
+ fprintf(stderr, "# %zd\n", i);
array_print_indent(depth + 1);
}
- fprintf(stdout, "\"%s\"", du->key->ptr);
+ fprintf(stderr, "\"%s\"", du->key->ptr);
for (j = maxlen - strlen(du->key->ptr); j > 0; j --) {
- fprintf(stdout, " ");
+ fprintf(stderr, " ");
}
- fprintf(stdout, " => ");
+ fprintf(stderr, " => ");
}
du->print(du, depth + 1);
- fprintf(stdout, ",\n");
+ fprintf(stderr, ",\n");
}
if (!(i && (i - 1 % 5) == 0)) {
array_print_indent(depth + 1);
- fprintf(stdout, "# %zd\n", i);
+ fprintf(stderr, "# %zd\n", i);
}
array_print_indent(depth);
- fprintf(stdout, ")");
-
+ fprintf(stderr, ")");
+
return 0;
}
@@ -344,47 +323,47 @@ int main (int argc, char **argv) {
array *a;
data_string *ds;
data_count *dc;
-
+
UNUSED(argc);
UNUSED(argv);
a = array_init();
-
+
ds = data_string_init();
- buffer_copy_string_len(ds->key, CONST_STR_LEN("abc"));
- buffer_copy_string_len(ds->value, CONST_STR_LEN("alfrag"));
-
+ buffer_copy_string(ds->key, "abc");
+ buffer_copy_string(ds->value, "alfrag");
+
array_insert_unique(a, (data_unset *)ds);
-
+
ds = data_string_init();
- buffer_copy_string_len(ds->key, CONST_STR_LEN("abc"));
- buffer_copy_string_len(ds->value, CONST_STR_LEN("hameplman"));
-
+ buffer_copy_string(ds->key, "abc");
+ buffer_copy_string(ds->value, "hameplman");
+
array_insert_unique(a, (data_unset *)ds);
-
+
ds = data_string_init();
- buffer_copy_string_len(ds->key, CONST_STR_LEN("123"));
- buffer_copy_string_len(ds->value, CONST_STR_LEN("alfrag"));
-
+ buffer_copy_string(ds->key, "123");
+ buffer_copy_string(ds->value, "alfrag");
+
array_insert_unique(a, (data_unset *)ds);
-
+
dc = data_count_init();
- buffer_copy_string_len(dc->key, CONST_STR_LEN("def"));
-
+ buffer_copy_string(dc->key, "def");
+
array_insert_unique(a, (data_unset *)dc);
-
+
dc = data_count_init();
- buffer_copy_string_len(dc->key, CONST_STR_LEN("def"));
-
+ buffer_copy_string(dc->key, "def");
+
array_insert_unique(a, (data_unset *)dc);
-
+
array_print(a, 0);
-
+
array_free(a);
-
+
fprintf(stderr, "%d\n",
buffer_caseless_compare(CONST_STR_LEN("Content-Type"), CONST_STR_LEN("Content-type")));
-
+
return 0;
}
#endif
diff --git a/src/array.h b/src/array.h
index 84245c7..27f27a4 100644
--- a/src/array.h
+++ b/src/array.h
@@ -1,18 +1,15 @@
#ifndef ARRAY_H
#define ARRAY_H
+#include <stdlib.h>
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
#endif
-
#ifdef HAVE_PCRE_H
# include <pcre.h>
#endif
-
#include "buffer.h"
-#include <stdlib.h>
-
#define DATA_IS_STRING(x) (x->type == TYPE_STRING)
typedef enum { TYPE_UNSET, TYPE_STRING, TYPE_COUNT, TYPE_ARRAY, TYPE_INTEGER, TYPE_FASTCGI, TYPE_CONFIG } data_type_t;
@@ -32,21 +29,21 @@ typedef struct data_unset {
typedef struct {
data_unset **data;
-
+
size_t *sorted;
-
+
size_t used;
size_t size;
-
+
size_t unique_ndx;
-
+
size_t next_power_of_2;
int is_weakref; /* data is weakref, don't bother the data */
} array;
typedef struct {
DATA_UNSET;
-
+
int count;
} data_count;
@@ -54,7 +51,7 @@ data_count *data_count_init(void);
typedef struct {
DATA_UNSET;
-
+
buffer *value;
} data_string;
@@ -63,44 +60,21 @@ data_string *data_response_init(void);
typedef struct {
DATA_UNSET;
-
+
array *value;
} data_array;
data_array *data_array_init(void);
-/**
- * possible compare ops in the configfile parser
- */
-typedef enum {
- CONFIG_COND_UNSET,
- CONFIG_COND_EQ, /** == */
- CONFIG_COND_MATCH, /** =~ */
- CONFIG_COND_NE, /** != */
- CONFIG_COND_NOMATCH /** !~ */
-} config_cond_t;
-
-/**
- * possible fields to match against
- */
+typedef enum { CONFIG_COND_UNSET, CONFIG_COND_EQ, CONFIG_COND_MATCH, CONFIG_COND_NE, CONFIG_COND_NOMATCH } config_cond_t;
+
+#define PATCHES NULL, "SERVERsocket", "HTTPurl", "HTTPhost", "HTTPreferer", "HTTPuseragent", "HTTPcookie", "HTTPremoteip"
typedef enum {
COMP_UNSET,
- COMP_SERVER_SOCKET,
- COMP_HTTP_URL,
- COMP_HTTP_HOST,
- COMP_HTTP_REFERER,
- COMP_HTTP_USER_AGENT,
- COMP_HTTP_LANGUAGE,
- COMP_HTTP_COOKIE,
- COMP_HTTP_REMOTE_IP,
- COMP_HTTP_QUERY_STRING,
- COMP_HTTP_SCHEME,
- COMP_HTTP_REQUEST_METHOD,
-
- COMP_LAST_ELEMENT
+ COMP_SERVER_SOCKET, COMP_HTTP_URL, COMP_HTTP_HOST, COMP_HTTP_REFERER, COMP_HTTP_USERAGENT, COMP_HTTP_COOKIE, COMP_HTTP_REMOTEIP
} comp_key_t;
-/* $HTTP["host"] == "incremental.home.kneschke.de" { ... }
+/* $HTTP["host"] == "incremental.home.kneschke.de" { ... }
* for print: comp_key op string
* for compare: comp cond string/regex
*/
@@ -108,15 +82,15 @@ typedef enum {
typedef struct _data_config data_config;
struct _data_config {
DATA_UNSET;
-
+
array *value;
-
+
buffer *comp_key;
comp_key_t comp;
-
+
config_cond_t cond;
buffer *op;
-
+
int context_ndx; /* more or less like an id */
array *childs;
/* nested */
@@ -124,7 +98,7 @@ struct _data_config {
/* for chaining only */
data_config *prev;
data_config *next;
-
+
buffer *string;
#ifdef HAVE_PCRE_H
pcre *regex;
@@ -136,7 +110,7 @@ data_config *data_config_init(void);
typedef struct {
DATA_UNSET;
-
+
int value;
} data_integer;
@@ -146,13 +120,13 @@ typedef struct {
DATA_UNSET;
buffer *host;
-
+
unsigned short port;
time_t disable_ts;
int is_disabled;
size_t balance;
-
+
int usage; /* fair-balancing needs the no. of connections active on this host */
int last_used_ndx; /* round robin */
} data_fastcgi;
@@ -168,7 +142,6 @@ data_unset *array_pop(array *a);
int array_print(array *a, int depth);
data_unset *array_get_unused_element(array *a, data_type_t t);
data_unset *array_get_element(array *a, const char *key);
-void array_set_key_value(array *hdrs, const char *key, size_t key_len, const char *value, size_t val_len);
data_unset *array_replace(array *a, data_unset *du);
int array_strcasecmp(const char *a, size_t a_len, const char *b, size_t b_len);
void array_print_indent(int depth);
diff --git a/src/base.h b/src/base.h
index 9c75cc9..506fdad 100644
--- a/src/base.h
+++ b/src/base.h
@@ -1,21 +1,18 @@
#ifndef _BASE_H_
#define _BASE_H_
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include "settings.h"
-
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
-#include <limits.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <limits.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
-
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
@@ -24,18 +21,15 @@
#include "array.h"
#include "chunk.h"
#include "keyvalue.h"
+#include "settings.h"
#include "fdevent.h"
#include "sys-socket.h"
#include "splaytree.h"
-#include "etag.h"
#if defined HAVE_LIBSSL && defined HAVE_OPENSSL_SSL_H
# define USE_OPENSSL
-# include <openssl/ssl.h>
-# if ! defined OPENSSL_NO_TLSEXT && ! defined SSL_CTRL_SET_TLSEXT_HOSTNAME
-# define OPENSSL_NO_TLSEXT
-# endif
+# include <openssl/ssl.h>
#endif
#ifdef HAVE_FAM_H
@@ -84,26 +78,26 @@ typedef int socklen_t;
# define SHUT_WR 1
#endif
-typedef enum { T_CONFIG_UNSET,
- T_CONFIG_STRING,
- T_CONFIG_SHORT,
- T_CONFIG_INT,
- T_CONFIG_BOOLEAN,
- T_CONFIG_ARRAY,
- T_CONFIG_LOCAL,
- T_CONFIG_DEPRECATED,
- T_CONFIG_UNSUPPORTED
+#include "settings.h"
+
+typedef enum { T_CONFIG_UNSET,
+ T_CONFIG_STRING,
+ T_CONFIG_SHORT,
+ T_CONFIG_BOOLEAN,
+ T_CONFIG_ARRAY,
+ T_CONFIG_LOCAL,
+ T_CONFIG_DEPRECATED
} config_values_type_t;
-typedef enum { T_CONFIG_SCOPE_UNSET,
- T_CONFIG_SCOPE_SERVER,
+typedef enum { T_CONFIG_SCOPE_UNSET,
+ T_CONFIG_SCOPE_SERVER,
T_CONFIG_SCOPE_CONNECTION
} config_scope_type_t;
typedef struct {
const char *key;
void *destination;
-
+
config_values_type_t type;
config_scope_type_t scope;
} config_values_t;
@@ -148,29 +142,29 @@ typedef struct {
/* the request-line */
buffer *request;
buffer *uri;
-
+
buffer *orig_uri;
-
+
http_method_t http_method;
http_version_t http_version;
-
+
buffer *request_line;
-
+
/* strings to the header */
buffer *http_host; /* not alloced */
const char *http_range;
const char *http_content_type;
const char *http_if_modified_since;
const char *http_if_none_match;
-
+
array *headers;
-
+
/* CONTENT */
size_t content_length; /* returned by strtoul() */
-
+
/* internal representation */
int accept_encoding;
-
+
/* internal */
buffer *pathinfo;
} request;
@@ -178,48 +172,40 @@ typedef struct {
typedef struct {
off_t content_length;
int keep_alive; /* used by the subrequests in proxy, cgi and fcgi to say the subrequest was keep-alive or not */
-
+
array *headers;
-
- enum {
+
+ enum {
HTTP_TRANSFER_ENCODING_IDENTITY, HTTP_TRANSFER_ENCODING_CHUNKED
} transfer_encoding;
} response;
typedef struct {
- buffer *scheme; /* scheme without colon or slashes ( "http" or "https" ) */
-
- /* authority with optional portnumber ("site.name" or "site.name:8080" ) NOTE: without "username:password@" */
+ buffer *scheme;
buffer *authority;
-
- /* path including leading slash ("/" or "/index.html") - urldecoded, and sanitized ( buffer_path_simplify() && buffer_urldecode_path() ) */
buffer *path;
- buffer *path_raw; /* raw path, as sent from client. no urldecoding or path simplifying */
- buffer *query; /* querystring ( everything after "?", ie: in "/index.php?foo=1", query is "foo=1" ) */
+ buffer *path_raw;
+ buffer *query;
} request_uri;
typedef struct {
buffer *path;
buffer *basedir; /* path = "(basedir)(.*)" */
-
+
buffer *doc_root; /* path = doc_root + rel_path */
buffer *rel_path;
-
+
buffer *etag;
} physical;
typedef struct {
buffer *name;
buffer *etag;
-
+
struct stat st;
-
+
time_t stat_ts;
-
-#ifdef HAVE_LSTAT
- char is_symlink;
-#endif
-
+
#ifdef HAVE_FAM_H
int dir_version;
int dir_ndx;
@@ -230,7 +216,7 @@ typedef struct {
typedef struct {
splay_tree *files; /* the nodes of the tree are stat_cache_entry's */
-
+
buffer *dir_name; /* for building the dirname from the filename */
#ifdef HAVE_FAM_H
splay_tree *dirs; /* the nodes of the tree are fam_dir_entry */
@@ -238,12 +224,11 @@ typedef struct {
FAMConnection *fam;
int fam_fcce_ndx;
#endif
- buffer *hash_key; /* temp-store for the hash-key */
} stat_cache;
typedef struct {
array *mimetypes;
-
+
/* virtual-servers */
buffer *document_root;
buffer *server_name;
@@ -251,7 +236,7 @@ typedef struct {
buffer *server_tag;
buffer *dirlist_encoding;
buffer *errorfile_prefix;
-
+
unsigned short max_keep_alive_requests;
unsigned short max_keep_alive_idle;
unsigned short max_read_idle;
@@ -259,52 +244,33 @@ typedef struct {
unsigned short use_xattr;
unsigned short follow_symlink;
unsigned short range_requests;
-
+
/* debug */
-
+
unsigned short log_file_not_found;
unsigned short log_request_header;
unsigned short log_request_handling;
unsigned short log_response_header;
unsigned short log_condition_handling;
- unsigned short log_ssl_noise;
- unsigned short log_timeouts;
-
-
+
+
/* server wide */
buffer *ssl_pemfile;
buffer *ssl_ca_file;
- buffer *ssl_cipher_list;
- buffer *ssl_dh_file;
- buffer *ssl_ec_curve;
- unsigned short ssl_honor_cipher_order; /* determine SSL cipher in server-preferred order, not client-order */
- unsigned short ssl_use_sslv2;
- unsigned short ssl_use_sslv3;
- unsigned short ssl_verifyclient;
- unsigned short ssl_verifyclient_enforce;
- unsigned short ssl_verifyclient_depth;
- buffer *ssl_verifyclient_username;
- unsigned short ssl_verifyclient_export_cert;
- unsigned short ssl_disable_client_renegotiation;
-
- unsigned short use_ipv6, set_v6only; /* set_v6only is only a temporary option */
- unsigned short defer_accept;
+ unsigned short use_ipv6;
unsigned short is_ssl;
unsigned short allow_http11;
- unsigned short etag_use_inode;
- unsigned short etag_use_mtime;
- unsigned short etag_use_size;
- unsigned short force_lowercase_filenames; /* if the FS is case-insensitive, force all files to lower-case */
- unsigned int max_request_size;
+ unsigned short force_lower_case; /* if the FS is case-insensitive, force all files to lower-case */
+ unsigned short max_request_size;
unsigned short kbytes_per_second; /* connection kb/s limit */
/* configside */
unsigned short global_kbytes_per_second; /* */
- off_t global_bytes_per_second_cnt;
+ off_t global_bytes_per_second_cnt;
/* server-wide traffic-shaper
- *
+ *
* each context has the counter which is inited once
* a second by the global_kbytes_per_second config-var
*
@@ -312,32 +278,18 @@ typedef struct {
* the connected conns are "offline" a little bit
*
* the problem:
- * we somehow have to loose our "we are writable" signal
+ * we somehow have to loose our "we are writable" signal
* on the way.
- *
+ *
*/
off_t *global_bytes_per_second_cnt_ptr; /* */
-
+
#ifdef USE_OPENSSL
SSL_CTX *ssl_ctx;
#endif
} specific_config;
-/* the order of the items should be the same as they are processed
- * read before write as we use this later */
-typedef enum {
- CON_STATE_CONNECT,
- CON_STATE_REQUEST_START,
- CON_STATE_READ,
- CON_STATE_REQUEST_END,
- CON_STATE_READ_POST,
- CON_STATE_HANDLE_REQUEST,
- CON_STATE_RESPONSE_START,
- CON_STATE_WRITE,
- CON_STATE_RESPONSE_END,
- CON_STATE_ERROR,
- CON_STATE_CLOSE
-} connection_state_t;
+typedef enum { CON_STATE_CONNECT, CON_STATE_REQUEST_START, CON_STATE_READ, CON_STATE_REQUEST_END, CON_STATE_READ_POST, CON_STATE_HANDLE_REQUEST, CON_STATE_RESPONSE_START, CON_STATE_WRITE, CON_STATE_RESPONSE_END, CON_STATE_ERROR, CON_STATE_CLOSE } connection_state_t;
typedef enum { COND_RESULT_UNSET, COND_RESULT_FALSE, COND_RESULT_TRUE } cond_result_t;
typedef struct {
@@ -345,106 +297,95 @@ typedef struct {
int patterncount;
int matches[3 * 10];
buffer *comp_value; /* just a pointer */
-
- comp_key_t comp_type;
} cond_cache_t;
typedef struct {
connection_state_t state;
-
+
/* timestamps */
time_t read_idle_ts;
time_t close_timeout_ts;
time_t write_request_ts;
-
+
time_t connection_start;
time_t request_start;
-
+
struct timeval start_tv;
-
+
size_t request_count; /* number of requests handled in this connection */
size_t loops_per_request; /* to catch endless loops in a single request
- *
+ *
* used by mod_rewrite, mod_fastcgi, ... and others
* this is self-protection
*/
-
+
int fd; /* the FD for this connection */
int fde_ndx; /* index for the fdevent-handler */
int ndx; /* reverse mapping to server->connection[ndx] */
-
+
/* fd states */
int is_readable;
int is_writable;
-
- int keep_alive; /* only request.c can enable it, all other just disable */
- int keep_alive_idle; /* remember max_keep_alive_idle from config */
-
+
+ int keep_alive; /* only request.c can enable it, all other just disable */
+
int file_started;
int file_finished;
-
+
chunkqueue *write_queue; /* a large queue for low-level write ( HTTP response ) [ file, mem ] */
chunkqueue *read_queue; /* a small queue for low-level read ( HTTP request ) [ mem ] */
chunkqueue *request_content_queue; /* takes request-content into tempfile if necessary [ tempfile, mem ]*/
-
+
int traffic_limit_reached;
-
+
off_t bytes_written; /* used by mod_accesslog, mod_rrd */
off_t bytes_written_cur_second; /* used by mod_accesslog, mod_rrd */
off_t bytes_read; /* used by mod_accesslog, mod_rrd */
off_t bytes_header;
-
+
int http_status;
-
+
sock_addr dst_addr;
buffer *dst_addr_buf;
/* request */
buffer *parse_request;
unsigned int parsed_response; /* bitfield which contains the important header-fields of the parsed response header */
-
+
request request;
request_uri uri;
- physical physical;
+ physical physical;
response response;
-
+
size_t header_len;
-
+
buffer *authed_user;
array *environment; /* used to pass lighttpd internal stuff to the FastCGI/CGI apps, setenv does that */
-
+
/* response */
int got_response;
-
+
int in_joblist;
-
+
connection_type mode;
-
+
void **plugin_ctx; /* plugin connection specific config */
-
+
specific_config conf; /* global connection specific config */
cond_cache_t *cond_cache;
-
+
buffer *server_name;
-
+
/* error-handler */
buffer *error_handler;
int error_handler_saved_status;
int in_error_handler;
-
+
void *srv_socket; /* reference to the server-socket (typecast to server_socket) */
-
+
#ifdef USE_OPENSSL
SSL *ssl;
-# ifndef OPENSSL_NO_TLSEXT
- buffer *tlsext_server_name;
-# endif
- unsigned int renegotiations; /* count of SSL_CB_HANDSHAKE_START */
#endif
- /* etag handling */
- etag_flags_t etag_flags;
-
- int conditional_is_valid[COMP_LAST_ELEMENT];
} connection;
typedef struct {
@@ -487,100 +428,89 @@ typedef struct {
typedef struct {
unsigned short port;
buffer *bindhost;
-
+
buffer *errorlog_file;
unsigned short errorlog_use_syslog;
- buffer *breakagelog_file;
-
+
unsigned short dont_daemonize;
buffer *changeroot;
buffer *username;
buffer *groupname;
-
+
buffer *pid_file;
-
+
buffer *event_handler;
-
+
buffer *modules_dir;
buffer *network_backend;
array *modules;
array *upload_tempdirs;
-
+
unsigned short max_worker;
unsigned short max_fds;
unsigned short max_conns;
- unsigned int max_request_size;
-
+ unsigned short max_request_size;
+
unsigned short log_request_header_on_error;
unsigned short log_state_handling;
-
- enum { STAT_CACHE_ENGINE_UNSET,
- STAT_CACHE_ENGINE_NONE,
- STAT_CACHE_ENGINE_SIMPLE
-#ifdef HAVE_FAM_H
- , STAT_CACHE_ENGINE_FAM
-#endif
+
+ enum { STAT_CACHE_ENGINE_UNSET,
+ STAT_CACHE_ENGINE_NONE,
+ STAT_CACHE_ENGINE_SIMPLE,
+ STAT_CACHE_ENGINE_FAM
} stat_cache_engine;
- unsigned short enable_cores;
- unsigned short reject_expect_100_with_417;
} server_config;
typedef struct {
sock_addr addr;
int fd;
int fde_ndx;
-
+
buffer *ssl_pemfile;
buffer *ssl_ca_file;
- buffer *ssl_cipher_list;
- buffer *ssl_dh_file;
- buffer *ssl_ec_curve;
- unsigned short ssl_use_sslv2;
- unsigned short ssl_use_sslv3;
unsigned short use_ipv6;
unsigned short is_ssl;
-
+
buffer *srv_token;
-
+
#ifdef USE_OPENSSL
SSL_CTX *ssl_ctx;
#endif
- unsigned short is_proxy_ssl;
} server_socket;
typedef struct {
server_socket **ptr;
-
+
size_t size;
size_t used;
} server_socket_array;
typedef struct server {
server_socket_array srv_sockets;
-
+
/* the errorlog */
int errorlog_fd;
- enum { ERRORLOG_FILE, ERRORLOG_FD, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode;
+ enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG } errorlog_mode;
buffer *errorlog_buf;
-
+
fdevents *ev, *ev_ins;
-
+
buffer_plugin plugins;
void *plugin_slots;
-
+
/* counters */
int con_opened;
int con_read;
int con_written;
int con_closed;
-
+
int ssl_is_init;
-
+
int max_fds; /* max possible fds */
int cur_fds; /* currently used fds */
int want_fds; /* waiting fds */
int sockets_disabled;
-
+
size_t max_conns;
/* buffers */
@@ -588,13 +518,13 @@ typedef struct server {
buffer *response_header;
buffer *response_range;
buffer *tmp_buf;
-
+
buffer *tmp_chunk_len;
-
+
buffer *empty_string; /* is necessary for cond_match */
buffer *cond_check_buf;
-
+
/* caches */
#ifdef HAVE_IPV6
inet_ntop_cache_type inet_ntop_cache[INET_NTOP_CACHE_MAX];
@@ -602,57 +532,40 @@ typedef struct server {
mtime_cache_type mtime_cache[FILE_CACHE_MAX];
array *split_vals;
-
+
/* Timestamps */
time_t cur_ts;
time_t last_generated_date_ts;
time_t last_generated_debug_ts;
time_t startup_ts;
-
- char entropy[8]; /* from /dev/[u]random if possible, otherwise rand() */
- char is_real_entropy; /* whether entropy is from /dev/[u]random */
-
+
buffer *ts_debug_str;
buffer *ts_date_str;
-
+
/* config-file */
array *config;
array *config_touched;
-
+
array *config_context;
specific_config **config_storage;
-
+
server_config srvconf;
-
- short int config_deprecated;
- short int config_unsupported;
-
+
+ int config_deprecated;
+
connections *conns;
connections *joblist;
connections *fdwaitqueue;
-
+
stat_cache *stat_cache;
-
- /**
- * The status array can carry all the status information you want
- * the key to the array is <module-prefix>.<name>
- * and the values are counters
- *
- * example:
- * fastcgi.backends = 10
- * fastcgi.active-backends = 6
- * fastcgi.backend.<key>.load = 24
- * fastcgi.backend.<key>....
- *
- * fastcgi.backend.<key>.disconnects = ...
- */
- array *status;
-
+
fdevent_handler_t event_handler;
- int (* network_backend_write)(struct server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
+ int (* network_backend_write)(struct server *srv, connection *con, int fd, chunkqueue *cq);
+ int (* network_backend_read)(struct server *srv, connection *con, int fd, chunkqueue *cq);
#ifdef USE_OPENSSL
- int (* network_ssl_backend_write)(struct server *srv, connection *con, SSL *ssl, chunkqueue *cq, off_t max_bytes);
+ int (* network_ssl_backend_write)(struct server *srv, connection *con, SSL *ssl, chunkqueue *cq);
+ int (* network_ssl_backend_read)(struct server *srv, connection *con, SSL *ssl, chunkqueue *cq);
#endif
uid_t uid;
diff --git a/src/bitset.c b/src/bitset.c
index 555f244..7fe5662 100644
--- a/src/bitset.c
+++ b/src/bitset.c
@@ -1,12 +1,12 @@
-#include "buffer.h"
-#include "bitset.h"
-
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
+#include "bitset.h"
+#include "buffer.h"
+
#define BITSET_BITS \
( CHAR_BIT * sizeof(size_t) )
diff --git a/src/buffer.c b/src/buffer.c
index 43fb71c..cd4a72a 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1,5 +1,3 @@
-#include "buffer.h"
-
#include <stdlib.h>
#include <string.h>
@@ -7,25 +5,27 @@
#include <assert.h>
#include <ctype.h>
+#include "buffer.h"
+
static const char hex_chars[] = "0123456789abcdef";
/**
- * init the buffer
- *
+ * init the buffer
+ *
*/
buffer* buffer_init(void) {
buffer *b;
-
+
b = malloc(sizeof(*b));
assert(b);
-
+
b->ptr = NULL;
b->size = 0;
b->used = 0;
-
+
return b;
}
@@ -36,8 +36,8 @@ buffer *buffer_init_buffer(buffer *src) {
}
/**
- * free the buffer
- *
+ * free the buffer
+ *
*/
void buffer_free(buffer *b) {
@@ -49,41 +49,39 @@ void buffer_free(buffer *b) {
void buffer_reset(buffer *b) {
if (!b) return;
-
+
/* limit don't reuse buffer larger than ... bytes */
if (b->size > BUFFER_MAX_REUSE_SIZE) {
free(b->ptr);
b->ptr = NULL;
b->size = 0;
- } else if (b->size) {
- b->ptr[0] = '\0';
}
-
+
b->used = 0;
}
/**
- *
- * allocate (if neccessary) enough space for 'size' bytes and
+ *
+ * allocate (if neccessary) enough space for 'size' bytes and
* set the 'used' counter to 0
- *
+ *
*/
#define BUFFER_PIECE_SIZE 64
int buffer_prepare_copy(buffer *b, size_t size) {
if (!b) return -1;
-
- if ((0 == b->size) ||
+
+ if ((0 == b->size) ||
(size > b->size)) {
if (b->size) free(b->ptr);
-
+
b->size = size;
-
+
/* always allocate a multiply of BUFFER_PIECE_SIZE */
b->size += BUFFER_PIECE_SIZE - (b->size % BUFFER_PIECE_SIZE);
-
+
b->ptr = malloc(b->size);
assert(b->ptr);
}
@@ -92,30 +90,30 @@ int buffer_prepare_copy(buffer *b, size_t size) {
}
/**
- *
+ *
* increase the internal buffer (if neccessary) to append another 'size' byte
* ->used isn't changed
- *
+ *
*/
int buffer_prepare_append(buffer *b, size_t size) {
if (!b) return -1;
-
+
if (0 == b->size) {
b->size = size;
-
+
/* always allocate a multiply of BUFFER_PIECE_SIZE */
b->size += BUFFER_PIECE_SIZE - (b->size % BUFFER_PIECE_SIZE);
-
+
b->ptr = malloc(b->size);
b->used = 0;
assert(b->ptr);
} else if (b->used + size > b->size) {
b->size += size;
-
+
/* always allocate a multiply of BUFFER_PIECE_SIZE */
b->size += BUFFER_PIECE_SIZE - (b->size % BUFFER_PIECE_SIZE);
-
+
b->ptr = realloc(b->ptr, b->size);
assert(b->ptr);
}
@@ -124,7 +122,7 @@ int buffer_prepare_append(buffer *b, size_t size) {
int buffer_copy_string(buffer *b, const char *s) {
size_t s_len;
-
+
if (!s || !b) return -1;
s_len = strlen(s) + 1;
@@ -138,28 +136,28 @@ int buffer_copy_string(buffer *b, const char *s) {
int buffer_copy_string_len(buffer *b, const char *s, size_t s_len) {
if (!s || !b) return -1;
-#if 0
- /* removed optimization as we have to keep the empty string
+#if 0
+ /* removed optimization as we have to keep the empty string
* in some cases for the config handling
- *
+ *
* url.access-deny = ( "" )
*/
if (s_len == 0) return 0;
-#endif
+#endif
buffer_prepare_copy(b, s_len + 1);
-
+
memcpy(b->ptr, s, s_len);
b->ptr[s_len] = '\0';
b->used = s_len + 1;
-
+
return 0;
}
int buffer_copy_string_buffer(buffer *b, const buffer *src) {
if (!src) return -1;
-
+
if (src->used == 0) {
- buffer_reset(b);
+ b->used = 0;
return 0;
}
return buffer_copy_string_len(b, src->ptr, src->used - 1);
@@ -187,7 +185,6 @@ int buffer_append_string_rfill(buffer *b, const char *s, size_t maxlen) {
if (!s || !b) return -1;
s_len = strlen(s);
- if (s_len > maxlen) s_len = maxlen;
buffer_prepare_append(b, maxlen + 1);
if (b->used == 0)
b->used++;
@@ -204,10 +201,10 @@ int buffer_append_string_rfill(buffer *b, const char *s, size_t maxlen) {
/**
* append a string to the end of the buffer
- *
- * the resulting buffer is terminated with a '\0'
+ *
+ * the resulting buffer is terminated with a '\0'
* s is treated as a un-terminated string (a \0 is handled a normal character)
- *
+ *
* @param b a buffer
* @param s the string
* @param s_len size of the string (without the terminating \0)
@@ -231,7 +228,7 @@ int buffer_append_string_len(buffer *b, const char *s, size_t s_len) {
int buffer_append_string_buffer(buffer *b, const buffer *src) {
if (!src) return -1;
if (src->used == 0) return 0;
-
+
return buffer_append_string_len(b, src->ptr, src->used - 1);
}
@@ -248,9 +245,9 @@ int buffer_append_memory(buffer *b, const char *s, size_t s_len) {
int buffer_copy_memory(buffer *b, const char *s, size_t s_len) {
if (!s || !b) return -1;
-
+
b->used = 0;
-
+
return buffer_append_memory(b, s, s_len);
}
@@ -284,7 +281,7 @@ int buffer_append_long_hex(buffer *b, unsigned long value) {
return 0;
}
-int LI_ltostr(char *buf, long val) {
+int ltostr(char *buf, long val) {
char swap;
char *end;
int len = 1;
@@ -323,7 +320,7 @@ int buffer_append_long(buffer *b, long val) {
if (b->used == 0)
b->used++;
- b->used += LI_ltostr(b->ptr + (b->used - 1), val);
+ b->used += ltostr(b->ptr + (b->used - 1), val);
return 0;
}
@@ -405,46 +402,46 @@ char hex2int(unsigned char hex) {
/**
- * init the buffer
- *
+ * init the buffer
+ *
*/
buffer_array* buffer_array_init(void) {
buffer_array *b;
-
+
b = malloc(sizeof(*b));
-
+
assert(b);
b->ptr = NULL;
b->size = 0;
b->used = 0;
-
+
return b;
}
void buffer_array_reset(buffer_array *b) {
size_t i;
-
+
if (!b) return;
-
+
/* if they are too large, reduce them */
for (i = 0; i < b->used; i++) {
buffer_reset(b->ptr[i]);
}
-
+
b->used = 0;
}
/**
- * free the buffer_array
- *
+ * free the buffer_array
+ *
*/
void buffer_array_free(buffer_array *b) {
size_t i;
if (!b) return;
-
+
for (i = 0; i < b->size; i++) {
if (b->ptr[i]) buffer_free(b->ptr[i]);
}
@@ -454,7 +451,7 @@ void buffer_array_free(buffer_array *b) {
buffer *buffer_array_append_get_buffer(buffer_array *b) {
size_t i;
-
+
if (b->size == 0) {
b->size = 16;
b->ptr = malloc(sizeof(*b->ptr) * b->size);
@@ -470,13 +467,13 @@ buffer *buffer_array_append_get_buffer(buffer_array *b) {
b->ptr[i] = NULL;
}
}
-
+
if (b->ptr[b->used] == NULL) {
b->ptr[b->used] = buffer_init();
}
-
+
b->ptr[b->used]->used = 0;
-
+
return b->ptr[b->used++];
}
@@ -485,34 +482,33 @@ char * buffer_search_string_len(buffer *b, const char *needle, size_t len) {
size_t i;
if (len == 0) return NULL;
if (needle == NULL) return NULL;
-
+
if (b->used < len) return NULL;
-
+
for(i = 0; i < b->used - len; i++) {
if (0 == memcmp(b->ptr + i, needle, len)) {
return b->ptr + i;
}
}
-
+
return NULL;
}
buffer *buffer_init_string(const char *str) {
buffer *b = buffer_init();
-
+
buffer_copy_string(b, str);
-
+
return b;
}
int buffer_is_empty(buffer *b) {
- if (!b) return 1;
return (b->used == 0);
}
/**
* check if two buffer contain the same data
- *
+ *
* HISTORY: this function was pretty much optimized, but didn't handled
* alignment properly.
*/
@@ -526,121 +522,115 @@ int buffer_is_equal(buffer *a, buffer *b) {
int buffer_is_equal_string(buffer *a, const char *s, size_t b_len) {
buffer b;
-
+
b.ptr = (char *)s;
b.used = b_len + 1;
-
+
return buffer_is_equal(a, &b);
}
/* simple-assumption:
- *
+ *
* most parts are equal and doing a case conversion needs time
- *
+ *
*/
int buffer_caseless_compare(const char *a, size_t a_len, const char *b, size_t b_len) {
size_t ndx = 0, max_ndx;
size_t *al, *bl;
size_t mask = sizeof(*al) - 1;
-
+
al = (size_t *)a;
bl = (size_t *)b;
-
+
/* is the alignment correct ? */
if ( ((size_t)al & mask) == 0 &&
((size_t)bl & mask) == 0 ) {
-
+
max_ndx = ((a_len < b_len) ? a_len : b_len) & ~mask;
-
+
for (; ndx < max_ndx; ndx += sizeof(*al)) {
if (*al != *bl) break;
al++; bl++;
-
+
}
-
+
}
-
+
a = (char *)al;
b = (char *)bl;
-
+
max_ndx = ((a_len < b_len) ? a_len : b_len);
-
+
for (; ndx < max_ndx; ndx++) {
- int a1 = *a++, b1 = *b++;
-
+ char a1 = *a++, b1 = *b++;
+
if (a1 != b1) {
- /* always lowercase for transitive results */
- if (a1 >= 'A' && a1 <= 'Z') a1 |= 32;
- if (b1 >= 'A' && b1 <= 'Z') b1 |= 32;
-
+ if ((a1 >= 'A' && a1 <= 'Z') && (b1 >= 'a' && b1 <= 'z'))
+ a1 |= 32;
+ else if ((a1 >= 'a' && a1 <= 'z') && (b1 >= 'A' && b1 <= 'Z'))
+ b1 |= 32;
if ((a1 - b1) != 0) return (a1 - b1);
+
}
}
-
- /* all chars are the same, and the length match too
- *
- * they are the same */
- if (a_len == b_len) return 0;
-
- /* if a is shorter then b, then b is larger */
- return (a_len - b_len);
+
+ return 0;
}
/**
* check if the rightmost bytes of the string are equal.
- *
- *
+ *
+ *
*/
int buffer_is_equal_right_len(buffer *b1, buffer *b2, size_t len) {
/* no, len -> equal */
if (len == 0) return 1;
-
+
/* len > 0, but empty buffers -> not equal */
if (b1->used == 0 || b2->used == 0) return 0;
-
+
/* buffers too small -> not equal */
if (b1->used - 1 < len || b1->used - 1 < len) return 0;
-
- if (0 == strncmp(b1->ptr + b1->used - 1 - len,
+
+ if (0 == strncmp(b1->ptr + b1->used - 1 - len,
b2->ptr + b2->used - 1 - len, len)) {
return 1;
}
-
+
return 0;
}
int buffer_copy_string_hex(buffer *b, const char *in, size_t in_len) {
size_t i;
-
+
/* BO protection */
if (in_len * 2 < in_len) return -1;
-
+
buffer_prepare_copy(b, in_len * 2 + 1);
-
+
for (i = 0; i < in_len; i++) {
b->ptr[b->used++] = hex_chars[(in[i] >> 4) & 0x0F];
b->ptr[b->used++] = hex_chars[in[i] & 0x0F];
}
b->ptr[b->used++] = '\0';
-
+
return 0;
}
-/* everything except: ! ( ) * - . 0-9 A-Z _ a-z */
const char encoded_chars_rel_uri_part[] = {
/*
0 1 2 3 4 5 6 7 8 9 A B C D E F
*/
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 00 - 0F control chars */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 10 - 1F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 10 - 1F */
1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, /* 20 - 2F space " # $ % & ' + , / */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, /* 30 - 3F : ; < = > ? */
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 40 - 4F @ */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, /* 50 - 5F [ \ ] ^ */
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 60 - 6F ` */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, /* 70 - 7F { | } ~ DEL */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, /* 30 - 3F : ; = ? @ < > */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 40 - 4F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 50 - 5F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 60 - 6F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* 70 - 7F DEL */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 80 - 8F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 90 - 9F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* A0 - AF */
@@ -651,19 +641,18 @@ const char encoded_chars_rel_uri_part[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* F0 - FF */
};
-/* everything except: ! ( ) * - . / 0-9 A-Z _ a-z */
const char encoded_chars_rel_uri[] = {
/*
0 1 2 3 4 5 6 7 8 9 A B C D E F
*/
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 00 - 0F control chars */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 10 - 1F */
- 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, /* 20 - 2F space " # $ % & ' + , */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, /* 30 - 3F : ; < = > ? */
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 40 - 4F @ */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, /* 50 - 5F [ \ ] ^ */
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 60 - 6F ` */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, /* 70 - 7F { | } ~ DEL */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 10 - 1F */
+ 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, /* 20 - 2F space " # $ % & ' + , / */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, /* 30 - 3F : ; = ? @ < > */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 40 - 4F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 50 - 5F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 60 - 6F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* 70 - 7F DEL */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 80 - 8F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 90 - 9F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* A0 - AF */
@@ -679,7 +668,7 @@ const char encoded_chars_html[] = {
0 1 2 3 4 5 6 7 8 9 A B C D E F
*/
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 00 - 0F control chars */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 10 - 1F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 10 - 1F */
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 20 - 2F & */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, /* 30 - 3F < > */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 40 - 4F */
@@ -696,39 +685,17 @@ const char encoded_chars_html[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* F0 - FF */
};
-const char encoded_chars_minimal_xml[] = {
- /*
- 0 1 2 3 4 5 6 7 8 9 A B C D E F
- */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 00 - 0F control chars */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 10 - 1F */
- 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 20 - 2F & */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, /* 30 - 3F < > */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 40 - 4F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 50 - 5F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 60 - 6F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* 70 - 7F DEL */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */
-};
-
const char encoded_chars_hex[] = {
/*
0 1 2 3 4 5 6 7 8 9 A B C D E F
*/
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 00 - 0F control chars */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 10 - 1F */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 30 - 3F */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 10 - 1F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 30 - 3F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 70 - 7F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 80 - 8F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 90 - 9F */
@@ -740,41 +707,18 @@ const char encoded_chars_hex[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* F0 - FF */
};
-const char encoded_chars_http_header[] = {
- /*
- 0 1 2 3 4 5 6 7 8 9 A B C D E F
- */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, /* 00 - 0F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 20 - 2F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 30 - 3F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 40 - 4F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 50 - 5F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 60 - 6F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 70 - 7F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */
-};
-
-
int buffer_append_string_encoded(buffer *b, const char *s, size_t s_len, buffer_encoding_t encoding) {
unsigned char *ds, *d;
size_t d_len, ndx;
const char *map = NULL;
-
+
if (!s || !b) return -1;
-
+
if (b->ptr[b->used - 1] != '\0') {
SEGFAULT();
}
-
+
if (s_len == 0) return 0;
switch(encoding) {
@@ -787,21 +731,15 @@ int buffer_append_string_encoded(buffer *b, const char *s, size_t s_len, buffer_
case ENCODING_HTML:
map = encoded_chars_html;
break;
- case ENCODING_MINIMAL_XML:
- map = encoded_chars_minimal_xml;
- break;
case ENCODING_HEX:
map = encoded_chars_hex;
break;
- case ENCODING_HTTP_HEADER:
- map = encoded_chars_http_header;
- break;
case ENCODING_UNSET:
break;
}
assert(map != NULL);
-
+
/* count to-be-encoded-characters */
for (ds = (unsigned char *)s, d_len = 0, ndx = 0; ndx < s_len; ds++, ndx++) {
if (map[*ds]) {
@@ -811,10 +749,8 @@ int buffer_append_string_encoded(buffer *b, const char *s, size_t s_len, buffer_
d_len += 3;
break;
case ENCODING_HTML:
- case ENCODING_MINIMAL_XML:
d_len += 6;
break;
- case ENCODING_HTTP_HEADER:
case ENCODING_HEX:
d_len += 2;
break;
@@ -825,9 +761,9 @@ int buffer_append_string_encoded(buffer *b, const char *s, size_t s_len, buffer_
d_len ++;
}
}
-
+
buffer_prepare_append(b, d_len);
-
+
for (ds = (unsigned char *)s, d = (unsigned char *)b->ptr + b->used - 1, d_len = 0, ndx = 0; ndx < s_len; ds++, ndx++) {
if (map[*ds]) {
switch(encoding) {
@@ -838,7 +774,6 @@ int buffer_append_string_encoded(buffer *b, const char *s, size_t s_len, buffer_
d[d_len++] = hex_chars[(*ds) & 0x0F];
break;
case ENCODING_HTML:
- case ENCODING_MINIMAL_XML:
d[d_len++] = '&';
d[d_len++] = '#';
d[d_len++] = 'x';
@@ -850,10 +785,6 @@ int buffer_append_string_encoded(buffer *b, const char *s, size_t s_len, buffer_
d[d_len++] = hex_chars[((*ds) >> 4) & 0x0F];
d[d_len++] = hex_chars[(*ds) & 0x0F];
break;
- case ENCODING_HTTP_HEADER:
- d[d_len++] = *ds;
- d[d_len++] = '\t';
- break;
case ENCODING_UNSET:
break;
}
@@ -862,9 +793,9 @@ int buffer_append_string_encoded(buffer *b, const char *s, size_t s_len, buffer_
}
}
- /* terminate buffer and calculate new length */
+ /* terminate buffer and calculate new length */
b->ptr[b->used + d_len - 1] = '\0';
-
+
b->used += d_len;
return 0;
@@ -896,10 +827,10 @@ static int buffer_urldecode_internal(buffer *url, int is_query) {
low = hex2int(*(src + 2));
if (low != 0xFF) {
high = (high << 4) | low;
-
- /* map control-characters out */
+
+ /* map control-characters out */
if (high < 32 || high == 127) high = '_';
-
+
*dst = high;
src += 2;
}
@@ -956,18 +887,6 @@ int buffer_path_simplify(buffer *dest, buffer *src)
start = dest->ptr;
out = dest->ptr;
slash = dest->ptr;
-
-
-#if defined(__WIN32) || defined(__CYGWIN__)
- /* cygwin is treating \ and / the same, so we have to that too
- */
-
- for (walk = src->ptr; *walk; walk++) {
- if (*walk == '\\') *walk = '/';
- }
- walk = src->ptr;
-#endif
-
while (*walk == ' ') {
walk++;
}
@@ -1033,7 +952,7 @@ int light_isdigit(int c) {
int light_isxdigit(int c) {
if (light_isdigit(c)) return 1;
-
+
c |= 32;
return (c >= 'a' && c <= 'f');
}
@@ -1049,29 +968,29 @@ int light_isalnum(int c) {
int buffer_to_lower(buffer *b) {
char *c;
-
+
if (b->used == 0) return 0;
-
+
for (c = b->ptr; *c; c++) {
if (*c >= 'A' && *c <= 'Z') {
*c |= 32;
}
}
-
+
return 0;
}
int buffer_to_upper(buffer *b) {
char *c;
-
+
if (b->used == 0) return 0;
-
+
for (c = b->ptr; *c; c++) {
if (*c >= 'a' && *c <= 'z') {
*c &= ~32;
}
}
-
+
return 0;
}
diff --git a/src/buffer.h b/src/buffer.h
index bda0424..c304d76 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -1,35 +1,34 @@
#ifndef _BUFFER_H_
#define _BUFFER_H_
+#include <stdlib.h>
+#include <sys/types.h>
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "settings.h"
-#include <stdlib.h>
-#include <sys/types.h>
-#include <stdio.h>
-
typedef struct {
char *ptr;
-
+
size_t used;
size_t size;
} buffer;
typedef struct {
buffer **ptr;
-
+
size_t used;
size_t size;
} buffer_array;
typedef struct {
char *ptr;
-
+
size_t offset; /* input-pointer */
-
+
size_t used; /* output-pointer */
size_t size;
} read_buffer;
@@ -44,7 +43,7 @@ buffer* buffer_init_buffer(buffer *b);
buffer* buffer_init_string(const char *str);
void buffer_free(buffer *b);
void buffer_reset(buffer *b);
-
+
int buffer_prepare_copy(buffer *b, size_t size);
int buffer_prepare_append(buffer *b, size_t size);
@@ -88,10 +87,8 @@ typedef enum {
ENCODING_UNSET,
ENCODING_REL_URI, /* for coding a rel-uri (/with space/and%percent) nicely as part of a href */
ENCODING_REL_URI_PART, /* same as ENC_REL_URL plus coding / too as %2F */
- ENCODING_HTML, /* & becomes &amp; and so on */
- ENCODING_MINIMAL_XML, /* minimal encoding for xml */
- ENCODING_HEX, /* encode string as hex */
- ENCODING_HTTP_HEADER /* encode \n with \t\n */
+ ENCODING_HTML, /* & becomes &amp; and so on */
+ ENCODING_HEX /* encode string as hex */
} buffer_encoding_t;
int buffer_append_string_encoded(buffer *b, const char *s, size_t s_len, buffer_encoding_t encoding);
@@ -104,7 +101,7 @@ int buffer_to_lower(buffer *b);
int buffer_to_upper(buffer *b);
/** deprecated */
-int LI_ltostr(char *buf, long val);
+int ltostr(char *buf, long val);
char hex2int(unsigned char c);
char int2hex(char i);
diff --git a/src/chunk.c b/src/chunk.c
index 7583db6..3903428 100644
--- a/src/chunk.c
+++ b/src/chunk.c
@@ -1,11 +1,9 @@
/**
* the network chunk-API
- *
- *
+ *
+ *
*/
-#include "chunk.h"
-
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
@@ -18,36 +16,38 @@
#include <errno.h>
#include <string.h>
+#include "chunk.h"
+
chunkqueue *chunkqueue_init(void) {
chunkqueue *cq;
-
+
cq = calloc(1, sizeof(*cq));
-
+
cq->first = NULL;
cq->last = NULL;
-
+
cq->unused = NULL;
-
+
return cq;
}
static chunk *chunk_init(void) {
chunk *c;
-
+
c = calloc(1, sizeof(*c));
-
+
c->mem = buffer_init();
c->file.name = buffer_init();
c->file.fd = -1;
c->file.mmap.start = MAP_FAILED;
c->next = NULL;
-
+
return c;
}
static void chunk_free(chunk *c) {
if (!c) return;
-
+
buffer_free(c->mem);
buffer_free(c->file.name);
@@ -56,13 +56,13 @@ static void chunk_free(chunk *c) {
static void chunk_reset(chunk *c) {
if (!c) return;
-
+
buffer_reset(c->mem);
if (c->file.is_temp && !buffer_is_empty(c->file.name)) {
unlink(c->file.name->ptr);
}
-
+
buffer_reset(c->file.name);
if (c->file.fd != -1) {
@@ -78,27 +78,27 @@ static void chunk_reset(chunk *c) {
void chunkqueue_free(chunkqueue *cq) {
chunk *c, *pc;
-
+
if (!cq) return;
-
+
for (c = cq->first; c; ) {
pc = c;
c = c->next;
chunk_free(pc);
}
-
+
for (c = cq->unused; c; ) {
pc = c;
c = c->next;
chunk_free(pc);
}
-
+
free(cq);
}
static chunk *chunkqueue_get_unused_chunk(chunkqueue *cq) {
chunk *c;
-
+
/* check if we have a unused chunk */
if (!cq->unused) {
c = chunk_init();
@@ -109,18 +109,18 @@ static chunk *chunkqueue_get_unused_chunk(chunkqueue *cq) {
c->next = NULL;
cq->unused_chunks--;
}
-
+
return c;
}
static int chunkqueue_prepend_chunk(chunkqueue *cq, chunk *c) {
c->next = cq->first;
cq->first = c;
-
+
if (cq->last == NULL) {
cq->last = c;
}
-
+
return 0;
}
@@ -129,19 +129,19 @@ static int chunkqueue_append_chunk(chunkqueue *cq, chunk *c) {
cq->last->next = c;
}
cq->last = c;
-
+
if (cq->first == NULL) {
cq->first = c;
}
-
+
return 0;
}
void chunkqueue_reset(chunkqueue *cq) {
chunk *c;
/* move everything to the unused queue */
-
- /* mark all read written */
+
+ /* mark all read written */
for (c = cq->first; c; c = c->next) {
switch(c->type) {
case MEM_CHUNK:
@@ -150,7 +150,7 @@ void chunkqueue_reset(chunkqueue *cq) {
case FILE_CHUNK:
c->offset = c->file.length;
break;
- default:
+ default:
break;
}
}
@@ -162,108 +162,93 @@ void chunkqueue_reset(chunkqueue *cq) {
int chunkqueue_append_file(chunkqueue *cq, buffer *fn, off_t offset, off_t len) {
chunk *c;
-
+
if (len == 0) return 0;
-
+
c = chunkqueue_get_unused_chunk(cq);
-
+
c->type = FILE_CHUNK;
-
+
buffer_copy_string_buffer(c->file.name, fn);
c->file.start = offset;
c->file.length = len;
c->offset = 0;
-
+
chunkqueue_append_chunk(cq, c);
-
+
return 0;
}
int chunkqueue_append_buffer(chunkqueue *cq, buffer *mem) {
chunk *c;
-
+
if (mem->used == 0) return 0;
-
+
c = chunkqueue_get_unused_chunk(cq);
c->type = MEM_CHUNK;
c->offset = 0;
buffer_copy_string_buffer(c->mem, mem);
-
- chunkqueue_append_chunk(cq, c);
-
- return 0;
-}
-
-int chunkqueue_append_buffer_weak(chunkqueue *cq, buffer *mem) {
- chunk *c;
-
- c = chunkqueue_get_unused_chunk(cq);
- c->type = MEM_CHUNK;
- c->offset = 0;
- if (c->mem) buffer_free(c->mem);
- c->mem = mem;
-
+
chunkqueue_append_chunk(cq, c);
-
+
return 0;
}
int chunkqueue_prepend_buffer(chunkqueue *cq, buffer *mem) {
chunk *c;
-
+
if (mem->used == 0) return 0;
-
+
c = chunkqueue_get_unused_chunk(cq);
c->type = MEM_CHUNK;
c->offset = 0;
buffer_copy_string_buffer(c->mem, mem);
-
+
chunkqueue_prepend_chunk(cq, c);
-
+
return 0;
}
-
int chunkqueue_append_mem(chunkqueue *cq, const char * mem, size_t len) {
chunk *c;
-
+
if (len == 0) return 0;
-
+
c = chunkqueue_get_unused_chunk(cq);
c->type = MEM_CHUNK;
c->offset = 0;
buffer_copy_string_len(c->mem, mem, len - 1);
-
+
chunkqueue_append_chunk(cq, c);
-
+
return 0;
}
buffer * chunkqueue_get_prepend_buffer(chunkqueue *cq) {
chunk *c;
-
+
c = chunkqueue_get_unused_chunk(cq);
-
+
c->type = MEM_CHUNK;
c->offset = 0;
buffer_reset(c->mem);
-
+
chunkqueue_prepend_chunk(cq, c);
-
+
return c->mem;
}
buffer *chunkqueue_get_append_buffer(chunkqueue *cq) {
chunk *c;
-
+
c = chunkqueue_get_unused_chunk(cq);
-
+
c->type = MEM_CHUNK;
c->offset = 0;
buffer_reset(c->mem);
-
+
chunkqueue_append_chunk(cq, c);
-
+
return c->mem;
}
@@ -278,7 +263,7 @@ int chunkqueue_set_tempdirs(chunkqueue *cq, array *tempdirs) {
chunk *chunkqueue_get_append_tempfile(chunkqueue *cq) {
chunk *c;
buffer *template = buffer_init_string("/var/tmp/lighttpd-upload-XXXXXX");
-
+
c = chunkqueue_get_unused_chunk(cq);
c->type = FILE_CHUNK;
@@ -288,13 +273,13 @@ chunk *chunkqueue_get_append_tempfile(chunkqueue *cq) {
size_t i;
/* we have several tempdirs, only if all of them fail we jump out */
-
+
for (i = 0; i < cq->tempdirs->used; i++) {
data_string *ds = (data_string *)cq->tempdirs->data[i];
buffer_copy_string_buffer(template, ds->value);
BUFFER_APPEND_SLASH(template);
- buffer_append_string_len(template, CONST_STR_LEN("lighttpd-upload-XXXXXX"));
+ BUFFER_APPEND_STRING_CONST(template, "lighttpd-upload-XXXXXX");
if (-1 != (c->file.fd = mkstemp(template->ptr))) {
/* only trigger the unlink if we created the temp-file successfully */
@@ -315,7 +300,7 @@ chunk *chunkqueue_get_append_tempfile(chunkqueue *cq) {
chunkqueue_append_chunk(cq, c);
buffer_free(template);
-
+
return c;
}
@@ -323,7 +308,7 @@ chunk *chunkqueue_get_append_tempfile(chunkqueue *cq) {
off_t chunkqueue_length(chunkqueue *cq) {
off_t len = 0;
chunk *c;
-
+
for (c = cq->first; c; c = c->next) {
switch (c->type) {
case MEM_CHUNK:
@@ -336,14 +321,14 @@ off_t chunkqueue_length(chunkqueue *cq) {
break;
}
}
-
+
return len;
}
off_t chunkqueue_written(chunkqueue *cq) {
off_t len = 0;
chunk *c;
-
+
for (c = cq->first; c; c = c->next) {
switch (c->type) {
case MEM_CHUNK:
@@ -354,7 +339,7 @@ off_t chunkqueue_written(chunkqueue *cq) {
break;
}
}
-
+
return len;
}
@@ -370,12 +355,12 @@ int chunkqueue_remove_finished_chunks(chunkqueue *cq) {
switch (c->type) {
case MEM_CHUNK:
- if (c->mem->used == 0 || (c->offset == (off_t)c->mem->used - 1)) is_finished = 1;
+ if (c->offset == (off_t)c->mem->used - 1) is_finished = 1;
break;
case FILE_CHUNK:
- if (c->offset == c->file.length) is_finished = 1;
+ if (c->offset == c->file.length) is_finished = 1;
break;
- default:
+ default:
break;
}
diff --git a/src/chunk.h b/src/chunk.h
index e43d3eb..ddc8617 100644
--- a/src/chunk.h
+++ b/src/chunk.h
@@ -3,11 +3,10 @@
#include "buffer.h"
#include "array.h"
-#include "sys-mmap.h"
typedef struct chunk {
enum { UNUSED_CHUNK, MEM_CHUNK, FILE_CHUNK } type;
-
+
buffer *mem; /* either the storage of the mem-chunk or the read-ahead buffer */
struct {
@@ -17,7 +16,7 @@ typedef struct chunk {
off_t length; /* octets to send from the starting offset */
int fd;
- struct {
+ struct {
char *start; /* the start pointer of the mmap'ed area */
size_t length; /* size of the mmap'ed area */
off_t offset; /* start is <n> octet away from the start of the file */
@@ -25,20 +24,20 @@ typedef struct chunk {
int is_temp; /* file is temporary and will be deleted if on cleanup */
} file;
-
- off_t offset; /* octets sent from this chunk
- the size of the chunk is either
+
+ off_t offset; /* octets sent from this chunk
+ the size of the chunk is either
- mem-chunk: mem->used - 1
- file-chunk: file.length
*/
-
+
struct chunk *next;
} chunk;
typedef struct {
chunk *first;
chunk *last;
-
+
chunk *unused;
size_t unused_chunks;
@@ -52,7 +51,6 @@ int chunkqueue_set_tempdirs(chunkqueue *c, array *tempdirs);
int chunkqueue_append_file(chunkqueue *c, buffer *fn, off_t offset, off_t len);
int chunkqueue_append_mem(chunkqueue *c, const char *mem, size_t len);
int chunkqueue_append_buffer(chunkqueue *c, buffer *mem);
-int chunkqueue_append_buffer_weak(chunkqueue *c, buffer *mem);
int chunkqueue_prepend_buffer(chunkqueue *c, buffer *mem);
buffer * chunkqueue_get_append_buffer(chunkqueue *c);
diff --git a/src/configfile-glue.c b/src/configfile-glue.c
index 782eb81..5c3c68b 100644
--- a/src/configfile-glue.c
+++ b/src/configfile-glue.c
@@ -1,23 +1,20 @@
+#include <string.h>
+
#include "base.h"
#include "buffer.h"
#include "array.h"
#include "log.h"
#include "plugin.h"
-#include "configfile.h"
-
-#include <string.h>
-#include <stdlib.h>
-
/**
* like all glue code this file contains functions which
* are the external interface of lighttpd. The functions
* are used by the server itself and the plugins.
*
- * The main-goal is to have a small library in the end
- * which is linked against both and which will define
+ * The main-goal is to have a small library in the end
+ * which is linked against both and which will define
* the interface itself in the end.
- *
+ *
*/
@@ -27,56 +24,56 @@
int config_insert_values_internal(server *srv, array *ca, const config_values_t cv[]) {
size_t i;
data_unset *du;
-
+
for (i = 0; cv[i].key; i++) {
-
+
if (NULL == (du = array_get_element(ca, cv[i].key))) {
/* no found */
-
+
continue;
}
-
+
switch (cv[i].type) {
case T_CONFIG_ARRAY:
if (du->type == TYPE_ARRAY) {
size_t j;
data_array *da = (data_array *)du;
-
+
for (j = 0; j < da->value->used; j++) {
if (da->value->data[j]->type == TYPE_STRING) {
data_string *ds = data_string_init();
-
+
buffer_copy_string_buffer(ds->value, ((data_string *)(da->value->data[j]))->value);
if (!da->is_index_key) {
/* the id's were generated automaticly, as we copy now we might have to renumber them
- * this is used to prepend server.modules by mod_indexfile as it has to be loaded
+ * this is used to prepend server.modules by mod_indexfiles as it has to be loaded
* before mod_fastcgi and friends */
buffer_copy_string_buffer(ds->key, ((data_string *)(da->value->data[j]))->key);
}
-
+
array_insert_unique(cv[i].destination, (data_unset *)ds);
} else {
- log_error_write(srv, __FILE__, __LINE__, "sssd",
- "the key of an array can only be a string or a integer, variable:",
- cv[i].key, "type:", da->value->data[j]->type);
-
+ log_error_write(srv, __FILE__, __LINE__, "sssd",
+ "the key of and array can only be a string or a integer, variable:",
+ cv[i].key, "type:", da->value->data[j]->type);
+
return -1;
}
}
} else {
- log_error_write(srv, __FILE__, __LINE__, "ss", cv[i].key, "should have been a array of strings like ... = ( \"...\" )");
-
+ log_error_write(srv, __FILE__, __LINE__, "sss", "unexpected type for key: ", cv[i].key, "array of strings");
+
return -1;
}
break;
case T_CONFIG_STRING:
if (du->type == TYPE_STRING) {
data_string *ds = (data_string *)du;
-
+
buffer_copy_string_buffer(cv[i].destination, ds->value);
} else {
- log_error_write(srv, __FILE__, __LINE__, "ssss", cv[i].key, "should have been a string like ... = \"...\"");
-
+ log_error_write(srv, __FILE__, __LINE__, "ssss", "unexpected type for key: ", cv[i].key, "(string)", "\"...\"");
+
return -1;
}
break;
@@ -84,133 +81,81 @@ int config_insert_values_internal(server *srv, array *ca, const config_values_t
switch(du->type) {
case TYPE_INTEGER: {
data_integer *di = (data_integer *)du;
-
+
*((unsigned short *)(cv[i].destination)) = di->value;
break;
}
case TYPE_STRING: {
data_string *ds = (data_string *)du;
-
- /* If the value came from an environment variable, then it is a
- * data_string, although it may contain a number in ASCII
- * decimal format. We try to interpret the string as a decimal
- * short before giving up, in order to support setting numeric
- * values with environment variables (eg, port number).
- */
- if (ds->value->ptr && *ds->value->ptr) {
- char *e;
- long l = strtol(ds->value->ptr, &e, 10);
- if (e != ds->value->ptr && !*e && l >=0 && l <= 65535) {
- *((unsigned short *)(cv[i].destination)) = l;
- break;
- }
- }
-
- log_error_write(srv, __FILE__, __LINE__, "ssb", "got a string but expected a short:", cv[i].key, ds->value);
-
- return -1;
- }
- default:
- log_error_write(srv, __FILE__, __LINE__, "ssds", "unexpected type for key:", cv[i].key, du->type, "expected a short integer, range 0 ... 65535");
- return -1;
- }
- break;
- case T_CONFIG_INT:
- switch(du->type) {
- case TYPE_INTEGER: {
- data_integer *di = (data_integer *)du;
-
- *((unsigned int *)(cv[i].destination)) = di->value;
- break;
- }
- case TYPE_STRING: {
- data_string *ds = (data_string *)du;
-
- if (ds->value->ptr && *ds->value->ptr) {
- char *e;
- long l = strtol(ds->value->ptr, &e, 10);
- if (e != ds->value->ptr && !*e && l >= 0) {
- *((unsigned int *)(cv[i].destination)) = l;
- break;
- }
- }
-
-
- log_error_write(srv, __FILE__, __LINE__, "ssb", "got a string but expected an integer:", cv[i].key, ds->value);
-
+
+ log_error_write(srv, __FILE__, __LINE__, "ssb", "get a string but expected a short:", cv[i].key, ds->value);
+
return -1;
}
default:
- log_error_write(srv, __FILE__, __LINE__, "ssds", "unexpected type for key:", cv[i].key, du->type, "expected an integer, range 0 ... 4294967295");
+ log_error_write(srv, __FILE__, __LINE__, "ssds", "unexpected type for key:", cv[i].key, du->type, "expected a integer, range 0 ... 65535");
return -1;
}
break;
case T_CONFIG_BOOLEAN:
if (du->type == TYPE_STRING) {
data_string *ds = (data_string *)du;
-
+
if (buffer_is_equal_string(ds->value, CONST_STR_LEN("enable"))) {
*((unsigned short *)(cv[i].destination)) = 1;
} else if (buffer_is_equal_string(ds->value, CONST_STR_LEN("disable"))) {
*((unsigned short *)(cv[i].destination)) = 0;
} else {
log_error_write(srv, __FILE__, __LINE__, "ssbs", "ERROR: unexpected value for key:", cv[i].key, ds->value, "(enable|disable)");
-
+
return -1;
}
} else {
log_error_write(srv, __FILE__, __LINE__, "ssss", "ERROR: unexpected type for key:", cv[i].key, "(string)", "\"(enable|disable)\"");
-
+
return -1;
}
break;
case T_CONFIG_LOCAL:
case T_CONFIG_UNSET:
break;
- case T_CONFIG_UNSUPPORTED:
- log_error_write(srv, __FILE__, __LINE__, "ssss", "ERROR: found unsupported key:", cv[i].key, "-", (char *)(cv[i].destination));
-
- srv->config_unsupported = 1;
-
- break;
case T_CONFIG_DEPRECATED:
log_error_write(srv, __FILE__, __LINE__, "ssss", "ERROR: found deprecated key:", cv[i].key, "-", (char *)(cv[i].destination));
-
+
srv->config_deprecated = 1;
-
+
break;
}
}
-
return 0;
}
int config_insert_values_global(server *srv, array *ca, const config_values_t cv[]) {
size_t i;
data_unset *du;
-
+
for (i = 0; cv[i].key; i++) {
data_string *touched;
-
+
if (NULL == (du = array_get_element(ca, cv[i].key))) {
/* no found */
-
+
continue;
}
-
+
/* touched */
touched = data_string_init();
-
- buffer_copy_string_len(touched->value, CONST_STR_LEN(""));
+
+ buffer_copy_string(touched->value, "");
buffer_copy_string_buffer(touched->key, du->key);
-
+
array_insert_unique(srv->config_touched, (data_unset *)touched);
}
-
+
return config_insert_values_internal(srv, ca, cv);
}
-static unsigned short sock_addr_get_port(sock_addr *addr) {
+unsigned short sock_addr_get_port(sock_addr *addr) {
#ifdef HAVE_IPV6
return ntohs(addr->plain.sa_family ? addr->ipv6.sin6_port : addr->ipv4.sin_port);
#else
@@ -223,82 +168,48 @@ static cond_result_t config_check_cond_cached(server *srv, connection *con, data
static cond_result_t config_check_cond_nocache(server *srv, connection *con, data_config *dc) {
buffer *l;
server_socket *srv_sock = con->srv_socket;
-
/* check parent first */
if (dc->parent && dc->parent->context_ndx) {
- /**
- * a nested conditional
- *
- * if the parent is not decided yet or false, we can't be true either
- */
if (con->conf.log_condition_handling) {
log_error_write(srv, __FILE__, __LINE__, "sb", "go parent", dc->parent->key);
}
-
- switch (config_check_cond_cached(srv, con, dc->parent)) {
- case COND_RESULT_FALSE:
+ if (config_check_cond_cached(srv, con, dc->parent) == COND_RESULT_FALSE) {
return COND_RESULT_FALSE;
- case COND_RESULT_UNSET:
- return COND_RESULT_UNSET;
- default:
- break;
}
}
if (dc->prev) {
- /**
- * a else branch
- *
- * we can only be executed, if all of our previous brothers
- * are false
- */
if (con->conf.log_condition_handling) {
log_error_write(srv, __FILE__, __LINE__, "sb", "go prev", dc->prev->key);
}
-
/* make sure prev is checked first */
config_check_cond_cached(srv, con, dc->prev);
-
/* one of prev set me to FALSE */
- switch (con->cond_cache[dc->context_ndx].result) {
- case COND_RESULT_FALSE:
- return con->cond_cache[dc->context_ndx].result;
- default:
- break;
- }
- }
-
- if (!con->conditional_is_valid[dc->comp]) {
- if (con->conf.log_condition_handling) {
- log_error_write(srv, __FILE__, __LINE__, "dss",
- dc->comp,
- dc->key->ptr,
- con->conditional_is_valid[dc->comp] ? "yeah" : "nej");
+ if (COND_RESULT_FALSE == con->cond_cache[dc->context_ndx].result) {
+ return COND_RESULT_FALSE;
}
-
- return COND_RESULT_UNSET;
}
/* pass the rules */
-
+
switch (dc->comp) {
case COMP_HTTP_HOST: {
char *ck_colon = NULL, *val_colon = NULL;
-
+
if (!buffer_is_empty(con->uri.authority)) {
-
- /*
+
+ /*
* append server-port to the HTTP_POST if necessary
*/
-
+
l = con->uri.authority;
-
+
switch(dc->cond) {
case CONFIG_COND_NE:
case CONFIG_COND_EQ:
ck_colon = strchr(dc->string->ptr, ':');
val_colon = strchr(l->ptr, ':');
-
+
if (ck_colon == val_colon) {
/* nothing to do with it */
break;
@@ -306,7 +217,7 @@ static cond_result_t config_check_cond_nocache(server *srv, connection *con, dat
if (ck_colon) {
/* condition "host:port" but client send "host" */
buffer_copy_string_buffer(srv->cond_check_buf, l);
- buffer_append_string_len(srv->cond_check_buf, CONST_STR_LEN(":"));
+ BUFFER_APPEND_STRING_CONST(srv->cond_check_buf, ":");
buffer_append_long(srv->cond_check_buf, sock_addr_get_port(&(srv_sock->addr)));
l = srv->cond_check_buf;
} else if (!ck_colon) {
@@ -318,26 +229,22 @@ static cond_result_t config_check_cond_nocache(server *srv, connection *con, dat
default:
break;
}
-#if defined USE_OPENSSL && ! defined OPENSSL_NO_TLSEXT
- } else if (!buffer_is_empty(con->tlsext_server_name)) {
- l = con->tlsext_server_name;
-#endif
} else {
- l = srv->empty_string;
+ l = NULL;
}
break;
}
- case COMP_HTTP_REMOTE_IP: {
+ case COMP_HTTP_REMOTEIP: {
char *nm_slash;
- /* handle remoteip limitations
- *
+ /* handle remoteip limitations
+ *
* "10.0.0.1" is provided for all comparisions
- *
+ *
* only for == and != we support
- *
+ *
* "10.0.0.1/24"
*/
-
+
if ((dc->cond == CONFIG_COND_EQ ||
dc->cond == CONFIG_COND_NE) &&
(con->dst_addr.plain.sa_family == AF_INET) &&
@@ -346,41 +253,41 @@ static cond_result_t config_check_cond_nocache(server *srv, connection *con, dat
long nm;
char *err;
struct in_addr val_inp;
-
+
if (*(nm_slash+1) == '\0') {
log_error_write(srv, __FILE__, __LINE__, "sb", "ERROR: no number after / ", dc->string);
-
+
return COND_RESULT_FALSE;
}
-
+
nm_bits = strtol(nm_slash + 1, &err, 10);
-
+
if (*err) {
- log_error_write(srv, __FILE__, __LINE__, "sbs", "ERROR: non-digit found in netmask:", dc->string, err);
-
+ log_error_write(srv, __FILE__, __LINE__, "sbs", "ERROR: non-digit found in netmask:", dc->string, *err);
+
return COND_RESULT_FALSE;
}
-
+
/* take IP convert to the native */
buffer_copy_string_len(srv->cond_check_buf, dc->string->ptr, nm_slash - dc->string->ptr);
-#ifdef __WIN32
+#ifdef __WIN32
if (INADDR_NONE == (val_inp.s_addr = inet_addr(srv->cond_check_buf->ptr))) {
log_error_write(srv, __FILE__, __LINE__, "sb", "ERROR: ip addr is invalid:", srv->cond_check_buf);
-
+
return COND_RESULT_FALSE;
}
#else
if (0 == inet_aton(srv->cond_check_buf->ptr, &val_inp)) {
log_error_write(srv, __FILE__, __LINE__, "sb", "ERROR: ip addr is invalid:", srv->cond_check_buf);
-
+
return COND_RESULT_FALSE;
}
#endif
-
+
/* build netmask */
nm = htonl(~((1 << (32 - nm_bits)) - 1));
-
+
if ((val_inp.s_addr & nm) == (con->dst_addr.ipv4.sin_addr.s_addr & nm)) {
return (dc->cond == CONFIG_COND_EQ) ? COND_RESULT_TRUE : COND_RESULT_FALSE;
} else {
@@ -391,25 +298,17 @@ static cond_result_t config_check_cond_nocache(server *srv, connection *con, dat
}
break;
}
- case COMP_HTTP_SCHEME:
- l = con->uri.scheme;
- break;
-
case COMP_HTTP_URL:
l = con->uri.path;
break;
- case COMP_HTTP_QUERY_STRING:
- l = con->uri.query;
- break;
-
case COMP_SERVER_SOCKET:
l = srv_sock->srv_token;
break;
case COMP_HTTP_REFERER: {
data_string *ds;
-
+
if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Referer"))) {
l = ds->value;
} else {
@@ -426,7 +325,7 @@ static cond_result_t config_check_cond_nocache(server *srv, connection *con, dat
}
break;
}
- case COMP_HTTP_USER_AGENT: {
+ case COMP_HTTP_USERAGENT: {
data_string *ds;
if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "User-Agent"))) {
l = ds->value;
@@ -435,30 +334,11 @@ static cond_result_t config_check_cond_nocache(server *srv, connection *con, dat
}
break;
}
- case COMP_HTTP_REQUEST_METHOD: {
- const char *method = get_http_method_name(con->request.http_method);
-
- /* we only have the request method as const char but we need a buffer for comparing */
-
- buffer_copy_string(srv->tmp_buf, method);
- l = srv->tmp_buf;
-
- break;
- }
- case COMP_HTTP_LANGUAGE: {
- data_string *ds;
- if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Accept-Language"))) {
- l = ds->value;
- } else {
- l = srv->empty_string;
- }
- break;
- }
default:
return COND_RESULT_FALSE;
}
-
+
if (NULL == l) {
if (con->conf.log_condition_handling) {
log_error_write(srv, __FILE__, __LINE__, "bsbs", dc->comp_key,
@@ -466,7 +346,7 @@ static cond_result_t config_check_cond_nocache(server *srv, connection *con, dat
}
return COND_RESULT_FALSE;
}
-
+
if (con->conf.log_condition_handling) {
log_error_write(srv, __FILE__, __LINE__, "bsbsb", dc->comp_key,
"(", l, ") compare to ", dc->string);
@@ -485,17 +365,16 @@ static cond_result_t config_check_cond_nocache(server *srv, connection *con, dat
case CONFIG_COND_MATCH: {
cond_cache_t *cache = &con->cond_cache[dc->context_ndx];
int n;
-
+
#ifndef elementsof
#define elementsof(x) (sizeof(x) / sizeof(x[0]))
#endif
n = pcre_exec(dc->regex, dc->regex_study, l->ptr, l->used - 1, 0, 0,
cache->matches, elementsof(cache->matches));
-
- cache->patterncount = n;
+
if (n > 0) {
+ cache->patterncount = n;
cache->comp_value = l;
- cache->comp_type = dc->comp;
return (dc->cond == CONFIG_COND_MATCH) ? COND_RESULT_TRUE : COND_RESULT_FALSE;
} else {
/* cache is already cleared */
@@ -508,7 +387,7 @@ static cond_result_t config_check_cond_nocache(server *srv, connection *con, dat
/* no way */
break;
}
-
+
return COND_RESULT_FALSE;
}
@@ -528,56 +407,21 @@ static cond_result_t config_check_cond_cached(server *srv, connection *con, data
}
}
}
- caches[dc->context_ndx].comp_type = dc->comp;
-
if (con->conf.log_condition_handling) {
log_error_write(srv, __FILE__, __LINE__, "dss", dc->context_ndx,
"(uncached) result:",
- caches[dc->context_ndx].result == COND_RESULT_UNSET ? "unknown" :
- (caches[dc->context_ndx].result == COND_RESULT_TRUE ? "true" : "false"));
+ caches[dc->context_ndx].result == COND_RESULT_TRUE ? "true" : "false");
}
} else {
if (con->conf.log_condition_handling) {
log_error_write(srv, __FILE__, __LINE__, "dss", dc->context_ndx,
"(cached) result:",
- caches[dc->context_ndx].result == COND_RESULT_UNSET ? "unknown" :
- (caches[dc->context_ndx].result == COND_RESULT_TRUE ? "true" : "false"));
+ caches[dc->context_ndx].result == COND_RESULT_TRUE ? "true" : "false");
}
}
return caches[dc->context_ndx].result;
}
-/**
- * reset the config-cache for a named item
- *
- * if the item is COND_LAST_ELEMENT we reset all items
- */
-void config_cond_cache_reset_item(server *srv, connection *con, comp_key_t item) {
- size_t i;
-
- for (i = 0; i < srv->config_context->used; i++) {
- if (item == COMP_LAST_ELEMENT ||
- con->cond_cache[i].comp_type == item) {
- con->cond_cache[i].result = COND_RESULT_UNSET;
- con->cond_cache[i].patterncount = 0;
- con->cond_cache[i].comp_value = NULL;
- }
- }
-}
-
-/**
- * reset the config cache to its initial state at connection start
- */
-void config_cond_cache_reset(server *srv, connection *con) {
- size_t i;
-
- config_cond_cache_reset_all_items(srv, con);
-
- for (i = 0; i < COMP_LAST_ELEMENT; i++) {
- con->conditional_is_valid[i] = 0;
- }
-}
-
int config_check_cond(server *srv, connection *con, data_config *dc) {
if (con->conf.log_condition_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "=== start of condition block ===");
@@ -588,7 +432,7 @@ int config_check_cond(server *srv, connection *con, data_config *dc) {
int config_append_cond_match_buffer(connection *con, data_config *dc, buffer *buf, int n)
{
cond_cache_t *cache = &con->cond_cache[dc->context_ndx];
- if (n >= cache->patterncount) {
+ if (n > cache->patterncount) {
return 0;
}
diff --git a/src/configfile.c b/src/configfile.c
index a03c9bd..e9080c3 100644
--- a/src/configfile.c
+++ b/src/configfile.c
@@ -1,12 +1,3 @@
-#include "server.h"
-#include "log.h"
-#include "stream.h"
-#include "plugin.h"
-
-#include "configparser.h"
-#include "configfile.h"
-#include "proc_open.h"
-
#include <sys/stat.h>
#include <stdlib.h>
@@ -16,16 +7,27 @@
#include <string.h>
#include <stdio.h>
#include <ctype.h>
-#include <limits.h>
#include <assert.h>
+#include "server.h"
+#include "log.h"
+#include "stream.h"
+#include "plugin.h"
+#ifdef USE_LICENSE
+#include "license.h"
+#endif
+
+#include "configparser.h"
+#include "configfile.h"
+#include "proc_open.h"
+
static int config_insert(server *srv) {
size_t i;
int ret = 0;
buffer *stat_cache_string;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "server.bind", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 0 */
{ "server.errorlog", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 1 */
{ "server.errorfile-prefix", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 2 */
@@ -36,78 +38,48 @@ static int config_insert(server *srv) {
{ "server.tag", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
{ "server.use-ipv6", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
{ "server.modules", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_SERVER }, /* 9 */
-
+
{ "server.event-handler", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 10 */
{ "server.pid-file", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 11 */
- { "server.max-request-size", NULL, T_CONFIG_INT, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
+ { "server.max-request-size", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
{ "server.max-worker", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_SERVER }, /* 13 */
{ "server.document-root", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 14 */
- { "server.force-lowercase-filenames", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER },/* 15 */
+ { "server.force-lower-case-files", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 15 */
{ "debug.log-condition-handling", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 16 */
- { "server.max-keep-alive-requests", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },/* 17 */
+ { "server.max-keep-alive-requests", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 17 */
{ "server.name", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 18 */
{ "server.max-keep-alive-idle", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 19 */
-
+
{ "server.max-read-idle", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 20 */
{ "server.max-write-idle", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 21 */
{ "server.error-handler-404", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 22 */
{ "server.max-fds", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_SERVER }, /* 23 */
-#ifdef HAVE_LSTAT
{ "server.follow-symlink", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 24 */
-#else
- { "server.follow-symlink",
- "Your system lacks lstat(). We can not differ symlinks from files."
- "Please remove server.follow-symlinks from your config.",
- T_CONFIG_UNSUPPORTED, T_CONFIG_SCOPE_UNSET }, /* 24 */
-#endif
{ "server.kbytes-per-second", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 25 */
{ "connection.kbytes-per-second", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 26 */
{ "mimetype.use-xattr", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 27 */
{ "mimetype.assign", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 28 */
{ "ssl.pemfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 29 */
-
+
{ "ssl.engine", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 30 */
-
+
{ "debug.log-file-not-found", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 31 */
{ "debug.log-request-handling", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 32 */
{ "debug.log-response-header", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 33 */
{ "debug.log-request-header", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 34 */
- { "debug.log-ssl-noise", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 35 */
-
- { "server.protocol-http11", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 36 */
- { "debug.log-request-header-on-error", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 37 */
- { "debug.log-state-handling", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 38 */
- { "ssl.ca-file", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 39 */
-
- { "server.errorlog-use-syslog", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 40 */
- { "server.range-requests", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 41 */
- { "server.stat-cache-engine", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 42 */
- { "server.max-connections", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_SERVER }, /* 43 */
- { "server.network-backend", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 44 */
- { "server.upload-dirs", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 45 */
- { "server.core-files", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 46 */
- { "ssl.cipher-list", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 47 */
- { "ssl.use-sslv2", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 48 */
- { "etag.use-inode", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 49 */
- { "etag.use-mtime", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 50 */
- { "etag.use-size", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 51 */
- { "server.reject-expect-100-with-417", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 52 */
- { "debug.log-timeouts", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 53 */
- { "server.defer-accept", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 54 */
- { "server.breakagelog", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 55 */
- { "ssl.verifyclient.activate", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 56 */
- { "ssl.verifyclient.enforce", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 57 */
- { "ssl.verifyclient.depth", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_SERVER }, /* 58 */
- { "ssl.verifyclient.username", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 59 */
- { "ssl.verifyclient.exportcert", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 60 */
-
- { "server.set-v6only", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 61 */
- { "ssl.use-sslv3", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 62 */
- { "ssl.dh-file", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 63 */
- { "ssl.ec-curve", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 64 */
- { "ssl.disable-client-renegotiation", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER },/* 65 */
- { "ssl.honor-cipher-order", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 66 */
-
+
+ { "server.protocol-http11", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 35 */
+ { "debug.log-request-header-on-error", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 36 */
+ { "debug.log-state-handling", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 37 */
+ { "ssl.ca-file", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 38 */
+
+ { "server.errorlog-use-syslog", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 39 */
+ { "server.range-requests", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 40 */
+ { "server.stat-cache-engine", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 41 */
+ { "server.max-connections", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_SERVER }, /* 42 */
+ { "server.network-backend", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 43 */
+ { "server.upload-dirs", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 44 */
+
{ "server.host", "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
{ "server.docroot", "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
{ "server.virtual-root", "load mod_simple_vhost and use simple-vhost.server-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
@@ -116,12 +88,11 @@ static int config_insert(server *srv) {
{ "server.userid", "use server.username instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
{ "server.groupid", "use server.groupname instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
{ "server.use-keep-alive", "use server.max-keep-alive-requests = 0 instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
- { "server.force-lower-case-files", "use server.force-lowercase-filenames instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
-
+
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
/* 0 */
cv[0].destination = srv->srvconf.bindhost;
cv[1].destination = srv->srvconf.errorlog_file;
@@ -129,36 +100,32 @@ static int config_insert(server *srv) {
cv[4].destination = srv->srvconf.username;
cv[5].destination = srv->srvconf.groupname;
cv[6].destination = &(srv->srvconf.port);
-
+
cv[9].destination = srv->srvconf.modules;
cv[10].destination = srv->srvconf.event_handler;
cv[11].destination = srv->srvconf.pid_file;
-
+
cv[13].destination = &(srv->srvconf.max_worker);
cv[23].destination = &(srv->srvconf.max_fds);
- cv[37].destination = &(srv->srvconf.log_request_header_on_error);
- cv[38].destination = &(srv->srvconf.log_state_handling);
-
- cv[40].destination = &(srv->srvconf.errorlog_use_syslog);
-
+ cv[36].destination = &(srv->srvconf.log_request_header_on_error);
+ cv[37].destination = &(srv->srvconf.log_state_handling);
+
+ cv[39].destination = &(srv->srvconf.errorlog_use_syslog);
+
stat_cache_string = buffer_init();
- cv[42].destination = stat_cache_string;
- cv[44].destination = srv->srvconf.network_backend;
- cv[45].destination = srv->srvconf.upload_tempdirs;
- cv[46].destination = &(srv->srvconf.enable_cores);
-
- cv[43].destination = &(srv->srvconf.max_conns);
+ cv[41].destination = stat_cache_string;
+ cv[43].destination = srv->srvconf.network_backend;
+ cv[44].destination = srv->srvconf.upload_tempdirs;
+
+ cv[42].destination = &(srv->srvconf.max_conns);
cv[12].destination = &(srv->srvconf.max_request_size);
- cv[52].destination = &(srv->srvconf.reject_expect_100_with_417);
- cv[55].destination = srv->srvconf.breakagelog_file;
-
srv->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
assert(srv->config_storage);
-
+
for (i = 0; i < srv->config_context->used; i++) {
specific_config *s;
-
+
s = calloc(1, sizeof(specific_config));
assert(s);
s->document_root = buffer_init();
@@ -168,9 +135,6 @@ static int config_insert(server *srv) {
s->ssl_ca_file = buffer_init();
s->error_handler = buffer_init();
s->server_tag = buffer_init();
- s->ssl_cipher_list = buffer_init();
- s->ssl_dh_file = buffer_init();
- s->ssl_ec_curve = buffer_init();
s->errorfile_prefix = buffer_init();
s->max_keep_alive_requests = 16;
s->max_keep_alive_idle = 5;
@@ -178,43 +142,25 @@ static int config_insert(server *srv) {
s->max_write_idle = 360;
s->use_xattr = 0;
s->is_ssl = 0;
- s->ssl_honor_cipher_order = 1;
- s->ssl_use_sslv2 = 0;
- s->ssl_use_sslv3 = 1;
s->use_ipv6 = 0;
- s->set_v6only = 1;
- s->defer_accept = 0;
-#ifdef HAVE_LSTAT
s->follow_symlink = 1;
-#endif
s->kbytes_per_second = 0;
s->allow_http11 = 1;
- s->etag_use_inode = 1;
- s->etag_use_mtime = 1;
- s->etag_use_size = 1;
s->range_requests = 1;
- s->force_lowercase_filenames = (i == 0) ? 2 : 0; /* we wan't to detect later if user changed this for global section */
+ s->force_lower_case = 0;
s->global_kbytes_per_second = 0;
s->global_bytes_per_second_cnt = 0;
s->global_bytes_per_second_cnt_ptr = &s->global_bytes_per_second_cnt;
- s->ssl_verifyclient = 0;
- s->ssl_verifyclient_enforce = 1;
- s->ssl_verifyclient_username = buffer_init();
- s->ssl_verifyclient_depth = 9;
- s->ssl_verifyclient_export_cert = 0;
- s->ssl_disable_client_renegotiation = 1;
-
+
cv[2].destination = s->errorfile_prefix;
-
+
cv[7].destination = s->server_tag;
cv[8].destination = &(s->use_ipv6);
- cv[61].destination = &(s->set_v6only);
- cv[54].destination = &(s->defer_accept);
-
-
+
+
/* 13 max-worker */
cv[14].destination = s->document_root;
- cv[15].destination = &(s->force_lowercase_filenames);
+ cv[15].destination = &(s->force_lower_case);
cv[16].destination = &(s->log_condition_handling);
cv[17].destination = &(s->max_keep_alive_requests);
cv[18].destination = s->server_name;
@@ -222,9 +168,7 @@ static int config_insert(server *srv) {
cv[20].destination = &(s->max_read_idle);
cv[21].destination = &(s->max_write_idle);
cv[22].destination = s->error_handler;
-#ifdef HAVE_LSTAT
cv[24].destination = &(s->follow_symlink);
-#endif
/* 23 -> max-fds */
cv[25].destination = &(s->global_kbytes_per_second);
cv[26].destination = &(s->kbytes_per_second);
@@ -232,75 +176,48 @@ static int config_insert(server *srv) {
cv[28].destination = s->mimetypes;
cv[29].destination = s->ssl_pemfile;
cv[30].destination = &(s->is_ssl);
-
+
cv[31].destination = &(s->log_file_not_found);
cv[32].destination = &(s->log_request_handling);
cv[33].destination = &(s->log_response_header);
cv[34].destination = &(s->log_request_header);
- cv[35].destination = &(s->log_ssl_noise);
- cv[53].destination = &(s->log_timeouts);
-
- cv[36].destination = &(s->allow_http11);
- cv[39].destination = s->ssl_ca_file;
- cv[41].destination = &(s->range_requests);
-
- cv[47].destination = s->ssl_cipher_list;
- cv[48].destination = &(s->ssl_use_sslv2);
- cv[62].destination = &(s->ssl_use_sslv3);
- cv[63].destination = s->ssl_dh_file;
- cv[64].destination = s->ssl_ec_curve;
- cv[66].destination = &(s->ssl_honor_cipher_order);
-
- cv[49].destination = &(s->etag_use_inode);
- cv[50].destination = &(s->etag_use_mtime);
- cv[51].destination = &(s->etag_use_size);
-
- /* ssl.verify */
- cv[56].destination = &(s->ssl_verifyclient);
- cv[57].destination = &(s->ssl_verifyclient_enforce);
- cv[58].destination = &(s->ssl_verifyclient_depth);
- cv[59].destination = s->ssl_verifyclient_username;
- cv[60].destination = &(s->ssl_verifyclient_export_cert);
- cv[65].destination = &(s->ssl_disable_client_renegotiation);
-
+
+ cv[35].destination = &(s->allow_http11);
+ cv[38].destination = s->ssl_ca_file;
+ cv[40].destination = &(s->range_requests);
+
srv->config_storage[i] = s;
-
+
if (0 != (ret = config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv))) {
break;
}
}
-
+
if (buffer_is_empty(stat_cache_string)) {
srv->srvconf.stat_cache_engine = STAT_CACHE_ENGINE_SIMPLE;
} else if (buffer_is_equal_string(stat_cache_string, CONST_STR_LEN("simple"))) {
srv->srvconf.stat_cache_engine = STAT_CACHE_ENGINE_SIMPLE;
-#ifdef HAVE_FAM_H
} else if (buffer_is_equal_string(stat_cache_string, CONST_STR_LEN("fam"))) {
srv->srvconf.stat_cache_engine = STAT_CACHE_ENGINE_FAM;
-#endif
} else if (buffer_is_equal_string(stat_cache_string, CONST_STR_LEN("disable"))) {
srv->srvconf.stat_cache_engine = STAT_CACHE_ENGINE_NONE;
} else {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "server.stat-cache-engine can be one of \"disable\", \"simple\","
-#ifdef HAVE_FAM_H
- " \"fam\","
-#endif
- " but not:", stat_cache_string);
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "server.stat-cache-engine can be one of \"disable\", \"simple\", \"fam\", but not:", stat_cache_string);
ret = HANDLER_ERROR;
}
-
+
buffer_free(stat_cache_string);
-
+
return ret;
-
+
}
#define PATCH(x) con->conf.x = s->x
int config_setup_connection(server *srv, connection *con) {
specific_config *s = srv->config_storage[0];
-
+
PATCH(allow_http11);
PATCH(mimetypes);
PATCH(document_root);
@@ -311,71 +228,48 @@ int config_setup_connection(server *srv, connection *con) {
PATCH(use_xattr);
PATCH(error_handler);
PATCH(errorfile_prefix);
-#ifdef HAVE_LSTAT
PATCH(follow_symlink);
-#endif
PATCH(server_tag);
PATCH(kbytes_per_second);
PATCH(global_kbytes_per_second);
PATCH(global_bytes_per_second_cnt);
-
+
con->conf.global_bytes_per_second_cnt_ptr = &s->global_bytes_per_second_cnt;
buffer_copy_string_buffer(con->server_name, s->server_name);
-
+
PATCH(log_request_header);
PATCH(log_response_header);
PATCH(log_request_handling);
PATCH(log_condition_handling);
PATCH(log_file_not_found);
- PATCH(log_ssl_noise);
- PATCH(log_timeouts);
-
+
PATCH(range_requests);
- PATCH(force_lowercase_filenames);
+ PATCH(force_lower_case);
PATCH(is_ssl);
-
+
PATCH(ssl_pemfile);
-#ifdef USE_OPENSSL
- PATCH(ssl_ctx);
-#endif
PATCH(ssl_ca_file);
- PATCH(ssl_cipher_list);
- PATCH(ssl_dh_file);
- PATCH(ssl_ec_curve);
- PATCH(ssl_honor_cipher_order);
- PATCH(ssl_use_sslv2);
- PATCH(ssl_use_sslv3);
- PATCH(etag_use_inode);
- PATCH(etag_use_mtime);
- PATCH(etag_use_size);
-
- PATCH(ssl_verifyclient);
- PATCH(ssl_verifyclient_enforce);
- PATCH(ssl_verifyclient_depth);
- PATCH(ssl_verifyclient_username);
- PATCH(ssl_verifyclient_export_cert);
- PATCH(ssl_disable_client_renegotiation);
-
return 0;
}
int config_patch_connection(server *srv, connection *con, comp_key_t comp) {
size_t i, j;
-
- con->conditional_is_valid[comp] = 1;
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
specific_config *s = srv->config_storage[i];
-
+
+ /* not our stage */
+ if (comp != dc->comp) continue;
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.document-root"))) {
PATCH(document_root);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.range-requests"))) {
@@ -396,37 +290,14 @@ int config_patch_connection(server *srv, connection *con, comp_key_t comp) {
PATCH(max_read_idle);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("mimetype.use-xattr"))) {
PATCH(use_xattr);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("etag.use-inode"))) {
- PATCH(etag_use_inode);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("etag.use-mtime"))) {
- PATCH(etag_use_mtime);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("etag.use-size"))) {
- PATCH(etag_use_size);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.pemfile"))) {
PATCH(ssl_pemfile);
-#ifdef USE_OPENSSL
- PATCH(ssl_ctx);
-#endif
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.ca-file"))) {
PATCH(ssl_ca_file);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.honor-cipher-order"))) {
- PATCH(ssl_honor_cipher_order);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.use-sslv2"))) {
- PATCH(ssl_use_sslv2);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.use-sslv3"))) {
- PATCH(ssl_use_sslv3);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.cipher-list"))) {
- PATCH(ssl_cipher_list);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.engine"))) {
PATCH(is_ssl);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.dh-file"))) {
- PATCH(ssl_dh_file);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.ec-curve"))) {
- PATCH(ssl_ec_curve);
-#ifdef HAVE_LSTAT
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.follow-symlink"))) {
PATCH(follow_symlink);
-#endif
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.name"))) {
buffer_copy_string_buffer(con->server_name, s->server_name);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.tag"))) {
@@ -443,38 +314,18 @@ int config_patch_connection(server *srv, connection *con, comp_key_t comp) {
PATCH(log_condition_handling);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("debug.log-file-not-found"))) {
PATCH(log_file_not_found);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("debug.log-ssl-noise"))) {
- PATCH(log_ssl_noise);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("debug.log-timeouts"))) {
- PATCH(log_timeouts);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.protocol-http11"))) {
PATCH(allow_http11);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.force-lowercase-filenames"))) {
- PATCH(force_lowercase_filenames);
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.force-lower-case-files"))) {
+ PATCH(force_lower_case);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.kbytes-per-second"))) {
PATCH(global_kbytes_per_second);
PATCH(global_bytes_per_second_cnt);
con->conf.global_bytes_per_second_cnt_ptr = &s->global_bytes_per_second_cnt;
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.verifyclient.activate"))) {
- PATCH(ssl_verifyclient);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.verifyclient.enforce"))) {
- PATCH(ssl_verifyclient_enforce);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.verifyclient.depth"))) {
- PATCH(ssl_verifyclient_depth);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.verifyclient.username"))) {
- PATCH(ssl_verifyclient_username);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.verifyclient.exportcert"))) {
- PATCH(ssl_verifyclient_export_cert);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.disable-client-renegotiation"))) {
- PATCH(ssl_disable_client_renegotiation);
}
}
}
-
- con->etag_flags = (con->conf.etag_use_mtime ? ETAG_USE_MTIME : 0) |
- (con->conf.etag_use_inode ? ETAG_USE_INODE : 0) |
- (con->conf.etag_use_size ? ETAG_USE_SIZE : 0);
-
+
return 0;
}
#undef PATCH
@@ -482,15 +333,15 @@ int config_patch_connection(server *srv, connection *con, comp_key_t comp) {
typedef struct {
int foo;
int bar;
-
+
const buffer *source;
const char *input;
size_t offset;
size_t size;
-
+
int line_pos;
int line;
-
+
int in_key;
int in_brace;
int in_cond;
@@ -498,8 +349,8 @@ typedef struct {
#if 0
static int tokenizer_open(server *srv, tokenizer_t *t, buffer *basedir, const char *fn) {
- if (buffer_is_empty(basedir) ||
- (fn[0] == '/' || fn[0] == '\\') ||
+ if (buffer_is_empty(basedir) &&
+ (fn[0] == '/' || fn[0] == '\\') &&
(fn[0] == '.' && (fn[1] == '/' || fn[1] == '\\'))) {
t->file = buffer_init_string(fn);
} else {
@@ -508,7 +359,7 @@ static int tokenizer_open(server *srv, tokenizer_t *t, buffer *basedir, const ch
}
if (0 != stream_open(&(t->s), t->file)) {
- log_error_write(srv, __FILE__, __LINE__, "sbss",
+ log_error_write(srv, __FILE__, __LINE__, "sbss",
"opening configfile ", t->file, "failed:", strerror(errno));
buffer_free(t->file);
return -1;
@@ -519,7 +370,7 @@ static int tokenizer_open(server *srv, tokenizer_t *t, buffer *basedir, const ch
t->size = t->s.size;
t->line = 1;
t->line_pos = 1;
-
+
t->in_key = 1;
t->in_brace = 0;
t->in_cond = 0;
@@ -547,7 +398,7 @@ static int config_skip_newline(tokenizer_t *t) {
static int config_skip_comment(tokenizer_t *t) {
int i;
assert(t->input[t->offset] == '#');
- for (i = 1; t->input[t->offset + i] &&
+ for (i = 1; t->input[t->offset + i] &&
(t->input[t->offset + i] != '\n' && t->input[t->offset + i] != '\r');
i++);
t->offset += i;
@@ -557,96 +408,96 @@ static int config_skip_comment(tokenizer_t *t) {
static int config_tokenizer(server *srv, tokenizer_t *t, int *token_id, buffer *token) {
int tid = 0;
size_t i;
-
+
for (tid = 0; tid == 0 && t->offset < t->size && t->input[t->offset] ; ) {
char c = t->input[t->offset];
const char *start = NULL;
-
+
switch (c) {
- case '=':
+ case '=':
if (t->in_brace) {
if (t->input[t->offset + 1] == '>') {
t->offset += 2;
-
- buffer_copy_string_len(token, CONST_STR_LEN("=>"));
-
+
+ buffer_copy_string(token, "=>");
+
tid = TK_ARRAY_ASSIGN;
} else {
- log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
+ log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
"source:", t->source,
- "line:", t->line, "pos:", t->line_pos,
+ "line:", t->line, "pos:", t->line_pos,
"use => for assignments in arrays");
return -1;
}
} else if (t->in_cond) {
if (t->input[t->offset + 1] == '=') {
t->offset += 2;
-
- buffer_copy_string_len(token, CONST_STR_LEN("=="));
-
+
+ buffer_copy_string(token, "==");
+
tid = TK_EQ;
} else if (t->input[t->offset + 1] == '~') {
t->offset += 2;
-
- buffer_copy_string_len(token, CONST_STR_LEN("=~"));
-
+
+ buffer_copy_string(token, "=~");
+
tid = TK_MATCH;
} else {
- log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
+ log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
"source:", t->source,
- "line:", t->line, "pos:", t->line_pos,
- "only =~ and == are allowed in the condition");
+ "line:", t->line, "pos:", t->line_pos,
+ "only =~ and == are allow in the condition");
return -1;
}
t->in_key = 1;
t->in_cond = 0;
} else if (t->in_key) {
tid = TK_ASSIGN;
-
+
buffer_copy_string_len(token, t->input + t->offset, 1);
-
+
t->offset++;
t->line_pos++;
} else {
- log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
+ log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
"source:", t->source,
- "line:", t->line, "pos:", t->line_pos,
+ "line:", t->line, "pos:", t->line_pos,
"unexpected equal-sign: =");
return -1;
}
-
+
break;
- case '!':
+ case '!':
if (t->in_cond) {
if (t->input[t->offset + 1] == '=') {
t->offset += 2;
-
- buffer_copy_string_len(token, CONST_STR_LEN("!="));
-
+
+ buffer_copy_string(token, "!=");
+
tid = TK_NE;
} else if (t->input[t->offset + 1] == '~') {
t->offset += 2;
-
- buffer_copy_string_len(token, CONST_STR_LEN("!~"));
-
+
+ buffer_copy_string(token, "!~");
+
tid = TK_NOMATCH;
} else {
- log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
+ log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
"source:", t->source,
- "line:", t->line, "pos:", t->line_pos,
- "only !~ and != are allowed in the condition");
+ "line:", t->line, "pos:", t->line_pos,
+ "only !~ and != are allow in the condition");
return -1;
}
t->in_key = 1;
t->in_cond = 0;
} else {
- log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
+ log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
"source:", t->source,
- "line:", t->line, "pos:", t->line_pos,
+ "line:", t->line, "pos:", t->line_pos,
"unexpected exclamation-marks: !");
return -1;
}
-
+
break;
case '\t':
case ' ':
@@ -682,208 +533,214 @@ static int config_tokenizer(server *srv, tokenizer_t *t, int *token_id, buffer *
}
t->in_key = 1;
tid = TK_EOL;
- buffer_copy_string_len(token, CONST_STR_LEN("(EOL)"));
+ buffer_copy_string(token, "(EOL)");
} else {
config_skip_newline(t);
t->line_pos = 1;
- t->line++;
+ t->line++;
}
break;
case ',':
if (t->in_brace > 0) {
tid = TK_COMMA;
-
- buffer_copy_string_len(token, CONST_STR_LEN("(COMMA)"));
+
+ buffer_copy_string(token, "(COMMA)");
}
-
+
t->offset++;
t->line_pos++;
break;
case '"':
/* search for the terminating " */
start = t->input + t->offset + 1;
- buffer_copy_string_len(token, CONST_STR_LEN(""));
-
+ buffer_copy_string(token, "");
+
for (i = 1; t->input[t->offset + i]; i++) {
if (t->input[t->offset + i] == '\\' &&
t->input[t->offset + i + 1] == '"') {
-
+
buffer_append_string_len(token, start, t->input + t->offset + i - start);
-
+
start = t->input + t->offset + i + 1;
-
+
/* skip the " */
i++;
continue;
}
-
-
+
+
if (t->input[t->offset + i] == '"') {
tid = TK_STRING;
-
+
buffer_append_string_len(token, start, t->input + t->offset + i - start);
-
+
break;
}
}
if (t->input[t->offset + i] == '\0') {
/* ERROR */
-
- log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
+
+ log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
"source:", t->source,
- "line:", t->line, "pos:", t->line_pos,
+ "line:", t->line, "pos:", t->line_pos,
"missing closing quote");
-
+
return -1;
}
-
+
t->offset += i + 1;
t->line_pos += i + 1;
-
+
break;
case '(':
t->offset++;
t->in_brace++;
-
+
tid = TK_LPARAN;
-
- buffer_copy_string_len(token, CONST_STR_LEN("("));
+
+ buffer_copy_string(token, "(");
break;
case ')':
t->offset++;
t->in_brace--;
-
+
tid = TK_RPARAN;
-
- buffer_copy_string_len(token, CONST_STR_LEN(")"));
+
+ buffer_copy_string(token, ")");
break;
case '$':
t->offset++;
-
+
tid = TK_DOLLAR;
t->in_cond = 1;
t->in_key = 0;
-
- buffer_copy_string_len(token, CONST_STR_LEN("$"));
-
+
+ buffer_copy_string(token, "$");
+
break;
case '+':
if (t->input[t->offset + 1] == '=') {
t->offset += 2;
- buffer_copy_string_len(token, CONST_STR_LEN("+="));
+ buffer_copy_string(token, "+=");
tid = TK_APPEND;
} else {
t->offset++;
tid = TK_PLUS;
- buffer_copy_string_len(token, CONST_STR_LEN("+"));
+ buffer_copy_string(token, "+");
}
break;
case '{':
t->offset++;
-
+
tid = TK_LCURLY;
-
- buffer_copy_string_len(token, CONST_STR_LEN("{"));
-
+
+ buffer_copy_string(token, "{");
+
break;
-
+
case '}':
t->offset++;
-
+
tid = TK_RCURLY;
-
- buffer_copy_string_len(token, CONST_STR_LEN("}"));
-
+
+ buffer_copy_string(token, "}");
+
break;
case '[':
t->offset++;
-
+
tid = TK_LBRACKET;
-
- buffer_copy_string_len(token, CONST_STR_LEN("["));
-
+
+ buffer_copy_string(token, "[");
+
break;
-
+
case ']':
t->offset++;
-
+
tid = TK_RBRACKET;
-
- buffer_copy_string_len(token, CONST_STR_LEN("]"));
-
+
+ buffer_copy_string(token, "]");
+
break;
case '#':
t->line_pos += config_skip_comment(t);
-
+
break;
default:
if (t->in_cond) {
- for (i = 0; t->input[t->offset + i] &&
+ for (i = 0; t->input[t->offset + i] &&
(isalpha((unsigned char)t->input[t->offset + i])
); i++);
-
+
if (i && t->input[t->offset + i]) {
tid = TK_SRVVARNAME;
buffer_copy_string_len(token, t->input + t->offset, i);
-
+
t->offset += i;
t->line_pos += i;
} else {
/* ERROR */
- log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
+ log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
"source:", t->source,
- "line:", t->line, "pos:", t->line_pos,
+ "line:", t->line, "pos:", t->line_pos,
"invalid character in condition");
return -1;
}
} else if (isdigit((unsigned char)c)) {
/* take all digits */
for (i = 0; t->input[t->offset + i] && isdigit((unsigned char)t->input[t->offset + i]); i++);
-
+
/* was there it least a digit ? */
- if (i) {
+ if (i && t->input[t->offset + i]) {
tid = TK_INTEGER;
-
+
buffer_copy_string_len(token, t->input + t->offset, i);
-
+
t->offset += i;
t->line_pos += i;
+ } else {
+ /* ERROR */
+ log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
+ "source:", t->source,
+ "line:", t->line, "pos:", t->line_pos,
+ "unexpected EOF");
+
+ return -1;
}
} else {
/* the key might consist of [-.0-9a-z] */
- for (i = 0; t->input[t->offset + i] &&
- (isalnum((unsigned char)t->input[t->offset + i]) ||
+ for (i = 0; t->input[t->offset + i] &&
+ (isalnum((unsigned char)t->input[t->offset + i]) ||
t->input[t->offset + i] == '.' ||
t->input[t->offset + i] == '_' || /* for env.* */
t->input[t->offset + i] == '-'
); i++);
-
+
if (i && t->input[t->offset + i]) {
buffer_copy_string_len(token, t->input + t->offset, i);
-
+
if (strcmp(token->ptr, "include") == 0) {
tid = TK_INCLUDE;
} else if (strcmp(token->ptr, "include_shell") == 0) {
tid = TK_INCLUDE_SHELL;
- } else if (strcmp(token->ptr, "global") == 0) {
- tid = TK_GLOBAL;
} else if (strcmp(token->ptr, "else") == 0) {
tid = TK_ELSE;
} else {
tid = TK_LKEY;
}
-
+
t->offset += i;
t->line_pos += i;
} else {
/* ERROR */
- log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
+ log_error_write(srv, __FILE__, __LINE__, "sbsdsds",
"source:", t->source,
- "line:", t->line, "pos:", t->line_pos,
+ "line:", t->line, "pos:", t->line_pos,
"invalid character in variable name");
return -1;
}
@@ -891,16 +748,16 @@ static int config_tokenizer(server *srv, tokenizer_t *t, int *token_id, buffer *
break;
}
}
-
+
if (tid) {
*token_id = tid;
#if 0
- log_error_write(srv, __FILE__, __LINE__, "sbsdsdbdd",
+ log_error_write(srv, __FILE__, __LINE__, "sbsdsdbdd",
"source:", t->source,
"line:", t->line, "pos:", t->line_pos,
token, token->used - 1, tid);
#endif
-
+
return 1;
} else if (t->offset < t->size) {
fprintf(stderr, "%s.%d: %d, %s\n",
@@ -922,7 +779,7 @@ static int config_parse(server *srv, config_t *context, tokenizer_t *t) {
while((1 == (ret = config_tokenizer(srv, t, &token_id, token))) && context->ok) {
buffer_copy_string_buffer(lasttoken, token);
configparser(pParser, token_id, token, context);
-
+
token = buffer_init();
}
buffer_free(token);
@@ -935,14 +792,14 @@ static int config_parse(server *srv, config_t *context, tokenizer_t *t) {
}
}
configparserFree(pParser, free);
-
+
if (ret == -1) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "configfile parser failed at:", lasttoken);
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "configfile parser failed:", lasttoken);
} else if (context->ok == 0) {
- log_error_write(srv, __FILE__, __LINE__, "sbsdsdsb",
+ log_error_write(srv, __FILE__, __LINE__, "sbsdsdsb",
"source:", t->source,
- "line:", t->line, "pos:", t->line_pos,
+ "line:", t->line, "pos:", t->line_pos,
"parser failed somehow near here:", lasttoken);
ret = -1;
}
@@ -959,7 +816,7 @@ static int tokenizer_init(tokenizer_t *t, const buffer *source, const char *inpu
t->offset = 0;
t->line = 1;
t->line_pos = 1;
-
+
t->in_key = 1;
t->in_brace = 0;
t->in_cond = 0;
@@ -972,8 +829,8 @@ int config_parse_file(server *srv, config_t *context, const char *fn) {
int ret;
buffer *filename;
- if (buffer_is_empty(context->basedir) ||
- (fn[0] == '/' || fn[0] == '\\') ||
+ if (buffer_is_empty(context->basedir) &&
+ (fn[0] == '/' || fn[0] == '\\') &&
(fn[0] == '.' && (fn[1] == '/' || fn[1] == '\\'))) {
filename = buffer_init_string(fn);
} else {
@@ -982,14 +839,9 @@ int config_parse_file(server *srv, config_t *context, const char *fn) {
}
if (0 != stream_open(&s, filename)) {
- if (s.size == 0) {
- /* the file was empty, nothing to parse */
- ret = 0;
- } else {
- log_error_write(srv, __FILE__, __LINE__, "sbss",
- "opening configfile ", filename, "failed:", strerror(errno));
- ret = -1;
- }
+ log_error_write(srv, __FILE__, __LINE__, "sbss",
+ "opening configfile ", filename, "failed:", strerror(errno));
+ ret = -1;
} else {
tokenizer_init(&t, filename, s.start, s.size);
ret = config_parse(srv, context, &t);
@@ -1000,39 +852,16 @@ int config_parse_file(server *srv, config_t *context, const char *fn) {
return ret;
}
-static char* getCWD() {
- char *s, *s1;
- size_t len;
-#ifdef PATH_MAX
- len = PATH_MAX;
-#else
- len = 4096;
-#endif
-
- s = malloc(len);
- if (!s) return NULL;
- while (NULL == getcwd(s, len)) {
- if (errno != ERANGE || SSIZE_MAX - len < len) return NULL;
- len *= 2;
- s1 = realloc(s, len);
- if (!s1) {
- free(s);
- return NULL;
- }
- s = s1;
- }
- return s;
-}
-
int config_parse_cmd(server *srv, config_t *context, const char *cmd) {
+ proc_handler_t proc;
tokenizer_t t;
int ret;
buffer *source;
buffer *out;
- char *oldpwd;
+ char oldpwd[PATH_MAX];
- if (NULL == (oldpwd = getCWD())) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ if (NULL == getcwd(oldpwd, sizeof(oldpwd))) {
+ log_error_write(srv, __FILE__, __LINE__, "s",
"cannot get cwd", strerror(errno));
return -1;
}
@@ -1044,8 +873,8 @@ int config_parse_cmd(server *srv, config_t *context, const char *cmd) {
chdir(context->basedir->ptr);
}
- if (0 != proc_open_buffer(cmd, NULL, out, NULL)) {
- log_error_write(srv, __FILE__, __LINE__, "sbss",
+ if (0 != proc_open_buffer(&proc, cmd, NULL, out, NULL)) {
+ log_error_write(srv, __FILE__, __LINE__, "sbss",
"opening", source, "failed:", strerror(errno));
ret = -1;
} else {
@@ -1056,7 +885,6 @@ int config_parse_cmd(server *srv, config_t *context, const char *cmd) {
buffer_free(source);
buffer_free(out);
chdir(oldpwd);
- free(oldpwd);
return ret;
}
@@ -1077,7 +905,6 @@ int config_read(server *srv, const char *fn) {
config_t context;
data_config *dc;
data_integer *dpid;
- data_string *dcwd;
int ret;
char *pos;
data_array *modules;
@@ -1085,18 +912,20 @@ int config_read(server *srv, const char *fn) {
context_init(srv, &context);
context.all_configs = srv->config_context;
+ pos = strrchr(fn,
#ifdef __WIN32
- pos = strrchr(fn, '\\');
+ '\\'
#else
- pos = strrchr(fn, '/');
+ '/'
#endif
+ );
if (pos) {
buffer_copy_string_len(context.basedir, fn, pos - fn + 1);
fn = pos + 1;
}
-
+
dc = data_config_init();
- buffer_copy_string_len(dc->key, CONST_STR_LEN("global"));
+ buffer_copy_string(dc->key, "global");
assert(context.all_configs->used == 0);
dc->context_ndx = context.all_configs->used;
@@ -1107,17 +936,9 @@ int config_read(server *srv, const char *fn) {
srv->config = dc->value;
dpid = data_integer_init();
dpid->value = getpid();
- buffer_copy_string_len(dpid->key, CONST_STR_LEN("var.PID"));
+ buffer_copy_string(dpid->key, "var.PID");
array_insert_unique(srv->config, (data_unset *)dpid);
-
- dcwd = data_string_init();
- buffer_prepare_copy(dcwd->value, 1024);
- if (NULL != getcwd(dcwd->value->ptr, dcwd->value->size - 1)) {
- dcwd->value->used = strlen(dcwd->value->ptr) + 1;
- buffer_copy_string_len(dcwd->key, CONST_STR_LEN("var.CWD"));
- array_insert_unique(srv->config, (data_unset *)dcwd);
- }
-
+
ret = config_parse_file(srv, &context, fn);
/* remains nothing if parser is ok */
@@ -1133,7 +954,7 @@ int config_read(server *srv, const char *fn) {
} else {
return -1;
}
-
+
if (NULL != (modules = (data_array *)array_get_element(srv->config, "server.modules"))) {
data_string *ds;
data_array *prepends;
@@ -1148,7 +969,7 @@ int config_read(server *srv, const char *fn) {
/* prepend default modules */
if (NULL == array_get_element(modules->value, "mod_indexfile")) {
ds = data_string_init();
- buffer_copy_string_len(ds->value, CONST_STR_LEN("mod_indexfile"));
+ buffer_copy_string(ds->value, "mod_indexfile");
array_insert_unique(prepends->value, (data_unset *)ds);
}
@@ -1161,42 +982,22 @@ int config_read(server *srv, const char *fn) {
/* append default modules */
if (NULL == array_get_element(modules->value, "mod_dirlisting")) {
ds = data_string_init();
- buffer_copy_string_len(ds->value, CONST_STR_LEN("mod_dirlisting"));
+ buffer_copy_string(ds->value, "mod_dirlisting");
array_insert_unique(modules->value, (data_unset *)ds);
}
if (NULL == array_get_element(modules->value, "mod_staticfile")) {
ds = data_string_init();
- buffer_copy_string_len(ds->value, CONST_STR_LEN("mod_staticfile"));
+ buffer_copy_string(ds->value, "mod_staticfile");
array_insert_unique(modules->value, (data_unset *)ds);
}
- } else {
- data_string *ds;
-
- modules = data_array_init();
-
- /* server.modules is not set */
- ds = data_string_init();
- buffer_copy_string_len(ds->value, CONST_STR_LEN("mod_indexfile"));
- array_insert_unique(modules->value, (data_unset *)ds);
-
- ds = data_string_init();
- buffer_copy_string_len(ds->value, CONST_STR_LEN("mod_dirlisting"));
- array_insert_unique(modules->value, (data_unset *)ds);
-
- ds = data_string_init();
- buffer_copy_string_len(ds->value, CONST_STR_LEN("mod_staticfile"));
- array_insert_unique(modules->value, (data_unset *)ds);
-
- buffer_copy_string_len(modules->key, CONST_STR_LEN("server.modules"));
- array_insert_unique(srv->config, (data_unset *)modules);
}
-
+
if (0 != config_insert(srv)) {
return -1;
}
-
+
return 0;
}
@@ -1204,50 +1005,48 @@ int config_set_defaults(server *srv) {
size_t i;
specific_config *s = srv->config_storage[0];
struct stat st1, st2;
-
- struct ev_map { fdevent_handler_t et; const char *name; } event_handlers[] =
- {
- /* - epoll is most reliable
+
+ struct ev_map { fdevent_handler_t et; const char *name; } event_handlers[] =
+ {
+ /* - poll is most reliable
* - select works everywhere
+ * - linux-* are experimental
*/
-#ifdef USE_LINUX_EPOLL
- { FDEVENT_HANDLER_LINUX_SYSEPOLL, "linux-sysepoll" },
-#endif
#ifdef USE_POLL
{ FDEVENT_HANDLER_POLL, "poll" },
#endif
#ifdef USE_SELECT
{ FDEVENT_HANDLER_SELECT, "select" },
#endif
-#ifdef USE_LIBEV
- { FDEVENT_HANDLER_LIBEV, "libev" },
+#ifdef USE_LINUX_EPOLL
+ { FDEVENT_HANDLER_LINUX_SYSEPOLL, "linux-sysepoll" },
+#endif
+#ifdef USE_LINUX_SIGIO
+ { FDEVENT_HANDLER_LINUX_RTSIG, "linux-rtsig" },
#endif
#ifdef USE_SOLARIS_DEVPOLL
{ FDEVENT_HANDLER_SOLARIS_DEVPOLL,"solaris-devpoll" },
#endif
-#ifdef USE_SOLARIS_PORT
- { FDEVENT_HANDLER_SOLARIS_PORT, "solaris-eventports" },
-#endif
#ifdef USE_FREEBSD_KQUEUE
{ FDEVENT_HANDLER_FREEBSD_KQUEUE, "freebsd-kqueue" },
{ FDEVENT_HANDLER_FREEBSD_KQUEUE, "kqueue" },
#endif
{ FDEVENT_HANDLER_UNSET, NULL }
};
-
-
- if (buffer_is_empty(s->document_root)) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "a default document-root has to be set");
-
- return -1;
- }
-
+
+
+ if (buffer_is_empty(s->document_root)) {
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "a default document-root has to be set");
+
+ return -1;
+ }
+
if (buffer_is_empty(srv->srvconf.changeroot)) {
- if (-1 == stat(s->document_root->ptr, &st1)) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ if (-1 == stat(s->document_root->ptr, &st1)) {
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"base-docroot doesn't exist:",
- s->document_root);
+ s->document_root);
return -1;
}
@@ -1255,91 +1054,87 @@ int config_set_defaults(server *srv) {
buffer_copy_string_buffer(srv->tmp_buf, srv->srvconf.changeroot);
buffer_append_string_buffer(srv->tmp_buf, s->document_root);
- if (-1 == stat(srv->tmp_buf->ptr, &st1)) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ if (-1 == stat(srv->tmp_buf->ptr, &st1)) {
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"base-docroot doesn't exist:",
- srv->tmp_buf);
+ srv->tmp_buf);
return -1;
}
-
+
}
+
+ buffer_copy_string_buffer(srv->tmp_buf, s->document_root);
- buffer_copy_string_buffer(srv->tmp_buf, s->document_root);
-
- buffer_to_lower(srv->tmp_buf);
-
- if (2 == s->force_lowercase_filenames) { /* user didn't configure it in global section? */
- s->force_lowercase_filenames = 0; /* default to 0 */
+ buffer_to_lower(srv->tmp_buf);
- if (0 == stat(srv->tmp_buf->ptr, &st1)) {
- int is_lower = 0;
+ if (0 == stat(srv->tmp_buf->ptr, &st1)) {
+ int is_lower = 0;
- is_lower = buffer_is_equal(srv->tmp_buf, s->document_root);
+ is_lower = buffer_is_equal(srv->tmp_buf, s->document_root);
- /* lower-case existed, check upper-case */
- buffer_copy_string_buffer(srv->tmp_buf, s->document_root);
+ /* lower-case existed, check upper-case */
+ buffer_copy_string_buffer(srv->tmp_buf, s->document_root);
- buffer_to_upper(srv->tmp_buf);
+ buffer_to_upper(srv->tmp_buf);
- /* we have to handle the special case that upper and lower-casing results in the same filename
- * as in server.document-root = "/" or "/12345/" */
+ /* we have to handle the special case that upper and lower-casing results in the same filename
+ * as in server.document-root = "/" or "/12345/" */
- if (is_lower && buffer_is_equal(srv->tmp_buf, s->document_root)) {
- /* lower-casing and upper-casing didn't result in
- * an other filename, no need to stat(),
- * just assume it is case-sensitive. */
+ if (is_lower && buffer_is_equal(srv->tmp_buf, s->document_root)) {
+ /* lower-casing and upper-casing didn't result in
+ * an other filename, no need to stat(),
+ * just assume it is case-sensitive. */
- s->force_lowercase_filenames = 0;
- } else if (0 == stat(srv->tmp_buf->ptr, &st2)) {
-
- /* upper case exists too, doesn't the FS handle this ? */
-
- /* upper and lower have the same inode -> case-insensitve FS */
-
- if (st1.st_ino == st2.st_ino) {
- /* upper and lower have the same inode -> case-insensitve FS */
-
- s->force_lowercase_filenames = 1;
- }
- }
- }
- }
+ s->force_lower_case = 0;
+ } else if (0 == stat(srv->tmp_buf->ptr, &st2)) {
+ /* upper case exists too, doesn't the FS handle this ? */
+
+ /* upper and lower have the same inode -> case-insensitve FS */
+
+ if (st1.st_ino == st2.st_ino) {
+ /* upper and lower have the same inode -> case-insensitve FS */
+
+ s->force_lower_case = 1;
+ }
+ }
+ }
+
if (srv->srvconf.port == 0) {
srv->srvconf.port = s->is_ssl ? 443 : 80;
}
-
+
if (srv->srvconf.event_handler->used == 0) {
/* choose a good default
- *
- * the event_handler list is sorted by 'goodness'
+ *
+ * the event_handler list is sorted by 'goodness'
* taking the first available should be the best solution
*/
srv->event_handler = event_handlers[0].et;
-
+
if (FDEVENT_HANDLER_UNSET == srv->event_handler) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"sorry, there is no event handler for this system");
-
+
return -1;
}
} else {
/*
* User override
*/
-
+
for (i = 0; event_handlers[i].name; i++) {
if (0 == strcmp(event_handlers[i].name, srv->srvconf.event_handler->ptr)) {
srv->event_handler = event_handlers[i].et;
break;
}
}
-
+
if (FDEVENT_HANDLER_UNSET == srv->event_handler) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "the selected event-handler in unknown or not supported:",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "the selected event-handler in unknown or not supported:",
srv->srvconf.event_handler );
-
+
return -1;
}
}
@@ -1347,19 +1142,19 @@ int config_set_defaults(server *srv) {
if (s->is_ssl) {
if (buffer_is_empty(s->ssl_pemfile)) {
/* PEM file is require */
-
- log_error_write(srv, __FILE__, __LINE__, "s",
+
+ log_error_write(srv, __FILE__, __LINE__, "s",
"ssl.pemfile has to be set");
return -1;
}
-
+
#ifndef USE_OPENSSL
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"ssl support is missing, recompile with --with-openssl");
-
+
return -1;
#endif
}
-
+
return 0;
}
diff --git a/src/configfile.h b/src/configfile.h
index f46e869..600297f 100644
--- a/src/configfile.h
+++ b/src/configfile.h
@@ -21,10 +21,4 @@ int config_parse_file(server *srv, config_t *context, const char *fn);
int config_parse_cmd(server *srv, config_t *context, const char *cmd);
data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2);
-void config_cond_cache_reset(server *srv, connection *con);
-void config_cond_cache_reset_item(server *srv, connection *con, comp_key_t item);
-
-#define config_cond_cache_reset_all_items(srv, con) \
- config_cond_cache_reset_item(srv, con, COMP_LAST_ELEMENT);
-
#endif
diff --git a/src/configparser.c b/src/configparser.c
index 24e973b..68d9c62 100644
--- a/src/configparser.c
+++ b/src/configparser.c
@@ -4,15 +4,17 @@
/* First off, code is include which follows the "include" declaration
** in the input file. */
#include <stdio.h>
-#line 5 "../../src/configparser.y"
-
-#include "configfile.h"
-#include "buffer.h"
-#include "array.h"
+#line 5 "./configparser.y"
#include <assert.h>
#include <stdio.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "configfile.h"
+#include "buffer.h"
+#include "array.h"
static void configparser_push(config_t *ctx, data_config *dc, int isnew) {
if (isnew) {
@@ -22,10 +24,6 @@ static void configparser_push(config_t *ctx, data_config *dc, int isnew) {
dc->parent = ctx->current;
array_insert_unique(dc->parent->childs, (data_unset *)dc);
}
- if (ctx->configs_stack->used > 0 && ctx->current->context_ndx == 0) {
- fprintf(stderr, "Cannot use conditionals inside a global { ... } block\n");
- exit(-1);
- }
array_insert_unique(ctx->configs_stack, (data_unset *)ctx->current);
ctx->current = dc;
}
@@ -38,25 +36,43 @@ static data_config *configparser_pop(config_t *ctx) {
/* return a copied variable */
static data_unset *configparser_get_variable(config_t *ctx, const buffer *key) {
- data_unset *du;
- data_config *dc;
+ if (strncmp(key->ptr, "env.", sizeof("env.") - 1) == 0) {
+ char *env;
+
+ if (NULL != (env = getenv(key->ptr + 4))) {
+ data_string *ds;
+ ds = data_string_init();
+ buffer_append_string(ds->value, env);
+ return (data_unset *)ds;
+ }
+
+ fprintf(stderr, "Undefined env variable: %s\n", key->ptr + 4);
+ ctx->ok = 0;
+
+ return NULL;
+ } else {
+ data_unset *du;
+ data_config *dc;
#if 0
- fprintf(stderr, "get var %s\n", key->ptr);
+ fprintf(stderr, "get var %s\n", key->ptr);
#endif
- for (dc = ctx->current; dc; dc = dc->parent) {
+ for (dc = ctx->current; dc; dc = dc->parent) {
#if 0
- fprintf(stderr, "get var on block: %s\n", dc->key->ptr);
- array_print(dc->value, 0);
+ fprintf(stderr, "get var on block: %s\n", dc->key->ptr);
+ array_print(dc->value, 0);
#endif
- if (NULL != (du = array_get_element(dc->value, key->ptr))) {
- return du->copy(du);
+ if (NULL != (du = array_get_element(dc->value, key->ptr))) {
+ return du->copy(du);
+ }
}
+ fprintf(stderr, "Undefined config variable: %s\n", key->ptr);
+ ctx->ok = 0;
+ return NULL;
}
- return NULL;
}
-/* op1 is to be eat/return by this function if success, op1->key is not cared
+/* op1 is to be eat/return by this function, op1->key is not cared
op2 is left untouch, unreferenced
*/
data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) {
@@ -73,7 +89,8 @@ data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) {
op1->free(op1);
return (data_unset *)ds;
} else {
- fprintf(stderr, "data type mismatch, cannot merge\n");
+ fprintf(stderr, "data type mismatch, cannot be merge\n");
+ op1->free(op1);
return NULL;
}
}
@@ -107,14 +124,14 @@ data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) {
}
-#line 111 "configparser.c"
+#line 128 "configparser.c"
/* Next is all token values, in a form suitable for use by makeheaders.
** This section will be null unless lemon is run with the -m switch.
*/
-/*
+/*
** These constants (all generated automatically by the parser generator)
** specify the various kinds of tokens (terminals) that the parser
-** understands.
+** understands.
**
** Each symbol here is a terminal symbol in the grammar.
*/
@@ -131,7 +148,7 @@ data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) {
** and nonterminals. "int" is used otherwise.
** YYNOCODE is a number of type YYCODETYPE which corresponds
** to no legal terminal or nonterminal number. This
-** number is used to fill in empty slots of the hash
+** number is used to fill in empty slots of the hash
** table.
** YYFALLBACK If defined, this indicates that one or more tokens
** have fall-back values which should be used if the
@@ -140,7 +157,7 @@ data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) {
** and nonterminal numbers. "unsigned char" is
** used if there are fewer than 250 rules and
** states combined. "int" is used otherwise.
-** configparserTOKENTYPE is the data type used for minor tokens given
+** configparserTOKENTYPE is the data type used for minor tokens given
** directly to the parser from the tokenizer.
** YYMINORTYPE is the data type used for all minor tokens.
** This is typically a union of many types, one of
@@ -158,27 +175,27 @@ data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) {
*/
/*  */
#define YYCODETYPE unsigned char
-#define YYNOCODE 48
+#define YYNOCODE 45
#define YYACTIONTYPE unsigned char
#define configparserTOKENTYPE buffer *
typedef union {
configparserTOKENTYPE yy0;
- config_cond_t yy27;
- array * yy40;
- data_unset * yy41;
- buffer * yy43;
- data_config * yy78;
- int yy95;
+ buffer * yy1;
+ config_cond_t yy29;
+ data_unset * yy43;
+ data_config * yy74;
+ array * yy78;
+ int yy89;
} YYMINORTYPE;
#define YYSTACKDEPTH 100
#define configparserARG_SDECL config_t *ctx;
#define configparserARG_PDECL ,config_t *ctx
#define configparserARG_FETCH config_t *ctx = yypParser->ctx
#define configparserARG_STORE yypParser->ctx = ctx
-#define YYNSTATE 63
-#define YYNRULE 40
-#define YYERRORSYMBOL 26
-#define YYERRSYMDT yy95
+#define YYNSTATE 56
+#define YYNRULE 36
+#define YYERRORSYMBOL 25
+#define YYERRSYMDT yy89
#define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
#define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
@@ -186,7 +203,7 @@ typedef union {
/* Next are that tables used to determine what action to take based on the
** current state and lookahead token. These tables are used to implement
** functions that take a state number and lookahead value and return an
-** action integer.
+** action integer.
**
** Suppose the action integer is N. Then the action is determined as
** follows
@@ -211,7 +228,7 @@ typedef union {
** If the index value yy_shift_ofst[S]+X is out of range or if the value
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
-** and that yy_default[S] should be used instead.
+** and that yy_default[S] should be used instead.
**
** The formula above is for computing the action when the lookahead is
** a terminal symbol. If the lookahead is a non-terminal (as occurs after
@@ -231,69 +248,62 @@ typedef union {
** yy_default[] Default action for each state.
*/
static YYACTIONTYPE yy_action[] = {
- /* 0 */ 2, 3, 4, 5, 13, 14, 63, 15, 7, 45,
- /* 10 */ 20, 88, 16, 46, 28, 49, 41, 10, 40, 25,
- /* 20 */ 22, 50, 46, 8, 15, 104, 1, 20, 28, 18,
- /* 30 */ 58, 60, 6, 25, 22, 40, 47, 62, 11, 46,
- /* 40 */ 20, 9, 23, 24, 26, 29, 89, 58, 60, 10,
- /* 50 */ 17, 38, 28, 27, 37, 19, 30, 25, 22, 34,
- /* 60 */ 15, 100, 20, 20, 23, 24, 26, 12, 19, 31,
- /* 70 */ 32, 40, 19, 44, 43, 46, 95, 35, 90, 89,
- /* 80 */ 28, 49, 42, 58, 60, 25, 22, 59, 28, 27,
- /* 90 */ 33, 48, 52, 25, 22, 34, 28, 49, 51, 28,
- /* 100 */ 36, 25, 22, 61, 25, 22, 89, 28, 39, 89,
- /* 110 */ 89, 89, 25, 22, 54, 55, 56, 57, 89, 28,
- /* 120 */ 53, 21, 89, 89, 25, 22, 25, 22,
+ /* 0 */ 2, 3, 4, 12, 13, 56, 14, 6, 38, 19,
+ /* 10 */ 79, 15, 27, 26, 35, 9, 28, 24, 21, 32,
+ /* 20 */ 40, 14, 93, 1, 19, 27, 26, 31, 52, 54,
+ /* 30 */ 24, 21, 32, 7, 39, 40, 48, 49, 50, 51,
+ /* 40 */ 27, 43, 18, 52, 54, 24, 21, 44, 27, 43,
+ /* 50 */ 84, 27, 43, 24, 21, 53, 24, 21, 55, 19,
+ /* 60 */ 40, 22, 23, 25, 27, 17, 27, 34, 33, 24,
+ /* 70 */ 21, 24, 21, 5, 27, 37, 10, 27, 47, 24,
+ /* 80 */ 21, 20, 24, 21, 80, 8, 24, 21, 16, 36,
+ /* 90 */ 18, 11, 9, 29, 30, 18, 89, 41, 45, 42,
+ /* 100 */ 46,
};
static YYCODETYPE yy_lookahead[] = {
- /* 0 */ 29, 30, 31, 32, 33, 34, 0, 1, 44, 38,
- /* 10 */ 4, 15, 41, 16, 35, 36, 45, 46, 12, 40,
- /* 20 */ 41, 42, 16, 15, 1, 27, 28, 4, 35, 36,
- /* 30 */ 24, 25, 1, 40, 41, 12, 17, 14, 13, 16,
- /* 40 */ 4, 38, 6, 7, 8, 9, 15, 24, 25, 46,
- /* 50 */ 2, 3, 35, 36, 37, 5, 39, 40, 41, 42,
- /* 60 */ 1, 11, 4, 4, 6, 7, 8, 28, 5, 9,
- /* 70 */ 10, 12, 5, 14, 28, 16, 13, 11, 13, 47,
- /* 80 */ 35, 36, 13, 24, 25, 40, 41, 42, 35, 36,
- /* 90 */ 37, 18, 43, 40, 41, 42, 35, 36, 19, 35,
- /* 100 */ 36, 40, 41, 42, 40, 41, 47, 35, 36, 47,
- /* 110 */ 47, 47, 40, 41, 20, 21, 22, 23, 47, 35,
- /* 120 */ 36, 35, 47, 47, 40, 41, 40, 41,
+ /* 0 */ 28, 29, 30, 31, 32, 0, 1, 42, 36, 4,
+ /* 10 */ 12, 39, 33, 34, 35, 43, 37, 38, 39, 40,
+ /* 20 */ 15, 1, 26, 27, 4, 33, 34, 35, 23, 24,
+ /* 30 */ 38, 39, 40, 12, 14, 15, 19, 20, 21, 22,
+ /* 40 */ 33, 34, 5, 23, 24, 38, 39, 40, 33, 34,
+ /* 50 */ 13, 33, 34, 38, 39, 40, 38, 39, 40, 4,
+ /* 60 */ 15, 6, 7, 8, 33, 34, 33, 34, 11, 38,
+ /* 70 */ 39, 38, 39, 1, 33, 34, 13, 33, 34, 38,
+ /* 80 */ 39, 33, 38, 39, 12, 36, 38, 39, 2, 3,
+ /* 90 */ 5, 27, 43, 9, 10, 5, 11, 16, 18, 17,
+ /* 100 */ 41,
};
-#define YY_SHIFT_USE_DFLT (-5)
+#define YY_SHIFT_USE_DFLT (-3)
static signed char yy_shift_ofst[] = {
- /* 0 */ -5, 6, -5, -5, -5, 31, -4, 8, -3, -5,
- /* 10 */ 25, -5, 23, -5, -5, -5, 48, 58, 67, 58,
- /* 20 */ -5, -5, -5, -5, -5, -5, 36, 50, -5, -5,
- /* 30 */ 60, -5, 58, -5, 66, 58, 67, -5, 58, 67,
- /* 40 */ 65, 69, -5, 59, -5, -5, 19, 73, 58, 67,
- /* 50 */ 79, 94, 58, 63, -5, -5, -5, -5, 58, -5,
- /* 60 */ 58, -5, -5,
+ /* 0 */ -3, 5, -3, -3, 72, -2, 21, 45, -3, 63,
+ /* 10 */ -3, 20, -3, -3, -3, 86, 55, 90, 55, -3,
+ /* 20 */ -3, -3, -3, -3, -3, 55, 85, -3, 84, -3,
+ /* 30 */ 55, -3, 57, 55, 90, -3, 55, 90, -3, -3,
+ /* 40 */ 81, 82, 55, 90, 80, 17, 55, 37, -3, -3,
+ /* 50 */ -3, -3, 55, -3, 55, -3,
};
-#define YY_REDUCE_USE_DFLT (-37)
+#define YY_REDUCE_USE_DFLT (-36)
static signed char yy_reduce_ofst[] = {
- /* 0 */ -2, -29, -37, -37, -37, -36, -37, -37, 3, -37,
- /* 10 */ -37, 39, -29, -37, -37, -37, -37, -7, -37, 86,
- /* 20 */ -37, -37, -37, -37, -37, -37, 17, -37, -37, -37,
- /* 30 */ -37, -37, 53, -37, -37, 64, -37, -37, 72, -37,
- /* 40 */ -37, -37, 46, -29, -37, -37, -37, -37, -21, -37,
- /* 50 */ -37, 49, 84, -37, -37, -37, -37, -37, 45, -37,
- /* 60 */ 61, -37, -37,
+ /* 0 */ -4, -28, -36, -36, -35, -36, -36, 49, -36, -36,
+ /* 10 */ 64, -28, -36, -36, -36, -36, 31, -36, 48, -36,
+ /* 20 */ -36, -36, -36, -36, -36, -21, -36, -36, -36, -36,
+ /* 30 */ -8, -36, -36, 33, -36, -36, 41, -36, -36, -36,
+ /* 40 */ -36, -36, 7, -36, -36, 59, 44, -36, -36, -36,
+ /* 50 */ -36, -36, 15, -36, 18, -36,
};
static YYACTIONTYPE yy_default[] = {
- /* 0 */ 65, 103, 64, 66, 67, 103, 68, 103, 103, 92,
- /* 10 */ 103, 65, 103, 69, 70, 71, 103, 103, 72, 103,
- /* 20 */ 74, 75, 77, 78, 79, 80, 103, 86, 76, 81,
- /* 30 */ 103, 82, 84, 83, 103, 103, 87, 85, 103, 73,
- /* 40 */ 103, 103, 65, 103, 91, 93, 103, 103, 103, 100,
- /* 50 */ 103, 103, 103, 103, 96, 97, 98, 99, 103, 101,
- /* 60 */ 103, 102, 94,
+ /* 0 */ 58, 92, 57, 59, 92, 60, 92, 92, 81, 92,
+ /* 10 */ 58, 92, 61, 62, 63, 92, 92, 64, 92, 66,
+ /* 20 */ 67, 69, 70, 71, 72, 92, 77, 68, 92, 73,
+ /* 30 */ 75, 74, 92, 92, 78, 76, 92, 65, 82, 83,
+ /* 40 */ 92, 92, 92, 89, 92, 92, 92, 92, 85, 86,
+ /* 50 */ 87, 88, 92, 90, 92, 91,
};
#define YY_SZ_ACTTAB (sizeof(yy_action)/sizeof(yy_action[0]))
/* The next table maps tokens into fallback tokens. If a construct
** like the following:
-**
+**
** %fallback ID X Y Z.
**
** appears in the grammer, then ID becomes a fallback token for X, Y,
@@ -344,10 +354,10 @@ static char *yyTracePrompt = 0;
#endif /* NDEBUG */
#ifndef NDEBUG
-/*
+/*
** Turn parser tracing on by giving a stream to which to write the trace
** and a prompt to preface each trace message. Tracing is turned off
-** by making either argument NULL
+** by making either argument NULL
**
** Inputs:
** <ul>
@@ -361,32 +371,29 @@ static char *yyTracePrompt = 0;
** Outputs:
** None.
*/
-#if 0
void configparserTrace(FILE *TraceFILE, char *zTracePrompt){
yyTraceFILE = TraceFILE;
yyTracePrompt = zTracePrompt;
if( yyTraceFILE==0 ) yyTracePrompt = 0;
else if( yyTracePrompt==0 ) yyTraceFILE = 0;
}
-#endif
#endif /* NDEBUG */
#ifndef NDEBUG
/* For tracing shifts, the names of all terminals and nonterminals
** are required. The following table supplies these names */
-static const char *yyTokenName[] = {
+static const char *yyTokenName[] = {
"$", "EOL", "ASSIGN", "APPEND",
"LKEY", "PLUS", "STRING", "INTEGER",
"LPARAN", "RPARAN", "COMMA", "ARRAY_ASSIGN",
- "GLOBAL", "LCURLY", "RCURLY", "ELSE",
- "DOLLAR", "SRVVARNAME", "LBRACKET", "RBRACKET",
- "EQ", "MATCH", "NE", "NOMATCH",
- "INCLUDE", "INCLUDE_SHELL", "error", "input",
- "metalines", "metaline", "varline", "global",
- "condlines", "include", "include_shell", "value",
- "expression", "aelement", "condline", "aelements",
- "array", "key", "stringop", "cond",
- "eols", "globalstart", "context",
+ "ELSE", "LCURLY", "RCURLY", "DOLLAR",
+ "SRVVARNAME", "LBRACKET", "RBRACKET", "EQ",
+ "MATCH", "NE", "NOMATCH", "INCLUDE",
+ "INCLUDE_SHELL", "error", "input", "metalines",
+ "metaline", "varline", "condlines", "include",
+ "include_shell", "value", "expression", "aelement",
+ "condline", "aelements", "array", "key",
+ "stringop", "cond", "eols", "context",
};
#endif /* NDEBUG */
@@ -398,42 +405,38 @@ static const char *yyRuleName[] = {
/* 1 */ "metalines ::= metalines metaline",
/* 2 */ "metalines ::=",
/* 3 */ "metaline ::= varline",
- /* 4 */ "metaline ::= global",
- /* 5 */ "metaline ::= condlines EOL",
- /* 6 */ "metaline ::= include",
- /* 7 */ "metaline ::= include_shell",
- /* 8 */ "metaline ::= EOL",
- /* 9 */ "varline ::= key ASSIGN expression",
- /* 10 */ "varline ::= key APPEND expression",
- /* 11 */ "key ::= LKEY",
- /* 12 */ "expression ::= expression PLUS value",
- /* 13 */ "expression ::= value",
- /* 14 */ "value ::= key",
- /* 15 */ "value ::= STRING",
- /* 16 */ "value ::= INTEGER",
- /* 17 */ "value ::= array",
- /* 18 */ "array ::= LPARAN RPARAN",
- /* 19 */ "array ::= LPARAN aelements RPARAN",
- /* 20 */ "aelements ::= aelements COMMA aelement",
- /* 21 */ "aelements ::= aelements COMMA",
- /* 22 */ "aelements ::= aelement",
- /* 23 */ "aelement ::= expression",
- /* 24 */ "aelement ::= stringop ARRAY_ASSIGN expression",
- /* 25 */ "eols ::= EOL",
- /* 26 */ "eols ::=",
- /* 27 */ "globalstart ::= GLOBAL",
- /* 28 */ "global ::= globalstart LCURLY metalines RCURLY",
- /* 29 */ "condlines ::= condlines eols ELSE condline",
- /* 30 */ "condlines ::= condline",
- /* 31 */ "condline ::= context LCURLY metalines RCURLY",
- /* 32 */ "context ::= DOLLAR SRVVARNAME LBRACKET stringop RBRACKET cond expression",
- /* 33 */ "cond ::= EQ",
- /* 34 */ "cond ::= MATCH",
- /* 35 */ "cond ::= NE",
- /* 36 */ "cond ::= NOMATCH",
- /* 37 */ "stringop ::= expression",
- /* 38 */ "include ::= INCLUDE stringop",
- /* 39 */ "include_shell ::= INCLUDE_SHELL stringop",
+ /* 4 */ "metaline ::= condlines EOL",
+ /* 5 */ "metaline ::= include",
+ /* 6 */ "metaline ::= include_shell",
+ /* 7 */ "metaline ::= EOL",
+ /* 8 */ "varline ::= key ASSIGN expression",
+ /* 9 */ "varline ::= key APPEND expression",
+ /* 10 */ "key ::= LKEY",
+ /* 11 */ "expression ::= expression PLUS value",
+ /* 12 */ "expression ::= value",
+ /* 13 */ "value ::= key",
+ /* 14 */ "value ::= STRING",
+ /* 15 */ "value ::= INTEGER",
+ /* 16 */ "value ::= array",
+ /* 17 */ "array ::= LPARAN aelements RPARAN",
+ /* 18 */ "aelements ::= aelements COMMA aelement",
+ /* 19 */ "aelements ::= aelements COMMA",
+ /* 20 */ "aelements ::= aelement",
+ /* 21 */ "aelement ::= expression",
+ /* 22 */ "aelement ::= stringop ARRAY_ASSIGN expression",
+ /* 23 */ "eols ::= EOL",
+ /* 24 */ "eols ::=",
+ /* 25 */ "condlines ::= condlines eols ELSE condline",
+ /* 26 */ "condlines ::= condline",
+ /* 27 */ "condline ::= context LCURLY metalines RCURLY",
+ /* 28 */ "context ::= DOLLAR SRVVARNAME LBRACKET stringop RBRACKET cond expression",
+ /* 29 */ "cond ::= EQ",
+ /* 30 */ "cond ::= MATCH",
+ /* 31 */ "cond ::= NE",
+ /* 32 */ "cond ::= NOMATCH",
+ /* 33 */ "stringop ::= expression",
+ /* 34 */ "include ::= INCLUDE stringop",
+ /* 35 */ "include_shell ::= INCLUDE_SHELL stringop",
};
#endif /* NDEBUG */
@@ -441,10 +444,9 @@ static const char *yyRuleName[] = {
** This function returns the symbolic name associated with a token
** value.
*/
-#if 0
const char *configparserTokenName(int tokenType){
#ifndef NDEBUG
- if( tokenType>0 && (size_t)tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){
+ if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){
return yyTokenName[tokenType];
}else{
return "Unknown";
@@ -453,9 +455,8 @@ const char *configparserTokenName(int tokenType){
return "";
#endif
}
-#endif
-/*
+/*
** This function allocates a new parser.
** The only argument is a pointer to a function which works like
** malloc.
@@ -486,7 +487,7 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
/* Here is inserted the actions which take place when a
** terminal or non-terminal is destroyed. This can happen
** when the symbol is popped from the stack during a
- ** reduce or during error processing or when a parser is
+ ** reduce or during error processing or when a parser is
** being destroyed before it is finished parsing.
**
** Note: during a reduce, the only symbols destroyed are those
@@ -517,44 +518,43 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
case 22:
case 23:
case 24:
- case 25:
-#line 144 "../../src/configparser.y"
+#line 159 "./configparser.y"
{ buffer_free((yypminor->yy0)); }
#line 523 "configparser.c"
break;
- case 35:
-#line 135 "../../src/configparser.y"
-{ (yypminor->yy41)->free((yypminor->yy41)); }
+ case 33:
+#line 150 "./configparser.y"
+{ (yypminor->yy43)->free((yypminor->yy43)); }
#line 528 "configparser.c"
break;
- case 36:
-#line 136 "../../src/configparser.y"
-{ (yypminor->yy41)->free((yypminor->yy41)); }
+ case 34:
+#line 151 "./configparser.y"
+{ (yypminor->yy43)->free((yypminor->yy43)); }
#line 533 "configparser.c"
break;
- case 37:
-#line 137 "../../src/configparser.y"
-{ (yypminor->yy41)->free((yypminor->yy41)); }
+ case 35:
+#line 152 "./configparser.y"
+{ (yypminor->yy43)->free((yypminor->yy43)); }
#line 538 "configparser.c"
break;
- case 39:
-#line 138 "../../src/configparser.y"
-{ array_free((yypminor->yy40)); }
+ case 37:
+#line 153 "./configparser.y"
+{ array_free((yypminor->yy78)); }
#line 543 "configparser.c"
break;
- case 40:
-#line 139 "../../src/configparser.y"
-{ array_free((yypminor->yy40)); }
+ case 38:
+#line 154 "./configparser.y"
+{ array_free((yypminor->yy78)); }
#line 548 "configparser.c"
break;
- case 41:
-#line 140 "../../src/configparser.y"
-{ buffer_free((yypminor->yy43)); }
+ case 39:
+#line 155 "./configparser.y"
+{ buffer_free((yypminor->yy1)); }
#line 553 "configparser.c"
break;
- case 42:
-#line 141 "../../src/configparser.y"
-{ buffer_free((yypminor->yy43)); }
+ case 40:
+#line 156 "./configparser.y"
+{ buffer_free((yypminor->yy1)); }
#line 558 "configparser.c"
break;
default: break; /* If no destructor action specified: do nothing */
@@ -587,7 +587,7 @@ static int yy_pop_parser_stack(yyParser *pParser){
return yymajor;
}
-/*
+/*
** Deallocate and destroy a parser. Destructors are all called for
** all stack elements before shutting the parser down.
**
@@ -623,7 +623,7 @@ static int yy_find_shift_action(
){
int i;
int stateno = pParser->yystack[pParser->yyidx].stateno;
-
+
/* if( pParser->yyidx<0 ) return YY_NO_ACTION; */
i = yy_shift_ofst[stateno];
if( i==YY_SHIFT_USE_DFLT ){
@@ -633,7 +633,7 @@ static int yy_find_shift_action(
return YY_NO_ACTION;
}
i += iLookAhead;
- if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
+ if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK
int iFallback; /* Fallback token */
if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
@@ -667,7 +667,7 @@ static int yy_find_reduce_action(
){
int i;
int stateno = pParser->yystack[pParser->yyidx].stateno;
-
+
i = yy_reduce_ofst[stateno];
if( i==YY_REDUCE_USE_DFLT ){
return yy_default[stateno];
@@ -676,7 +676,7 @@ static int yy_find_reduce_action(
return YY_NO_ACTION;
}
i += iLookAhead;
- if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
+ if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
return yy_default[stateno];
}else{
return yy_action[i];
@@ -731,46 +731,42 @@ static struct {
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
unsigned char nrhs; /* Number of right-hand side symbols in the rule */
} yyRuleInfo[] = {
- { 27, 1 },
+ { 26, 1 },
+ { 27, 2 },
+ { 27, 0 },
+ { 28, 1 },
{ 28, 2 },
- { 28, 0 },
- { 29, 1 },
- { 29, 1 },
- { 29, 2 },
- { 29, 1 },
- { 29, 1 },
- { 29, 1 },
- { 30, 3 },
- { 30, 3 },
- { 41, 1 },
- { 36, 3 },
- { 36, 1 },
- { 35, 1 },
- { 35, 1 },
- { 35, 1 },
- { 35, 1 },
- { 40, 2 },
- { 40, 3 },
- { 39, 3 },
- { 39, 2 },
+ { 28, 1 },
+ { 28, 1 },
+ { 28, 1 },
+ { 29, 3 },
+ { 29, 3 },
{ 39, 1 },
- { 37, 1 },
+ { 34, 3 },
+ { 34, 1 },
+ { 33, 1 },
+ { 33, 1 },
+ { 33, 1 },
+ { 33, 1 },
+ { 38, 3 },
{ 37, 3 },
- { 44, 1 },
- { 44, 0 },
- { 45, 1 },
- { 31, 4 },
- { 32, 4 },
- { 32, 1 },
- { 38, 4 },
- { 46, 7 },
- { 43, 1 },
- { 43, 1 },
- { 43, 1 },
- { 43, 1 },
+ { 37, 2 },
+ { 37, 1 },
+ { 35, 1 },
+ { 35, 3 },
{ 42, 1 },
- { 33, 2 },
- { 34, 2 },
+ { 42, 0 },
+ { 30, 4 },
+ { 30, 1 },
+ { 36, 4 },
+ { 43, 7 },
+ { 41, 1 },
+ { 41, 1 },
+ { 41, 1 },
+ { 41, 1 },
+ { 40, 1 },
+ { 31, 2 },
+ { 32, 2 },
};
static void yy_accept(yyParser*); /* Forward Declaration */
@@ -791,8 +787,8 @@ static void yy_reduce(
configparserARG_FETCH;
yymsp = &yypParser->yystack[yypParser->yyidx];
#ifndef NDEBUG
- if( yyTraceFILE && yyruleno>=0
- && (size_t)yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
+ if( yyTraceFILE && yyruleno>=0
+ && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
yyRuleName[yyruleno]);
}
@@ -820,359 +816,287 @@ static void yy_reduce(
/* No destructor defined for varline */
break;
case 4:
- /* No destructor defined for global */
- break;
- case 5:
-#line 117 "../../src/configparser.y"
-{ yymsp[-1].minor.yy78 = NULL; }
-#line 828 "configparser.c"
+#line 133 "./configparser.y"
+{ yymsp[-1].minor.yy74 = NULL; }
+#line 821 "configparser.c"
yy_destructor(1,&yymsp[0].minor);
break;
- case 6:
+ case 5:
/* No destructor defined for include */
break;
- case 7:
+ case 6:
/* No destructor defined for include_shell */
break;
- case 8:
+ case 7:
yy_destructor(1,&yymsp[0].minor);
break;
- case 9:
-#line 146 "../../src/configparser.y"
+ case 8:
+#line 161 "./configparser.y"
{
- if (ctx->ok) {
- buffer_copy_string_buffer(yymsp[0].minor.yy41->key, yymsp[-2].minor.yy43);
- if (strncmp(yymsp[-2].minor.yy43->ptr, "env.", sizeof("env.") - 1) == 0) {
- fprintf(stderr, "Setting env variable is not supported in conditional %d %s: %s\n",
- ctx->current->context_ndx,
- ctx->current->key->ptr, yymsp[-2].minor.yy43->ptr);
- ctx->ok = 0;
- } else if (NULL == array_get_element(ctx->current->value, yymsp[0].minor.yy41->key->ptr)) {
- array_insert_unique(ctx->current->value, yymsp[0].minor.yy41);
- yymsp[0].minor.yy41 = NULL;
- } else {
- fprintf(stderr, "Duplicate config variable in conditional %d %s: %s\n",
- ctx->current->context_ndx,
- ctx->current->key->ptr, yymsp[0].minor.yy41->key->ptr);
- ctx->ok = 0;
- yymsp[0].minor.yy41->free(yymsp[0].minor.yy41);
- yymsp[0].minor.yy41 = NULL;
- }
+ buffer_copy_string_buffer(yymsp[0].minor.yy43->key, yymsp[-2].minor.yy1);
+ if (NULL == array_get_element(ctx->current->value, yymsp[0].minor.yy43->key->ptr)) {
+ array_insert_unique(ctx->current->value, yymsp[0].minor.yy43);
+ yymsp[0].minor.yy43 = NULL;
+ } else {
+ fprintf(stderr, "Duplicate config variable in conditional %d %s: %s\n",
+ ctx->current->context_ndx,
+ ctx->current->key->ptr, yymsp[0].minor.yy43->key->ptr);
+ ctx->ok = 0;
+ yymsp[0].minor.yy43->free(yymsp[0].minor.yy43);
+ yymsp[0].minor.yy43 = NULL;
}
- buffer_free(yymsp[-2].minor.yy43);
- yymsp[-2].minor.yy43 = NULL;
+ buffer_free(yymsp[-2].minor.yy1);
+ yymsp[-2].minor.yy1 = NULL;
}
-#line 865 "configparser.c"
+#line 851 "configparser.c"
yy_destructor(2,&yymsp[-1].minor);
break;
- case 10:
-#line 170 "../../src/configparser.y"
+ case 9:
+#line 178 "./configparser.y"
{
array *vars = ctx->current->value;
data_unset *du;
- if (strncmp(yymsp[-2].minor.yy43->ptr, "env.", sizeof("env.") - 1) == 0) {
- fprintf(stderr, "Appending env variable is not supported in conditional %d %s: %s\n",
- ctx->current->context_ndx,
- ctx->current->key->ptr, yymsp[-2].minor.yy43->ptr);
- ctx->ok = 0;
- } else if (NULL != (du = array_get_element(vars, yymsp[-2].minor.yy43->ptr))) {
+ if (NULL != (du = array_get_element(vars, yymsp[-2].minor.yy1->ptr))) {
/* exists in current block */
- du = configparser_merge_data(du, yymsp[0].minor.yy41);
+ du = configparser_merge_data(du, yymsp[0].minor.yy43);
if (NULL == du) {
ctx->ok = 0;
}
else {
- buffer_copy_string_buffer(du->key, yymsp[-2].minor.yy43);
+ buffer_copy_string_buffer(du->key, yymsp[-2].minor.yy1);
array_replace(vars, du);
}
- yymsp[0].minor.yy41->free(yymsp[0].minor.yy41);
- } else if (NULL != (du = configparser_get_variable(ctx, yymsp[-2].minor.yy43))) {
- du = configparser_merge_data(du, yymsp[0].minor.yy41);
+ } else if (NULL != (du = configparser_get_variable(ctx, yymsp[-2].minor.yy1))) {
+ du = configparser_merge_data(du, yymsp[0].minor.yy43);
if (NULL == du) {
ctx->ok = 0;
}
else {
- buffer_copy_string_buffer(du->key, yymsp[-2].minor.yy43);
+ buffer_copy_string_buffer(du->key, yymsp[-2].minor.yy1);
array_insert_unique(ctx->current->value, du);
}
- yymsp[0].minor.yy41->free(yymsp[0].minor.yy41);
} else {
- buffer_copy_string_buffer(yymsp[0].minor.yy41->key, yymsp[-2].minor.yy43);
- array_insert_unique(ctx->current->value, yymsp[0].minor.yy41);
+ fprintf(stderr, "Undefined config variable in conditional %d %s: %s\n",
+ ctx->current->context_ndx,
+ ctx->current->key->ptr, yymsp[-2].minor.yy1->ptr);
+ ctx->ok = 0;
}
- buffer_free(yymsp[-2].minor.yy43);
- yymsp[-2].minor.yy43 = NULL;
- yymsp[0].minor.yy41 = NULL;
+ buffer_free(yymsp[-2].minor.yy1);
+ yymsp[-2].minor.yy1 = NULL;
+ yymsp[0].minor.yy43->free(yymsp[0].minor.yy43);
+ yymsp[0].minor.yy43 = NULL;
}
-#line 908 "configparser.c"
+#line 890 "configparser.c"
yy_destructor(3,&yymsp[-1].minor);
break;
- case 11:
-#line 209 "../../src/configparser.y"
+ case 10:
+#line 213 "./configparser.y"
{
if (strchr(yymsp[0].minor.yy0->ptr, '.') == NULL) {
- yygotominor.yy43 = buffer_init_string("var.");
- buffer_append_string_buffer(yygotominor.yy43, yymsp[0].minor.yy0);
+ yygotominor.yy1 = buffer_init_string("var.");
+ buffer_append_string_buffer(yygotominor.yy1, yymsp[0].minor.yy0);
buffer_free(yymsp[0].minor.yy0);
yymsp[0].minor.yy0 = NULL;
} else {
- yygotominor.yy43 = yymsp[0].minor.yy0;
+ yygotominor.yy1 = yymsp[0].minor.yy0;
yymsp[0].minor.yy0 = NULL;
}
}
-#line 924 "configparser.c"
+#line 906 "configparser.c"
break;
- case 12:
-#line 221 "../../src/configparser.y"
+ case 11:
+#line 225 "./configparser.y"
{
- yygotominor.yy41 = configparser_merge_data(yymsp[-2].minor.yy41, yymsp[0].minor.yy41);
- if (NULL == yygotominor.yy41) {
+ yygotominor.yy43 = configparser_merge_data(yymsp[-2].minor.yy43, yymsp[0].minor.yy43);
+ if (NULL == yygotominor.yy43) {
ctx->ok = 0;
}
- yymsp[-2].minor.yy41 = NULL;
- yymsp[0].minor.yy41->free(yymsp[0].minor.yy41);
- yymsp[0].minor.yy41 = NULL;
+ yymsp[-2].minor.yy43 = NULL;
+ yymsp[0].minor.yy43->free(yymsp[0].minor.yy43);
+ yymsp[0].minor.yy43 = NULL;
}
-#line 937 "configparser.c"
+#line 919 "configparser.c"
yy_destructor(5,&yymsp[-1].minor);
break;
- case 13:
-#line 231 "../../src/configparser.y"
+ case 12:
+#line 235 "./configparser.y"
{
- yygotominor.yy41 = yymsp[0].minor.yy41;
- yymsp[0].minor.yy41 = NULL;
+ yygotominor.yy43 = yymsp[0].minor.yy43;
+ yymsp[0].minor.yy43 = NULL;
}
-#line 946 "configparser.c"
+#line 928 "configparser.c"
break;
- case 14:
-#line 236 "../../src/configparser.y"
+ case 13:
+#line 240 "./configparser.y"
{
- yygotominor.yy41 = NULL;
- if (strncmp(yymsp[0].minor.yy43->ptr, "env.", sizeof("env.") - 1) == 0) {
- char *env;
-
- if (NULL != (env = getenv(yymsp[0].minor.yy43->ptr + 4))) {
- data_string *ds;
- ds = data_string_init();
- buffer_append_string(ds->value, env);
- yygotominor.yy41 = (data_unset *)ds;
- }
- else {
- fprintf(stderr, "Undefined env variable: %s\n", yymsp[0].minor.yy43->ptr + 4);
- ctx->ok = 0;
- }
- } else if (NULL == (yygotominor.yy41 = configparser_get_variable(ctx, yymsp[0].minor.yy43))) {
- fprintf(stderr, "Undefined config variable: %s\n", yymsp[0].minor.yy43->ptr);
- ctx->ok = 0;
- }
- if (!yygotominor.yy41) {
+ yygotominor.yy43 = configparser_get_variable(ctx, yymsp[0].minor.yy1);
+ if (!yygotominor.yy43) {
/* make a dummy so it won't crash */
- yygotominor.yy41 = (data_unset *)data_string_init();
+ yygotominor.yy43 = (data_unset *)data_string_init();
}
- buffer_free(yymsp[0].minor.yy43);
- yymsp[0].minor.yy43 = NULL;
+ buffer_free(yymsp[0].minor.yy1);
+ yymsp[0].minor.yy1 = NULL;
}
-#line 976 "configparser.c"
+#line 941 "configparser.c"
break;
- case 15:
-#line 263 "../../src/configparser.y"
+ case 14:
+#line 250 "./configparser.y"
{
- yygotominor.yy41 = (data_unset *)data_string_init();
- buffer_copy_string_buffer(((data_string *)(yygotominor.yy41))->value, yymsp[0].minor.yy0);
+ yygotominor.yy43 = (data_unset *)data_string_init();
+ buffer_copy_string_buffer(((data_string *)(yygotominor.yy43))->value, yymsp[0].minor.yy0);
buffer_free(yymsp[0].minor.yy0);
yymsp[0].minor.yy0 = NULL;
}
-#line 986 "configparser.c"
+#line 951 "configparser.c"
break;
- case 16:
-#line 270 "../../src/configparser.y"
+ case 15:
+#line 257 "./configparser.y"
{
- yygotominor.yy41 = (data_unset *)data_integer_init();
- ((data_integer *)(yygotominor.yy41))->value = strtol(yymsp[0].minor.yy0->ptr, NULL, 10);
+ yygotominor.yy43 = (data_unset *)data_integer_init();
+ ((data_integer *)(yygotominor.yy43))->value = strtol(yymsp[0].minor.yy0->ptr, NULL, 10);
buffer_free(yymsp[0].minor.yy0);
yymsp[0].minor.yy0 = NULL;
}
-#line 996 "configparser.c"
- break;
- case 17:
-#line 276 "../../src/configparser.y"
-{
- yygotominor.yy41 = (data_unset *)data_array_init();
- array_free(((data_array *)(yygotominor.yy41))->value);
- ((data_array *)(yygotominor.yy41))->value = yymsp[0].minor.yy40;
- yymsp[0].minor.yy40 = NULL;
-}
-#line 1006 "configparser.c"
+#line 961 "configparser.c"
break;
- case 18:
-#line 282 "../../src/configparser.y"
+ case 16:
+#line 263 "./configparser.y"
{
- yygotominor.yy40 = array_init();
+ yygotominor.yy43 = (data_unset *)data_array_init();
+ array_free(((data_array *)(yygotominor.yy43))->value);
+ ((data_array *)(yygotominor.yy43))->value = yymsp[0].minor.yy78;
+ yymsp[0].minor.yy78 = NULL;
}
-#line 1013 "configparser.c"
- yy_destructor(8,&yymsp[-1].minor);
- yy_destructor(9,&yymsp[0].minor);
+#line 971 "configparser.c"
break;
- case 19:
-#line 285 "../../src/configparser.y"
+ case 17:
+#line 269 "./configparser.y"
{
- yygotominor.yy40 = yymsp[-1].minor.yy40;
- yymsp[-1].minor.yy40 = NULL;
+ yygotominor.yy78 = yymsp[-1].minor.yy78;
+ yymsp[-1].minor.yy78 = NULL;
}
-#line 1023 "configparser.c"
+#line 979 "configparser.c"
yy_destructor(8,&yymsp[-2].minor);
yy_destructor(9,&yymsp[0].minor);
break;
- case 20:
-#line 290 "../../src/configparser.y"
+ case 18:
+#line 274 "./configparser.y"
{
- if (buffer_is_empty(yymsp[0].minor.yy41->key) ||
- NULL == array_get_element(yymsp[-2].minor.yy40, yymsp[0].minor.yy41->key->ptr)) {
- array_insert_unique(yymsp[-2].minor.yy40, yymsp[0].minor.yy41);
- yymsp[0].minor.yy41 = NULL;
+ if (buffer_is_empty(yymsp[0].minor.yy43->key) ||
+ NULL == array_get_element(yymsp[-2].minor.yy78, yymsp[0].minor.yy43->key->ptr)) {
+ array_insert_unique(yymsp[-2].minor.yy78, yymsp[0].minor.yy43);
+ yymsp[0].minor.yy43 = NULL;
} else {
- fprintf(stderr, "Duplicate array-key: %s\n",
- yymsp[0].minor.yy41->key->ptr);
+ fprintf(stderr, "Duplicate array-key: %s\n",
+ yymsp[0].minor.yy43->key->ptr);
ctx->ok = 0;
- yymsp[0].minor.yy41->free(yymsp[0].minor.yy41);
- yymsp[0].minor.yy41 = NULL;
+ yymsp[0].minor.yy43->free(yymsp[0].minor.yy43);
+ yymsp[0].minor.yy43 = NULL;
}
-
- yygotominor.yy40 = yymsp[-2].minor.yy40;
- yymsp[-2].minor.yy40 = NULL;
+
+ yygotominor.yy78 = yymsp[-2].minor.yy78;
+ yymsp[-2].minor.yy78 = NULL;
}
-#line 1045 "configparser.c"
+#line 1001 "configparser.c"
yy_destructor(10,&yymsp[-1].minor);
break;
- case 21:
-#line 307 "../../src/configparser.y"
+ case 19:
+#line 291 "./configparser.y"
{
- yygotominor.yy40 = yymsp[-1].minor.yy40;
- yymsp[-1].minor.yy40 = NULL;
+ yygotominor.yy78 = yymsp[-1].minor.yy78;
+ yymsp[-1].minor.yy78 = NULL;
}
-#line 1054 "configparser.c"
+#line 1010 "configparser.c"
yy_destructor(10,&yymsp[0].minor);
break;
- case 22:
-#line 312 "../../src/configparser.y"
+ case 20:
+#line 296 "./configparser.y"
{
- yygotominor.yy40 = array_init();
- array_insert_unique(yygotominor.yy40, yymsp[0].minor.yy41);
- yymsp[0].minor.yy41 = NULL;
+ yygotominor.yy78 = array_init();
+ array_insert_unique(yygotominor.yy78, yymsp[0].minor.yy43);
+ yymsp[0].minor.yy43 = NULL;
}
-#line 1064 "configparser.c"
+#line 1020 "configparser.c"
break;
- case 23:
-#line 318 "../../src/configparser.y"
+ case 21:
+#line 302 "./configparser.y"
{
- yygotominor.yy41 = yymsp[0].minor.yy41;
- yymsp[0].minor.yy41 = NULL;
+ yygotominor.yy43 = yymsp[0].minor.yy43;
+ yymsp[0].minor.yy43 = NULL;
}
-#line 1072 "configparser.c"
+#line 1028 "configparser.c"
break;
- case 24:
-#line 322 "../../src/configparser.y"
+ case 22:
+#line 306 "./configparser.y"
{
- buffer_copy_string_buffer(yymsp[0].minor.yy41->key, yymsp[-2].minor.yy43);
- buffer_free(yymsp[-2].minor.yy43);
- yymsp[-2].minor.yy43 = NULL;
-
- yygotominor.yy41 = yymsp[0].minor.yy41;
- yymsp[0].minor.yy41 = NULL;
+ buffer_copy_string_buffer(yymsp[0].minor.yy43->key, yymsp[-2].minor.yy1);
+ buffer_free(yymsp[-2].minor.yy1);
+ yymsp[-2].minor.yy1 = NULL;
+
+ yygotominor.yy43 = yymsp[0].minor.yy43;
+ yymsp[0].minor.yy43 = NULL;
}
-#line 1084 "configparser.c"
+#line 1040 "configparser.c"
yy_destructor(11,&yymsp[-1].minor);
break;
- case 25:
+ case 23:
yy_destructor(1,&yymsp[0].minor);
break;
- case 26:
- break;
- case 27:
-#line 334 "../../src/configparser.y"
-{
- data_config *dc;
- dc = (data_config *)array_get_element(ctx->srv->config_context, "global");
- assert(dc);
- configparser_push(ctx, dc, 0);
-}
-#line 1100 "configparser.c"
- yy_destructor(12,&yymsp[0].minor);
- break;
- case 28:
-#line 341 "../../src/configparser.y"
-{
- data_config *cur;
-
- cur = ctx->current;
- configparser_pop(ctx);
-
- assert(cur && ctx->current);
-
- yygotominor.yy78 = cur;
-}
-#line 1115 "configparser.c"
- /* No destructor defined for globalstart */
- yy_destructor(13,&yymsp[-2].minor);
- /* No destructor defined for metalines */
- yy_destructor(14,&yymsp[0].minor);
+ case 24:
break;
- case 29:
-#line 352 "../../src/configparser.y"
+ case 25:
+#line 318 "./configparser.y"
{
- if (yymsp[-3].minor.yy78->context_ndx >= yymsp[0].minor.yy78->context_ndx) {
- fprintf(stderr, "unreachable else condition\n");
- ctx->ok = 0;
- }
- yymsp[0].minor.yy78->prev = yymsp[-3].minor.yy78;
- yymsp[-3].minor.yy78->next = yymsp[0].minor.yy78;
- yygotominor.yy78 = yymsp[0].minor.yy78;
- yymsp[-3].minor.yy78 = NULL;
- yymsp[0].minor.yy78 = NULL;
+ assert(yymsp[-3].minor.yy74->context_ndx < yymsp[0].minor.yy74->context_ndx);
+ yymsp[0].minor.yy74->prev = yymsp[-3].minor.yy74;
+ yymsp[-3].minor.yy74->next = yymsp[0].minor.yy74;
+ yygotominor.yy74 = yymsp[0].minor.yy74;
+ yymsp[-3].minor.yy74 = NULL;
+ yymsp[0].minor.yy74 = NULL;
}
-#line 1134 "configparser.c"
+#line 1058 "configparser.c"
/* No destructor defined for eols */
- yy_destructor(15,&yymsp[-1].minor);
+ yy_destructor(12,&yymsp[-1].minor);
break;
- case 30:
-#line 364 "../../src/configparser.y"
+ case 26:
+#line 327 "./configparser.y"
{
- yygotominor.yy78 = yymsp[0].minor.yy78;
- yymsp[0].minor.yy78 = NULL;
+ yygotominor.yy74 = yymsp[0].minor.yy74;
+ yymsp[0].minor.yy74 = NULL;
}
-#line 1144 "configparser.c"
+#line 1068 "configparser.c"
break;
- case 31:
-#line 369 "../../src/configparser.y"
+ case 27:
+#line 332 "./configparser.y"
{
data_config *cur;
-
+
cur = ctx->current;
configparser_pop(ctx);
assert(cur && ctx->current);
- yygotominor.yy78 = cur;
+ yygotominor.yy74 = cur;
}
-#line 1158 "configparser.c"
+#line 1082 "configparser.c"
/* No destructor defined for context */
yy_destructor(13,&yymsp[-2].minor);
/* No destructor defined for metalines */
yy_destructor(14,&yymsp[0].minor);
break;
- case 32:
-#line 380 "../../src/configparser.y"
+ case 28:
+#line 343 "./configparser.y"
{
data_config *dc;
buffer *b, *rvalue, *op;
- if (ctx->ok && yymsp[0].minor.yy41->type != TYPE_STRING) {
+ if (ctx->ok && yymsp[0].minor.yy43->type != TYPE_STRING) {
fprintf(stderr, "rvalue must be string");
ctx->ok = 0;
}
- switch(yymsp[-1].minor.yy27) {
+ switch(yymsp[-1].minor.yy29) {
case CONFIG_COND_NE:
op = buffer_init_string("!=");
break;
@@ -1194,11 +1118,11 @@ static void yy_reduce(
buffer_copy_string_buffer(b, ctx->current->key);
buffer_append_string(b, "/");
buffer_append_string_buffer(b, yymsp[-5].minor.yy0);
- buffer_append_string_buffer(b, yymsp[-3].minor.yy43);
+ buffer_append_string_buffer(b, yymsp[-3].minor.yy1);
buffer_append_string_buffer(b, op);
- rvalue = ((data_string*)yymsp[0].minor.yy41)->value;
+ rvalue = ((data_string*)yymsp[0].minor.yy43)->value;
buffer_append_string_buffer(b, rvalue);
-
+
if (NULL != (dc = (data_config *)array_get_element(ctx->all_configs, b->ptr))) {
configparser_push(ctx, dc, 0);
} else {
@@ -1211,30 +1135,23 @@ static void yy_reduce(
{ COMP_HTTP_URL, CONST_STR_LEN("HTTP[\"url\"]" ) },
{ COMP_HTTP_HOST, CONST_STR_LEN("HTTP[\"host\"]" ) },
{ COMP_HTTP_REFERER, CONST_STR_LEN("HTTP[\"referer\"]" ) },
- { COMP_HTTP_USER_AGENT, CONST_STR_LEN("HTTP[\"useragent\"]" ) },
- { COMP_HTTP_USER_AGENT, CONST_STR_LEN("HTTP[\"user-agent\"]" ) },
- { COMP_HTTP_LANGUAGE, CONST_STR_LEN("HTTP[\"language\"]" ) },
+ { COMP_HTTP_USERAGENT, CONST_STR_LEN("HTTP[\"useragent\"]" ) },
{ COMP_HTTP_COOKIE, CONST_STR_LEN("HTTP[\"cookie\"]" ) },
- { COMP_HTTP_REMOTE_IP, CONST_STR_LEN("HTTP[\"remoteip\"]" ) },
- { COMP_HTTP_REMOTE_IP, CONST_STR_LEN("HTTP[\"remote-ip\"]" ) },
- { COMP_HTTP_QUERY_STRING, CONST_STR_LEN("HTTP[\"querystring\"]") },
- { COMP_HTTP_QUERY_STRING, CONST_STR_LEN("HTTP[\"query-string\"]") },
- { COMP_HTTP_REQUEST_METHOD, CONST_STR_LEN("HTTP[\"request-method\"]") },
- { COMP_HTTP_SCHEME, CONST_STR_LEN("HTTP[\"scheme\"]" ) },
+ { COMP_HTTP_REMOTEIP, CONST_STR_LEN("HTTP[\"remoteip\"]" ) },
{ COMP_UNSET, NULL, 0 },
};
size_t i;
dc = data_config_init();
-
+
buffer_copy_string_buffer(dc->key, b);
buffer_copy_string_buffer(dc->op, op);
buffer_copy_string_buffer(dc->comp_key, yymsp[-5].minor.yy0);
buffer_append_string_len(dc->comp_key, CONST_STR_LEN("[\""));
- buffer_append_string_buffer(dc->comp_key, yymsp[-3].minor.yy43);
+ buffer_append_string_buffer(dc->comp_key, yymsp[-3].minor.yy1);
buffer_append_string_len(dc->comp_key, CONST_STR_LEN("\"]"));
- dc->cond = yymsp[-1].minor.yy27;
-
+ dc->cond = yymsp[-1].minor.yy29;
+
for (i = 0; comps[i].comp_key; i ++) {
if (buffer_is_equal_string(
dc->comp_key, comps[i].comp_key, comps[i].len)) {
@@ -1247,7 +1164,7 @@ static void yy_reduce(
ctx->ok = 0;
}
- switch(yymsp[-1].minor.yy27) {
+ switch(yymsp[-1].minor.yy29) {
case CONFIG_COND_NE:
case CONFIG_COND_EQ:
dc->string = buffer_init_buffer(rvalue);
@@ -1256,50 +1173,42 @@ static void yy_reduce(
case CONFIG_COND_MATCH: {
#ifdef HAVE_PCRE_H
const char *errptr;
- int erroff, captures;
-
- if (NULL == (dc->regex =
+ int erroff;
+
+ if (NULL == (dc->regex =
pcre_compile(rvalue->ptr, 0, &errptr, &erroff, NULL))) {
dc->string = buffer_init_string(errptr);
dc->cond = CONFIG_COND_UNSET;
- fprintf(stderr, "parsing regex failed: %s -> %s at offset %d\n",
+ fprintf(stderr, "parsing regex failed: %s -> %s at offset %d\n",
rvalue->ptr, errptr, erroff);
ctx->ok = 0;
} else if (NULL == (dc->regex_study =
- pcre_study(dc->regex, 0, &errptr)) &&
+ pcre_study(dc->regex, 0, &errptr)) &&
errptr != NULL) {
- fprintf(stderr, "studying regex failed: %s -> %s\n",
+ fprintf(stderr, "studying regex failed: %s -> %s\n",
rvalue->ptr, errptr);
ctx->ok = 0;
- } else if (0 != (pcre_fullinfo(dc->regex, dc->regex_study, PCRE_INFO_CAPTURECOUNT, &captures))) {
- fprintf(stderr, "getting capture count for regex failed: %s\n",
- rvalue->ptr);
- ctx->ok = 0;
- } else if (captures > 9) {
- fprintf(stderr, "Too many captures in regex, use (?:...) instead of (...): %s\n",
- rvalue->ptr);
- ctx->ok = 0;
} else {
dc->string = buffer_init_buffer(rvalue);
}
#else
- fprintf(stderr, "can't handle '$%s[%s] =~ ...' as you compiled without pcre support. \n"
- "(perhaps just a missing pcre-devel package ?) \n",
- yymsp[-5].minor.yy0->ptr, yymsp[-3].minor.yy43->ptr);
+ fprintf(stderr, "regex conditionals are not allowed as pcre-support" \
+ "is missing: $%s[%s]\n",
+ yymsp[-5].minor.yy0->ptr, yymsp[-3].minor.yy1->ptr);
ctx->ok = 0;
#endif
break;
}
default:
- fprintf(stderr, "unknown condition for $%s[%s]\n",
- yymsp[-5].minor.yy0->ptr, yymsp[-3].minor.yy43->ptr);
+ fprintf(stderr, "unknown condition for $%s[%s]\n",
+ yymsp[-5].minor.yy0->ptr, yymsp[-3].minor.yy1->ptr);
ctx->ok = 0;
break;
}
-
+
configparser_push(ctx, dc, 1);
}
@@ -1307,95 +1216,95 @@ static void yy_reduce(
buffer_free(op);
buffer_free(yymsp[-5].minor.yy0);
yymsp[-5].minor.yy0 = NULL;
- buffer_free(yymsp[-3].minor.yy43);
- yymsp[-3].minor.yy43 = NULL;
- yymsp[0].minor.yy41->free(yymsp[0].minor.yy41);
- yymsp[0].minor.yy41 = NULL;
+ buffer_free(yymsp[-3].minor.yy1);
+ yymsp[-3].minor.yy1 = NULL;
+ yymsp[0].minor.yy43->free(yymsp[0].minor.yy43);
+ yymsp[0].minor.yy43 = NULL;
}
-#line 1315 "configparser.c"
- yy_destructor(16,&yymsp[-6].minor);
- yy_destructor(18,&yymsp[-4].minor);
- yy_destructor(19,&yymsp[-2].minor);
+#line 1224 "configparser.c"
+ yy_destructor(15,&yymsp[-6].minor);
+ yy_destructor(17,&yymsp[-4].minor);
+ yy_destructor(18,&yymsp[-2].minor);
break;
- case 33:
-#line 529 "../../src/configparser.y"
+ case 29:
+#line 477 "./configparser.y"
{
- yygotominor.yy27 = CONFIG_COND_EQ;
+ yygotominor.yy29 = CONFIG_COND_EQ;
}
-#line 1325 "configparser.c"
- yy_destructor(20,&yymsp[0].minor);
+#line 1234 "configparser.c"
+ yy_destructor(19,&yymsp[0].minor);
break;
- case 34:
-#line 532 "../../src/configparser.y"
+ case 30:
+#line 480 "./configparser.y"
{
- yygotominor.yy27 = CONFIG_COND_MATCH;
+ yygotominor.yy29 = CONFIG_COND_MATCH;
}
-#line 1333 "configparser.c"
- yy_destructor(21,&yymsp[0].minor);
+#line 1242 "configparser.c"
+ yy_destructor(20,&yymsp[0].minor);
break;
- case 35:
-#line 535 "../../src/configparser.y"
+ case 31:
+#line 483 "./configparser.y"
{
- yygotominor.yy27 = CONFIG_COND_NE;
+ yygotominor.yy29 = CONFIG_COND_NE;
}
-#line 1341 "configparser.c"
- yy_destructor(22,&yymsp[0].minor);
+#line 1250 "configparser.c"
+ yy_destructor(21,&yymsp[0].minor);
break;
- case 36:
-#line 538 "../../src/configparser.y"
+ case 32:
+#line 486 "./configparser.y"
{
- yygotominor.yy27 = CONFIG_COND_NOMATCH;
+ yygotominor.yy29 = CONFIG_COND_NOMATCH;
}
-#line 1349 "configparser.c"
- yy_destructor(23,&yymsp[0].minor);
+#line 1258 "configparser.c"
+ yy_destructor(22,&yymsp[0].minor);
break;
- case 37:
-#line 542 "../../src/configparser.y"
+ case 33:
+#line 490 "./configparser.y"
{
- yygotominor.yy43 = NULL;
+ yygotominor.yy1 = NULL;
if (ctx->ok) {
- if (yymsp[0].minor.yy41->type == TYPE_STRING) {
- yygotominor.yy43 = buffer_init_buffer(((data_string*)yymsp[0].minor.yy41)->value);
- } else if (yymsp[0].minor.yy41->type == TYPE_INTEGER) {
- yygotominor.yy43 = buffer_init();
- buffer_copy_long(yygotominor.yy43, ((data_integer *)yymsp[0].minor.yy41)->value);
+ if (yymsp[0].minor.yy43->type == TYPE_STRING) {
+ yygotominor.yy1 = buffer_init_buffer(((data_string*)yymsp[0].minor.yy43)->value);
+ } else if (yymsp[0].minor.yy43->type == TYPE_INTEGER) {
+ yygotominor.yy1 = buffer_init();
+ buffer_copy_long(yygotominor.yy1, ((data_integer *)yymsp[0].minor.yy43)->value);
} else {
fprintf(stderr, "operand must be string");
ctx->ok = 0;
}
}
- yymsp[0].minor.yy41->free(yymsp[0].minor.yy41);
- yymsp[0].minor.yy41 = NULL;
+ yymsp[0].minor.yy43->free(yymsp[0].minor.yy43);
+ yymsp[0].minor.yy43 = NULL;
}
-#line 1370 "configparser.c"
+#line 1279 "configparser.c"
break;
- case 38:
-#line 559 "../../src/configparser.y"
+ case 34:
+#line 507 "./configparser.y"
{
if (ctx->ok) {
- if (0 != config_parse_file(ctx->srv, ctx, yymsp[0].minor.yy43->ptr)) {
+ if (0 != config_parse_file(ctx->srv, ctx, yymsp[0].minor.yy1->ptr)) {
ctx->ok = 0;
}
- buffer_free(yymsp[0].minor.yy43);
- yymsp[0].minor.yy43 = NULL;
+ buffer_free(yymsp[0].minor.yy1);
+ yymsp[0].minor.yy1 = NULL;
}
}
-#line 1383 "configparser.c"
- yy_destructor(24,&yymsp[-1].minor);
+#line 1292 "configparser.c"
+ yy_destructor(23,&yymsp[-1].minor);
break;
- case 39:
-#line 569 "../../src/configparser.y"
+ case 35:
+#line 517 "./configparser.y"
{
if (ctx->ok) {
- if (0 != config_parse_cmd(ctx->srv, ctx, yymsp[0].minor.yy43->ptr)) {
+ if (0 != config_parse_cmd(ctx->srv, ctx, yymsp[0].minor.yy1->ptr)) {
ctx->ok = 0;
}
- buffer_free(yymsp[0].minor.yy43);
- yymsp[0].minor.yy43 = NULL;
+ buffer_free(yymsp[0].minor.yy1);
+ yymsp[0].minor.yy1 = NULL;
}
}
-#line 1397 "configparser.c"
- yy_destructor(25,&yymsp[-1].minor);
+#line 1306 "configparser.c"
+ yy_destructor(24,&yymsp[-1].minor);
break;
};
yygoto = yyRuleInfo[yyruleno].lhs;
@@ -1424,11 +1333,11 @@ static void yy_parse_failed(
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will be executed whenever the
** parser fails */
-#line 108 "../../src/configparser.y"
+#line 125 "./configparser.y"
ctx->ok = 0;
-#line 1431 "configparser.c"
+#line 1340 "configparser.c"
configparserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
@@ -1441,8 +1350,6 @@ static void yy_syntax_error(
YYMINORTYPE yyminor /* The minor type of the error token */
){
configparserARG_FETCH;
- UNUSED(yymajor);
- UNUSED(yyminor);
#define TOKEN (yyminor.yy0)
configparserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
@@ -1537,7 +1444,7 @@ void configparser(
#ifdef YYERRORSYMBOL
/* A syntax error has occurred.
** The response to an error depends upon whether or not the
- ** grammar defines an error token "ERROR".
+ ** grammar defines an error token "ERROR".
**
** This is what we do if the grammar does define ERROR:
**
diff --git a/src/configparser.h b/src/configparser.h
index 1610621..9490e58 100644
--- a/src/configparser.h
+++ b/src/configparser.h
@@ -9,17 +9,16 @@
#define TK_RPARAN 9
#define TK_COMMA 10
#define TK_ARRAY_ASSIGN 11
-#define TK_GLOBAL 12
+#define TK_ELSE 12
#define TK_LCURLY 13
#define TK_RCURLY 14
-#define TK_ELSE 15
-#define TK_DOLLAR 16
-#define TK_SRVVARNAME 17
-#define TK_LBRACKET 18
-#define TK_RBRACKET 19
-#define TK_EQ 20
-#define TK_MATCH 21
-#define TK_NE 22
-#define TK_NOMATCH 23
-#define TK_INCLUDE 24
-#define TK_INCLUDE_SHELL 25
+#define TK_DOLLAR 15
+#define TK_SRVVARNAME 16
+#define TK_LBRACKET 17
+#define TK_RBRACKET 18
+#define TK_EQ 19
+#define TK_MATCH 20
+#define TK_NE 21
+#define TK_NOMATCH 22
+#define TK_INCLUDE 23
+#define TK_INCLUDE_SHELL 24
diff --git a/src/configparser.y b/src/configparser.y
index aa6fe98..4ca4fa0 100644
--- a/src/configparser.y
+++ b/src/configparser.y
@@ -3,13 +3,15 @@
%name configparser
%include {
-#include "configfile.h"
-#include "buffer.h"
-#include "array.h"
-
#include <assert.h>
#include <stdio.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "configfile.h"
+#include "buffer.h"
+#include "array.h"
static void configparser_push(config_t *ctx, data_config *dc, int isnew) {
if (isnew) {
@@ -19,10 +21,6 @@ static void configparser_push(config_t *ctx, data_config *dc, int isnew) {
dc->parent = ctx->current;
array_insert_unique(dc->parent->childs, (data_unset *)dc);
}
- if (ctx->configs_stack->used > 0 && ctx->current->context_ndx == 0) {
- fprintf(stderr, "Cannot use conditionals inside a global { ... } block\n");
- exit(-1);
- }
array_insert_unique(ctx->configs_stack, (data_unset *)ctx->current);
ctx->current = dc;
}
@@ -35,25 +33,43 @@ static data_config *configparser_pop(config_t *ctx) {
/* return a copied variable */
static data_unset *configparser_get_variable(config_t *ctx, const buffer *key) {
- data_unset *du;
- data_config *dc;
+ if (strncmp(key->ptr, "env.", sizeof("env.") - 1) == 0) {
+ char *env;
+
+ if (NULL != (env = getenv(key->ptr + 4))) {
+ data_string *ds;
+ ds = data_string_init();
+ buffer_append_string(ds->value, env);
+ return (data_unset *)ds;
+ }
+
+ fprintf(stderr, "Undefined env variable: %s\n", key->ptr + 4);
+ ctx->ok = 0;
+
+ return NULL;
+ } else {
+ data_unset *du;
+ data_config *dc;
#if 0
- fprintf(stderr, "get var %s\n", key->ptr);
+ fprintf(stderr, "get var %s\n", key->ptr);
#endif
- for (dc = ctx->current; dc; dc = dc->parent) {
+ for (dc = ctx->current; dc; dc = dc->parent) {
#if 0
- fprintf(stderr, "get var on block: %s\n", dc->key->ptr);
- array_print(dc->value, 0);
+ fprintf(stderr, "get var on block: %s\n", dc->key->ptr);
+ array_print(dc->value, 0);
#endif
- if (NULL != (du = array_get_element(dc->value, key->ptr))) {
- return du->copy(du);
+ if (NULL != (du = array_get_element(dc->value, key->ptr))) {
+ return du->copy(du);
+ }
}
+ fprintf(stderr, "Undefined config variable: %s\n", key->ptr);
+ ctx->ok = 0;
+ return NULL;
}
- return NULL;
}
-/* op1 is to be eat/return by this function if success, op1->key is not cared
+/* op1 is to be eat/return by this function, op1->key is not cared
op2 is left untouch, unreferenced
*/
data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) {
@@ -70,7 +86,8 @@ data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) {
op1->free(op1);
return (data_unset *)ds;
} else {
- fprintf(stderr, "data type mismatch, cannot merge\n");
+ fprintf(stderr, "data type mismatch, cannot be merge\n");
+ op1->free(op1);
return NULL;
}
}
@@ -113,7 +130,6 @@ input ::= metalines.
metalines ::= metalines metaline.
metalines ::= .
metaline ::= varline.
-metaline ::= global.
metaline ::= condlines(A) EOL. { A = NULL; }
metaline ::= include.
metaline ::= include_shell.
@@ -124,7 +140,6 @@ metaline ::= EOL.
%type aelement {data_unset *}
%type condline {data_config *}
%type condlines {data_config *}
-%type global {data_config *}
%type aelements {array *}
%type array {array *}
%type key {buffer *}
@@ -144,24 +159,17 @@ metaline ::= EOL.
%token_destructor { buffer_free($$); }
varline ::= key(A) ASSIGN expression(B). {
- if (ctx->ok) {
- buffer_copy_string_buffer(B->key, A);
- if (strncmp(A->ptr, "env.", sizeof("env.") - 1) == 0) {
- fprintf(stderr, "Setting env variable is not supported in conditional %d %s: %s\n",
- ctx->current->context_ndx,
- ctx->current->key->ptr, A->ptr);
- ctx->ok = 0;
- } else if (NULL == array_get_element(ctx->current->value, B->key->ptr)) {
- array_insert_unique(ctx->current->value, B);
- B = NULL;
- } else {
- fprintf(stderr, "Duplicate config variable in conditional %d %s: %s\n",
- ctx->current->context_ndx,
- ctx->current->key->ptr, B->key->ptr);
- ctx->ok = 0;
- B->free(B);
- B = NULL;
- }
+ buffer_copy_string_buffer(B->key, A);
+ if (NULL == array_get_element(ctx->current->value, B->key->ptr)) {
+ array_insert_unique(ctx->current->value, B);
+ B = NULL;
+ } else {
+ fprintf(stderr, "Duplicate config variable in conditional %d %s: %s\n",
+ ctx->current->context_ndx,
+ ctx->current->key->ptr, B->key->ptr);
+ ctx->ok = 0;
+ B->free(B);
+ B = NULL;
}
buffer_free(A);
A = NULL;
@@ -171,12 +179,7 @@ varline ::= key(A) APPEND expression(B). {
array *vars = ctx->current->value;
data_unset *du;
- if (strncmp(A->ptr, "env.", sizeof("env.") - 1) == 0) {
- fprintf(stderr, "Appending env variable is not supported in conditional %d %s: %s\n",
- ctx->current->context_ndx,
- ctx->current->key->ptr, A->ptr);
- ctx->ok = 0;
- } else if (NULL != (du = array_get_element(vars, A->ptr))) {
+ if (NULL != (du = array_get_element(vars, A->ptr))) {
/* exists in current block */
du = configparser_merge_data(du, B);
if (NULL == du) {
@@ -186,7 +189,6 @@ varline ::= key(A) APPEND expression(B). {
buffer_copy_string_buffer(du->key, A);
array_replace(vars, du);
}
- B->free(B);
} else if (NULL != (du = configparser_get_variable(ctx, A))) {
du = configparser_merge_data(du, B);
if (NULL == du) {
@@ -196,13 +198,15 @@ varline ::= key(A) APPEND expression(B). {
buffer_copy_string_buffer(du->key, A);
array_insert_unique(ctx->current->value, du);
}
- B->free(B);
} else {
- buffer_copy_string_buffer(B->key, A);
- array_insert_unique(ctx->current->value, B);
+ fprintf(stderr, "Undefined config variable in conditional %d %s: %s\n",
+ ctx->current->context_ndx,
+ ctx->current->key->ptr, A->ptr);
+ ctx->ok = 0;
}
buffer_free(A);
A = NULL;
+ B->free(B);
B = NULL;
}
@@ -234,24 +238,7 @@ expression(A) ::= value(B). {
}
value(A) ::= key(B). {
- A = NULL;
- if (strncmp(B->ptr, "env.", sizeof("env.") - 1) == 0) {
- char *env;
-
- if (NULL != (env = getenv(B->ptr + 4))) {
- data_string *ds;
- ds = data_string_init();
- buffer_append_string(ds->value, env);
- A = (data_unset *)ds;
- }
- else {
- fprintf(stderr, "Undefined env variable: %s\n", B->ptr + 4);
- ctx->ok = 0;
- }
- } else if (NULL == (A = configparser_get_variable(ctx, B))) {
- fprintf(stderr, "Undefined config variable: %s\n", B->ptr);
- ctx->ok = 0;
- }
+ A = configparser_get_variable(ctx, B);
if (!A) {
/* make a dummy so it won't crash */
A = (data_unset *)data_string_init();
@@ -279,9 +266,6 @@ value(A) ::= array(B). {
((data_array *)(A))->value = B;
B = NULL;
}
-array(A) ::= LPARAN RPARAN. {
- A = array_init();
-}
array(A) ::= LPARAN aelements(B) RPARAN. {
A = B;
B = NULL;
@@ -293,13 +277,13 @@ aelements(A) ::= aelements(C) COMMA aelement(B). {
array_insert_unique(C, B);
B = NULL;
} else {
- fprintf(stderr, "Duplicate array-key: %s\n",
+ fprintf(stderr, "Duplicate array-key: %s\n",
B->key->ptr);
ctx->ok = 0;
B->free(B);
B = NULL;
}
-
+
A = C;
C = NULL;
}
@@ -323,7 +307,7 @@ aelement(A) ::= stringop(B) ARRAY_ASSIGN expression(C). {
buffer_copy_string_buffer(C->key, B);
buffer_free(B);
B = NULL;
-
+
A = C;
C = NULL;
}
@@ -331,29 +315,8 @@ aelement(A) ::= stringop(B) ARRAY_ASSIGN expression(C). {
eols ::= EOL.
eols ::= .
-globalstart ::= GLOBAL. {
- data_config *dc;
- dc = (data_config *)array_get_element(ctx->srv->config_context, "global");
- assert(dc);
- configparser_push(ctx, dc, 0);
-}
-
-global(A) ::= globalstart LCURLY metalines RCURLY. {
- data_config *cur;
-
- cur = ctx->current;
- configparser_pop(ctx);
-
- assert(cur && ctx->current);
-
- A = cur;
-}
-
condlines(A) ::= condlines(B) eols ELSE condline(C). {
- if (B->context_ndx >= C->context_ndx) {
- fprintf(stderr, "unreachable else condition\n");
- ctx->ok = 0;
- }
+ assert(B->context_ndx < C->context_ndx);
C->prev = B;
B->next = C;
A = C;
@@ -368,7 +331,7 @@ condlines(A) ::= condline(B). {
condline(A) ::= context LCURLY metalines RCURLY. {
data_config *cur;
-
+
cur = ctx->current;
configparser_pop(ctx);
@@ -412,7 +375,7 @@ context ::= DOLLAR SRVVARNAME(B) LBRACKET stringop(C) RBRACKET cond(E) expressio
buffer_append_string_buffer(b, op);
rvalue = ((data_string*)D)->value;
buffer_append_string_buffer(b, rvalue);
-
+
if (NULL != (dc = (data_config *)array_get_element(ctx->all_configs, b->ptr))) {
configparser_push(ctx, dc, 0);
} else {
@@ -425,22 +388,15 @@ context ::= DOLLAR SRVVARNAME(B) LBRACKET stringop(C) RBRACKET cond(E) expressio
{ COMP_HTTP_URL, CONST_STR_LEN("HTTP[\"url\"]" ) },
{ COMP_HTTP_HOST, CONST_STR_LEN("HTTP[\"host\"]" ) },
{ COMP_HTTP_REFERER, CONST_STR_LEN("HTTP[\"referer\"]" ) },
- { COMP_HTTP_USER_AGENT, CONST_STR_LEN("HTTP[\"useragent\"]" ) },
- { COMP_HTTP_USER_AGENT, CONST_STR_LEN("HTTP[\"user-agent\"]" ) },
- { COMP_HTTP_LANGUAGE, CONST_STR_LEN("HTTP[\"language\"]" ) },
+ { COMP_HTTP_USERAGENT, CONST_STR_LEN("HTTP[\"useragent\"]" ) },
{ COMP_HTTP_COOKIE, CONST_STR_LEN("HTTP[\"cookie\"]" ) },
- { COMP_HTTP_REMOTE_IP, CONST_STR_LEN("HTTP[\"remoteip\"]" ) },
- { COMP_HTTP_REMOTE_IP, CONST_STR_LEN("HTTP[\"remote-ip\"]" ) },
- { COMP_HTTP_QUERY_STRING, CONST_STR_LEN("HTTP[\"querystring\"]") },
- { COMP_HTTP_QUERY_STRING, CONST_STR_LEN("HTTP[\"query-string\"]") },
- { COMP_HTTP_REQUEST_METHOD, CONST_STR_LEN("HTTP[\"request-method\"]") },
- { COMP_HTTP_SCHEME, CONST_STR_LEN("HTTP[\"scheme\"]" ) },
+ { COMP_HTTP_REMOTEIP, CONST_STR_LEN("HTTP[\"remoteip\"]" ) },
{ COMP_UNSET, NULL, 0 },
};
size_t i;
dc = data_config_init();
-
+
buffer_copy_string_buffer(dc->key, b);
buffer_copy_string_buffer(dc->op, op);
buffer_copy_string_buffer(dc->comp_key, B);
@@ -448,7 +404,7 @@ context ::= DOLLAR SRVVARNAME(B) LBRACKET stringop(C) RBRACKET cond(E) expressio
buffer_append_string_buffer(dc->comp_key, C);
buffer_append_string_len(dc->comp_key, CONST_STR_LEN("\"]"));
dc->cond = E;
-
+
for (i = 0; comps[i].comp_key; i ++) {
if (buffer_is_equal_string(
dc->comp_key, comps[i].comp_key, comps[i].len)) {
@@ -470,37 +426,29 @@ context ::= DOLLAR SRVVARNAME(B) LBRACKET stringop(C) RBRACKET cond(E) expressio
case CONFIG_COND_MATCH: {
#ifdef HAVE_PCRE_H
const char *errptr;
- int erroff, captures;
-
- if (NULL == (dc->regex =
+ int erroff;
+
+ if (NULL == (dc->regex =
pcre_compile(rvalue->ptr, 0, &errptr, &erroff, NULL))) {
dc->string = buffer_init_string(errptr);
dc->cond = CONFIG_COND_UNSET;
- fprintf(stderr, "parsing regex failed: %s -> %s at offset %d\n",
+ fprintf(stderr, "parsing regex failed: %s -> %s at offset %d\n",
rvalue->ptr, errptr, erroff);
ctx->ok = 0;
} else if (NULL == (dc->regex_study =
- pcre_study(dc->regex, 0, &errptr)) &&
+ pcre_study(dc->regex, 0, &errptr)) &&
errptr != NULL) {
- fprintf(stderr, "studying regex failed: %s -> %s\n",
+ fprintf(stderr, "studying regex failed: %s -> %s\n",
rvalue->ptr, errptr);
ctx->ok = 0;
- } else if (0 != (pcre_fullinfo(dc->regex, dc->regex_study, PCRE_INFO_CAPTURECOUNT, &captures))) {
- fprintf(stderr, "getting capture count for regex failed: %s\n",
- rvalue->ptr);
- ctx->ok = 0;
- } else if (captures > 9) {
- fprintf(stderr, "Too many captures in regex, use (?:...) instead of (...): %s\n",
- rvalue->ptr);
- ctx->ok = 0;
} else {
dc->string = buffer_init_buffer(rvalue);
}
#else
- fprintf(stderr, "can't handle '$%s[%s] =~ ...' as you compiled without pcre support. \n"
- "(perhaps just a missing pcre-devel package ?) \n",
+ fprintf(stderr, "regex conditionals are not allowed as pcre-support" \
+ "is missing: $%s[%s]\n",
B->ptr, C->ptr);
ctx->ok = 0;
#endif
@@ -508,12 +456,12 @@ context ::= DOLLAR SRVVARNAME(B) LBRACKET stringop(C) RBRACKET cond(E) expressio
}
default:
- fprintf(stderr, "unknown condition for $%s[%s]\n",
+ fprintf(stderr, "unknown condition for $%s[%s]\n",
B->ptr, C->ptr);
ctx->ok = 0;
break;
}
-
+
configparser_push(ctx, dc, 1);
}
diff --git a/src/connections-glue.c b/src/connections-glue.c
index 5ef7a1e..ac6d267 100644
--- a/src/connections-glue.c
+++ b/src/connections-glue.c
@@ -1,5 +1,4 @@
#include "base.h"
-#include "connections.h"
const char *connection_get_state(connection_state_t state) {
switch (state) {
@@ -14,7 +13,7 @@ const char *connection_get_state(connection_state_t state) {
case CON_STATE_REQUEST_END: return "req-end";
case CON_STATE_RESPONSE_START: return "resp-start";
case CON_STATE_RESPONSE_END: return "resp-end";
- default: return "(unknown)";
+ default: return "(unknown)";
}
}
@@ -31,15 +30,15 @@ const char *connection_get_short_state(connection_state_t state) {
case CON_STATE_REQUEST_END: return "Q";
case CON_STATE_RESPONSE_START: return "s";
case CON_STATE_RESPONSE_END: return "S";
- default: return "x";
+ default: return "x";
}
}
int connection_set_state(server *srv, connection *con, connection_state_t state) {
UNUSED(srv);
-
+
con->state = state;
-
+
return 0;
}
diff --git a/src/connections.c b/src/connections.c
index faec09f..acd8880 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -1,3 +1,13 @@
+#include <sys/stat.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#include <assert.h>
+
#include "buffer.h"
#include "server.h"
#include "log.h"
@@ -15,19 +25,9 @@
#include "inet_ntop_cache.h"
-#include <sys/stat.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-#include <assert.h>
-
#ifdef USE_OPENSSL
-# include <openssl/ssl.h>
-# include <openssl/err.h>
+# include <openssl/ssl.h>
+# include <openssl/err.h>
#endif
#ifdef HAVE_SYS_FILIO_H
@@ -43,7 +43,7 @@ typedef struct {
static connection *connections_get_new_connection(server *srv) {
connections *conns = srv->conns;
size_t i;
-
+
if (conns->size == 0) {
conns->size = 128;
conns->ptr = NULL;
@@ -54,21 +54,21 @@ static connection *connections_get_new_connection(server *srv) {
} else if (conns->size == conns->used) {
conns->size += 128;
conns->ptr = realloc(conns->ptr, sizeof(*conns->ptr) * conns->size);
-
+
for (i = conns->used; i < conns->size; i++) {
conns->ptr[i] = connection_init(srv);
}
}
connection_reset(srv, conns->ptr[conns->used]);
-#if 0
+#if 0
fprintf(stderr, "%s.%d: add: ", __FILE__, __LINE__);
for (i = 0; i < conns->used + 1; i++) {
fprintf(stderr, "%d ", conns->ptr[i]->fd);
}
fprintf(stderr, "\n");
-#endif
-
+#endif
+
conns->ptr[conns->used]->ndx = conns->used;
return conns->ptr[conns->used++];
}
@@ -77,31 +77,26 @@ static int connection_del(server *srv, connection *con) {
size_t i;
connections *conns = srv->conns;
connection *temp;
-
+
if (con == NULL) return -1;
-
+
if (-1 == con->ndx) return -1;
-
- buffer_reset(con->uri.authority);
- buffer_reset(con->uri.path);
- buffer_reset(con->uri.query);
- buffer_reset(con->request.orig_uri);
-
+
i = con->ndx;
-
+
/* not last element */
-
+
if (i != conns->used - 1) {
temp = conns->ptr[i];
conns->ptr[i] = conns->ptr[conns->used - 1];
conns->ptr[conns->used - 1] = temp;
-
+
conns->ptr[i]->ndx = i;
conns->ptr[conns->used - 1]->ndx = -1;
}
-
+
conns->used--;
-
+
con->ndx = -1;
#if 0
fprintf(stderr, "%s.%d: del: (%d)", __FILE__, __LINE__, conns->used);
@@ -109,7 +104,7 @@ static int connection_del(server *srv, connection *con) {
fprintf(stderr, "%d ", conns->ptr[i]->fd);
}
fprintf(stderr, "\n");
-#endif
+#endif
return 0;
}
@@ -117,14 +112,14 @@ int connection_close(server *srv, connection *con) {
#ifdef USE_OPENSSL
server_socket *srv_sock = con->srv_socket;
#endif
-
+
#ifdef USE_OPENSSL
if (srv_sock->is_ssl) {
if (con->ssl) SSL_free(con->ssl);
con->ssl = NULL;
}
#endif
-
+
fdevent_event_del(srv->ev, &(con->fde_ndx), con->fd);
fdevent_unregister(srv->ev, con->fd);
#ifdef __WIN32
@@ -138,254 +133,184 @@ int connection_close(server *srv, connection *con) {
"(warning) close:", con->fd, strerror(errno));
}
#endif
-
+
srv->cur_fds--;
#if 0
log_error_write(srv, __FILE__, __LINE__, "sd",
"closed()", con->fd);
#endif
-
+
connection_del(srv, con);
connection_set_state(srv, con, CON_STATE_CONNECT);
-
+
return 0;
}
#if 0
static void dump_packet(const unsigned char *data, size_t len) {
size_t i, j;
-
+
if (len == 0) return;
-
+
for (i = 0; i < len; i++) {
if (i % 16 == 0) fprintf(stderr, " ");
-
+
fprintf(stderr, "%02x ", data[i]);
-
+
if ((i + 1) % 16 == 0) {
fprintf(stderr, " ");
for (j = 0; j <= i % 16; j++) {
unsigned char c;
-
+
if (i-15+j >= len) break;
-
+
c = data[i-15+j];
-
+
fprintf(stderr, "%c", c > 32 && c < 128 ? c : '.');
}
-
+
fprintf(stderr, "\n");
}
}
-
+
if (len % 16 != 0) {
for (j = i % 16; j < 16; j++) {
fprintf(stderr, " ");
}
-
+
fprintf(stderr, " ");
for (j = i & ~0xf; j < len; j++) {
unsigned char c;
-
+
c = data[j];
fprintf(stderr, "%c", c > 32 && c < 128 ? c : '.');
}
fprintf(stderr, "\n");
}
}
-#endif
+#endif
-static int connection_handle_read_ssl(server *srv, connection *con) {
+static int connection_handle_read(server *srv, connection *con) {
+ int len;
+ buffer *b;
+ int toread;
#ifdef USE_OPENSSL
- int r, ssl_err, len, count = 0, read_offset, toread;
- buffer *b = NULL;
-
- if (!con->conf.is_ssl) return -1;
-
- ERR_clear_error();
- do {
- if (NULL != con->read_queue->last) {
- b = con->read_queue->last->mem;
- }
-
- if (NULL == b || b->size - b->used < 1024) {
- b = chunkqueue_get_append_buffer(con->read_queue);
- len = SSL_pending(con->ssl);
- if (len < 4*1024) len = 4*1024; /* always alloc >= 4k buffer */
- buffer_prepare_copy(b, len + 1);
-
- /* overwrite everything with 0 */
- memset(b->ptr, 0, b->size);
- }
-
- read_offset = (b->used > 0) ? b->used - 1 : 0;
- toread = b->size - 1 - read_offset;
+ server_socket *srv_sock = con->srv_socket;
+#endif
- len = SSL_read(con->ssl, b->ptr + read_offset, toread);
+ b = chunkqueue_get_append_buffer(con->read_queue);
+ buffer_prepare_copy(b, 4096);
- if (con->renegotiations > 1 && con->conf.ssl_disable_client_renegotiation) {
- connection_set_state(srv, con, CON_STATE_ERROR);
- log_error_write(srv, __FILE__, __LINE__, "s", "SSL: renegotiation initiated by client");
+#ifdef USE_OPENSSL
+ if (srv_sock->is_ssl) {
+ len = SSL_read(con->ssl, b->ptr, b->size - 1);
+ } else {
+ if (ioctl(con->fd, FIONREAD, &toread)) {
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "unexpected end-of-file:",
+ con->fd);
return -1;
}
+ buffer_prepare_copy(b, toread);
- if (len > 0) {
- if (b->used > 0) b->used--;
- b->used += len;
- b->ptr[b->used++] = '\0';
-
- con->bytes_read += len;
-
- count += len;
- }
- } while (len == toread && count < MAX_READ_LIMIT);
-
+ len = read(con->fd, b->ptr, b->size - 1);
+ }
+#elif defined(__WIN32)
+ len = recv(con->fd, b->ptr, b->size - 1, 0);
+#else
+ if (ioctl(con->fd, FIONREAD, &toread)) {
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "unexpected end-of-file:",
+ con->fd);
+ return -1;
+ }
+ buffer_prepare_copy(b, toread);
+ len = read(con->fd, b->ptr, b->size - 1);
+#endif
+
if (len < 0) {
- int oerrno = errno;
- switch ((r = SSL_get_error(con->ssl, len))) {
- case SSL_ERROR_WANT_READ:
- case SSL_ERROR_WANT_WRITE:
- con->is_readable = 0;
-
- /* the manual says we have to call SSL_read with the same arguments next time.
- * we ignore this restriction; no one has complained about it in 1.5 yet, so it probably works anyway.
- */
-
- return 0;
- case SSL_ERROR_SYSCALL:
- /**
- * man SSL_get_error()
- *
- * SSL_ERROR_SYSCALL
- * Some I/O error occurred. The OpenSSL error queue may contain more
- * information on the error. If the error queue is empty (i.e.
- * ERR_get_error() returns 0), ret can be used to find out more about
- * the error: If ret == 0, an EOF was observed that violates the
- * protocol. If ret == -1, the underlying BIO reported an I/O error
- * (for socket I/O on Unix systems, consult errno for details).
- *
- */
- while((ssl_err = ERR_get_error())) {
- /* get all errors from the error-queue */
- log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:",
- r, ERR_error_string(ssl_err, NULL));
- }
+ con->is_readable = 0;
+
+#ifdef USE_OPENSSL
+ if (srv_sock->is_ssl) {
+ int r, ssl_err;
+
+ switch ((r = SSL_get_error(con->ssl, len))) {
+ case SSL_ERROR_WANT_READ:
+ return 0;
+ case SSL_ERROR_SYSCALL:
+ /**
+ * man SSL_get_error()
+ *
+ * SSL_ERROR_SYSCALL
+ * Some I/O error occurred. The OpenSSL error queue may contain more
+ * information on the error. If the error queue is empty (i.e.
+ * ERR_get_error() returns 0), ret can be used to find out more about
+ * the error: If ret == 0, an EOF was observed that violates the
+ * protocol. If ret == -1, the underlying BIO reported an I/O error
+ * (for socket I/O on Unix systems, consult errno for details).
+ *
+ */
+ while((ssl_err = ERR_get_error())) {
+ /* get all errors from the error-queue */
+ log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:",
+ r, ERR_error_string(ssl_err, NULL));
+ }
- switch(oerrno) {
+ switch(errno) {
+ default:
+ log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL:",
+ len, r, errno,
+ strerror(errno));
+ break;
+ }
+
+ break;
+ case SSL_ERROR_ZERO_RETURN:
+ /* clean shutdown on the remote side */
+
+ if (r == 0) {
+ /* FIXME: later */
+ }
+
+ /* fall thourgh */
default:
- log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL:",
- len, r, oerrno,
- strerror(oerrno));
+ while((ssl_err = ERR_get_error())) {
+ /* get all errors from the error-queue */
+ log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:",
+ r, ERR_error_string(ssl_err, NULL));
+ }
break;
}
-
- break;
- case SSL_ERROR_ZERO_RETURN:
- /* clean shutdown on the remote side */
-
- if (r == 0) {
- /* FIXME: later */
+ } else {
+ if (errno == EAGAIN) return 0;
+ if (errno == EINTR) {
+ /* we have been interrupted before we could read */
+ con->is_readable = 1;
+ return 0;
}
-
- /* fall thourgh */
- default:
- while((ssl_err = ERR_get_error())) {
- switch (ERR_GET_REASON(ssl_err)) {
- case SSL_R_SSL_HANDSHAKE_FAILURE:
- case SSL_R_TLSV1_ALERT_UNKNOWN_CA:
- case SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN:
- case SSL_R_SSLV3_ALERT_BAD_CERTIFICATE:
- if (!con->conf.log_ssl_noise) continue;
- break;
- default:
- break;
- }
- /* get all errors from the error-queue */
- log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:",
- r, ERR_error_string(ssl_err, NULL));
+
+ if (errno != ECONNRESET) {
+ /* expected for keep-alive */
+ log_error_write(srv, __FILE__, __LINE__, "ssd", "connection closed - read failed: ", strerror(errno), errno);
}
- break;
}
-
- connection_set_state(srv, con, CON_STATE_ERROR);
-
- return -1;
- } else if (len == 0) {
- con->is_readable = 0;
- /* the other end close the connection -> KEEP-ALIVE */
-
- return -2;
- } else {
- joblist_append(srv, con);
- }
-
- return 0;
-#else
- UNUSED(srv);
- UNUSED(con);
- return -1;
-#endif
-}
-
-/* 0: everything ok, -1: error, -2: con closed */
-static int connection_handle_read(server *srv, connection *con) {
- int len;
- buffer *b;
- int toread, read_offset;
-
- if (con->conf.is_ssl) {
- return connection_handle_read_ssl(srv, con);
- }
-
- b = (NULL != con->read_queue->last) ? con->read_queue->last->mem : NULL;
-
- /* default size for chunks is 4kb; only use bigger chunks if FIONREAD tells
- * us more than 4kb is available
- * if FIONREAD doesn't signal a big chunk we fill the previous buffer
- * if it has >= 1kb free
- */
-#if defined(__WIN32)
- if (NULL == b || b->size - b->used < 1024) {
- b = chunkqueue_get_append_buffer(con->read_queue);
- buffer_prepare_copy(b, 4 * 1024);
- }
-
- read_offset = (b->used == 0) ? 0 : b->used - 1;
- len = recv(con->fd, b->ptr + read_offset, b->size - 1 - read_offset, 0);
#else
- if (ioctl(con->fd, FIONREAD, &toread) || toread == 0 || toread <= 4*1024) {
- if (NULL == b || b->size - b->used < 1024) {
- b = chunkqueue_get_append_buffer(con->read_queue);
- buffer_prepare_copy(b, 4 * 1024);
- }
- } else {
- if (toread > MAX_READ_LIMIT) toread = MAX_READ_LIMIT;
- b = chunkqueue_get_append_buffer(con->read_queue);
- buffer_prepare_copy(b, toread + 1);
- }
-
- read_offset = (b->used == 0) ? 0 : b->used - 1;
- len = read(con->fd, b->ptr + read_offset, b->size - 1 - read_offset);
-#endif
-
- if (len < 0) {
- con->is_readable = 0;
-
if (errno == EAGAIN) return 0;
if (errno == EINTR) {
/* we have been interrupted before we could read */
con->is_readable = 1;
return 0;
}
-
+
if (errno != ECONNRESET) {
/* expected for keep-alive */
log_error_write(srv, __FILE__, __LINE__, "ssd", "connection closed - read failed: ", strerror(errno), errno);
}
-
+#endif
connection_set_state(srv, con, CON_STATE_ERROR);
-
+
return -1;
} else if (len == 0) {
con->is_readable = 0;
@@ -396,19 +321,18 @@ static int connection_handle_read(server *srv, connection *con) {
return -2;
} else if ((size_t)len < b->size - 1) {
/* we got less then expected, wait for the next fd-event */
-
+
con->is_readable = 0;
}
-
- if (b->used > 0) b->used--;
- b->used += len;
+
+ b->used = len;
b->ptr[b->used++] = '\0';
-
+
con->bytes_read += len;
#if 0
dump_packet(b->ptr, len);
#endif
-
+
return 0;
}
@@ -426,22 +350,11 @@ static int connection_handle_write_prepare(server *srv, connection *con) {
case HTTP_METHOD_MOVE:
case HTTP_METHOD_PROPFIND:
case HTTP_METHOD_PROPPATCH:
- case HTTP_METHOD_LOCK:
- case HTTP_METHOD_UNLOCK:
break;
case HTTP_METHOD_OPTIONS:
- /*
- * 400 is coming from the request-parser BEFORE uri.path is set
- * 403 is from the response handler when noone else catched it
- *
- * */
- if ((!con->http_status || con->http_status == 200) && con->uri.path->used &&
- con->uri.path->ptr[0] != '*') {
+ if (con->uri.path->ptr[0] != '*') {
response_header_insert(srv, con, CONST_STR_LEN("Allow"), CONST_STR_LEN("OPTIONS, GET, HEAD, POST"));
- con->response.transfer_encoding &= ~HTTP_TRANSFER_ENCODING_CHUNKED;
- con->parsed_response &= ~HTTP_CONTENT_LENGTH;
-
con->http_status = 200;
con->file_finished = 1;
@@ -451,8 +364,6 @@ static int connection_handle_write_prepare(server *srv, connection *con) {
default:
switch(con->http_status) {
case 400: /* bad request */
- case 401: /* authorization required */
- case 414: /* overload request header */
case 505: /* unknown protocol */
case 207: /* this was webdav */
break;
@@ -463,170 +374,152 @@ static int connection_handle_write_prepare(server *srv, connection *con) {
break;
}
}
-
+
if (con->http_status == 0) {
con->http_status = 403;
}
-
+
switch(con->http_status) {
- case 204: /* class: header only */
- case 205:
- case 304:
- /* disable chunked encoding again as we have no body */
- con->response.transfer_encoding &= ~HTTP_TRANSFER_ENCODING_CHUNKED;
- con->parsed_response &= ~HTTP_CONTENT_LENGTH;
- chunkqueue_reset(con->write_queue);
-
- con->file_finished = 1;
- break;
- default: /* class: header + body */
+ case 400: /* class: header + custom body */
+ case 401:
+ case 403:
+ case 404:
+ case 408:
+ case 411:
+ case 416:
+ case 500:
+ case 501:
+ case 503:
+ case 505:
if (con->mode != DIRECT) break;
-
- /* only custom body for 4xx and 5xx */
- if (con->http_status < 400 || con->http_status >= 600) break;
-
+
con->file_finished = 0;
-
+
buffer_reset(con->physical.path);
-
+
/* try to send static errorfile */
if (!buffer_is_empty(con->conf.errorfile_prefix)) {
stat_cache_entry *sce = NULL;
-
+
buffer_copy_string_buffer(con->physical.path, con->conf.errorfile_prefix);
- buffer_append_long(con->physical.path, con->http_status);
- buffer_append_string_len(con->physical.path, CONST_STR_LEN(".html"));
-
+ buffer_append_string(con->physical.path, get_http_status_body_name(con->http_status));
+
if (HANDLER_ERROR != stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
con->file_finished = 1;
-
+
http_chunk_append_file(srv, con, con->physical.path, 0, sce->st.st_size);
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
}
}
-
- if (!con->file_finished) {
+
+ if (!con->file_finished) {
buffer *b;
-
+
buffer_reset(con->physical.path);
-
+
con->file_finished = 1;
b = chunkqueue_get_append_buffer(con->write_queue);
-
+
/* build default error-page */
- buffer_copy_string_len(b, CONST_STR_LEN(
+ buffer_copy_string(b,
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n"
" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"
" <head>\n"
- " <title>"));
+ " <title>");
buffer_append_long(b, con->http_status);
- buffer_append_string_len(b, CONST_STR_LEN(" - "));
+ buffer_append_string(b, " - ");
buffer_append_string(b, get_http_status_name(con->http_status));
-
- buffer_append_string_len(b, CONST_STR_LEN(
+
+ buffer_append_string(b,
"</title>\n"
" </head>\n"
" <body>\n"
- " <h1>"));
+ " <h1>");
buffer_append_long(b, con->http_status);
- buffer_append_string_len(b, CONST_STR_LEN(" - "));
+ buffer_append_string(b, " - ");
buffer_append_string(b, get_http_status_name(con->http_status));
-
- buffer_append_string_len(b, CONST_STR_LEN("</h1>\n"
+
+ buffer_append_string(b,"</h1>\n"
" </body>\n"
"</html>\n"
- ));
-
+ );
+
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
}
+ /* fall through */
+ case 207:
+ case 200: /* class: header + body */
+ case 302:
+ break;
+
+ case 206: /* write_queue is already prepared */
+ con->file_finished = 1;
+
+ break;
+ case 205: /* class: header only */
+ case 301:
+ case 304:
+ default:
+ /* disable chunked encoding again as we have no body */
+ con->response.transfer_encoding &= ~HTTP_TRANSFER_ENCODING_CHUNKED;
+ chunkqueue_reset(con->write_queue);
+
+ con->file_finished = 1;
break;
}
+
if (con->file_finished) {
- /* we have all the content and chunked encoding is not used, set a content-length */
-
- if ((!(con->parsed_response & HTTP_CONTENT_LENGTH)) &&
+ /* we have all the content and chunked encoding is not used, set a content-length */
+
+ if ((!(con->parsed_response & HTTP_CONTENT_LENGTH)) &&
(con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) == 0) {
- off_t qlen = chunkqueue_length(con->write_queue);
-
- /**
- * The Content-Length header only can be sent if we have content:
- * - HEAD doesn't have a content-body (but have a content-length)
- * - 1xx, 204 and 304 don't have a content-body (RFC 2616 Section 4.3)
- *
- * Otherwise generate a Content-Length header as chunked encoding is not
- * available
- */
- if ((con->http_status >= 100 && con->http_status < 200) ||
- con->http_status == 204 ||
- con->http_status == 304) {
- data_string *ds;
- /* no Content-Body, no Content-Length */
- if (NULL != (ds = (data_string*) array_get_element(con->response.headers, "Content-Length"))) {
- buffer_reset(ds->value); /* Headers with empty values are ignored for output */
- }
- } else if (qlen > 0 || con->request.http_method != HTTP_METHOD_HEAD) {
- /* qlen = 0 is important for Redirects (301, ...) as they MAY have
- * a content. Browsers are waiting for a Content otherwise
- */
- buffer_copy_off_t(srv->tmp_buf, qlen);
-
- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Length"), CONST_BUF_LEN(srv->tmp_buf));
- }
+ buffer_copy_off_t(srv->tmp_buf, chunkqueue_length(con->write_queue));
+
+ response_header_overwrite(srv, con, CONST_STR_LEN("Content-Length"), CONST_BUF_LEN(srv->tmp_buf));
}
} else {
- /**
- * the file isn't finished yet, but we have all headers
- *
- * to get keep-alive we either need:
- * - Content-Length: ... (HTTP/1.0 and HTTP/1.0) or
- * - Transfer-Encoding: chunked (HTTP/1.1)
- */
-
- if (((con->parsed_response & HTTP_CONTENT_LENGTH) == 0) &&
+ /* disable keep-alive if size-info for the body is missing */
+ if ((con->parsed_response & HTTP_CONTENT_LENGTH) &&
((con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) == 0)) {
con->keep_alive = 0;
}
-
- /**
- * if the backend sent a Connection: close, follow the wish
- *
- * NOTE: if the backend sent Connection: Keep-Alive, but no Content-Length, we
- * will close the connection. That's fine. We can always decide the close
- * the connection
- *
- * FIXME: to be nice we should remove the Connection: ...
- */
- if (con->parsed_response & HTTP_CONNECTION) {
+
+ if (0 == (con->parsed_response & HTTP_CONNECTION)) {
+ /* (f)cgi did'nt send Connection: header
+ *
+ * shall we ?
+ */
+ if (((con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) == 0) &&
+ (con->parsed_response & HTTP_CONTENT_LENGTH) == 0) {
+ /* without content_length, no keep-alive */
+
+ con->keep_alive = 0;
+ }
+ } else {
/* a subrequest disable keep-alive although the client wanted it */
if (con->keep_alive && !con->response.keep_alive) {
con->keep_alive = 0;
+
+ /* FIXME: we have to drop the Connection: Header from the subrequest */
}
}
}
-
+
if (con->request.http_method == HTTP_METHOD_HEAD) {
- /**
- * a HEAD request has the same as a GET
- * without the content
- */
- con->file_finished = 1;
-
chunkqueue_reset(con->write_queue);
- con->response.transfer_encoding &= ~HTTP_TRANSFER_ENCODING_CHUNKED;
}
http_response_write_header(srv, con);
-
+
return 0;
}
static int connection_handle_write(server *srv, connection *con) {
- switch(network_write_chunkqueue(srv, con, con->write_queue, MAX_WRITE_LIMIT)) {
+ switch(network_write_chunkqueue(srv, con, con->write_queue)) {
case 0:
- con->write_request_ts = srv->cur_ts;
if (con->file_finished) {
connection_set_state(srv, con, CON_STATE_RESPONSE_END);
joblist_append(srv, con);
@@ -643,13 +536,12 @@ static int connection_handle_write(server *srv, connection *con) {
joblist_append(srv, con);
break;
case 1:
- con->write_request_ts = srv->cur_ts;
con->is_writable = 0;
-
+
/* not finished yet -> WRITE */
break;
}
-
+
return 0;
}
@@ -657,11 +549,11 @@ static int connection_handle_write(server *srv, connection *con) {
connection *connection_init(server *srv) {
connection *con;
-
+
UNUSED(srv);
con = calloc(1, sizeof(*con));
-
+
con->fd = 0;
con->ndx = -1;
con->fde_ndx = -1;
@@ -672,35 +564,32 @@ connection *connection_init(server *srv) {
#define CLEAN(x) \
con->x = buffer_init();
-
+
CLEAN(request.uri);
CLEAN(request.request_line);
CLEAN(request.request);
CLEAN(request.pathinfo);
-
+
CLEAN(request.orig_uri);
-
+
CLEAN(uri.scheme);
CLEAN(uri.authority);
CLEAN(uri.path);
CLEAN(uri.path_raw);
CLEAN(uri.query);
-
+
CLEAN(physical.doc_root);
CLEAN(physical.path);
CLEAN(physical.basedir);
CLEAN(physical.rel_path);
CLEAN(physical.etag);
CLEAN(parse_request);
-
+
CLEAN(authed_user);
CLEAN(server_name);
CLEAN(error_handler);
CLEAN(dst_addr_buf);
-#if defined USE_OPENSSL && ! defined OPENSSL_NO_TLSEXT
- CLEAN(tlsext_server_name);
-#endif
-
+
#undef CLEAN
con->write_queue = chunkqueue_init();
con->read_queue = chunkqueue_init();
@@ -710,26 +599,26 @@ connection *connection_init(server *srv) {
con->request.headers = array_init();
con->response.headers = array_init();
con->environment = array_init();
-
+
/* init plugin specific connection structures */
-
+
con->plugin_ctx = calloc(1, (srv->plugins.used + 1) * sizeof(void *));
-
+
con->cond_cache = calloc(srv->config_context->used, sizeof(cond_cache_t));
config_setup_connection(srv, con);
-
+
return con;
}
void connections_free(server *srv) {
connections *conns = srv->conns;
- size_t i;
-
+ size_t i;
+
for (i = 0; i < conns->size; i++) {
connection *con = conns->ptr[i];
-
+
connection_reset(srv, con);
-
+
chunkqueue_free(con->write_queue);
chunkqueue_free(con->read_queue);
chunkqueue_free(con->request_content_queue);
@@ -739,131 +628,125 @@ void connections_free(server *srv) {
#define CLEAN(x) \
buffer_free(con->x);
-
+
CLEAN(request.uri);
CLEAN(request.request_line);
CLEAN(request.request);
CLEAN(request.pathinfo);
-
+
CLEAN(request.orig_uri);
-
+
CLEAN(uri.scheme);
CLEAN(uri.authority);
CLEAN(uri.path);
CLEAN(uri.path_raw);
CLEAN(uri.query);
-
+
CLEAN(physical.doc_root);
CLEAN(physical.path);
CLEAN(physical.basedir);
CLEAN(physical.etag);
CLEAN(physical.rel_path);
CLEAN(parse_request);
-
+
CLEAN(authed_user);
CLEAN(server_name);
CLEAN(error_handler);
CLEAN(dst_addr_buf);
-#if defined USE_OPENSSL && ! defined OPENSSL_NO_TLSEXT
- CLEAN(tlsext_server_name);
-#endif
#undef CLEAN
free(con->plugin_ctx);
free(con->cond_cache);
-
+
free(con);
}
-
+
free(conns->ptr);
}
int connection_reset(server *srv, connection *con) {
size_t i;
-
+
plugins_call_connection_reset(srv, con);
-
+
con->is_readable = 1;
con->is_writable = 1;
con->http_status = 0;
con->file_finished = 0;
con->file_started = 0;
con->got_response = 0;
-
+
con->parsed_response = 0;
-
+
con->bytes_written = 0;
con->bytes_written_cur_second = 0;
con->bytes_read = 0;
con->bytes_header = 0;
con->loops_per_request = 0;
-
+
con->request.http_method = HTTP_METHOD_UNSET;
con->request.http_version = HTTP_VERSION_UNSET;
-
+
con->request.http_if_modified_since = NULL;
con->request.http_if_none_match = NULL;
-
+
con->response.keep_alive = 0;
con->response.content_length = -1;
con->response.transfer_encoding = 0;
-
+
con->mode = DIRECT;
-
+
#define CLEAN(x) \
if (con->x) buffer_reset(con->x);
-
+
CLEAN(request.uri);
CLEAN(request.request_line);
CLEAN(request.pathinfo);
CLEAN(request.request);
-
- /* CLEAN(request.orig_uri); */
-
+
+ CLEAN(request.orig_uri);
+
CLEAN(uri.scheme);
- /* CLEAN(uri.authority); */
- /* CLEAN(uri.path); */
+ CLEAN(uri.authority);
+ CLEAN(uri.path);
CLEAN(uri.path_raw);
- /* CLEAN(uri.query); */
-
+ CLEAN(uri.query);
+
CLEAN(physical.doc_root);
CLEAN(physical.path);
CLEAN(physical.basedir);
CLEAN(physical.rel_path);
CLEAN(physical.etag);
-
+
CLEAN(parse_request);
-
+
CLEAN(authed_user);
CLEAN(server_name);
CLEAN(error_handler);
-#if defined USE_OPENSSL && ! defined OPENSSL_NO_TLSEXT
- CLEAN(tlsext_server_name);
-#endif
-#undef CLEAN
-
+#undef CLEAN
+
#define CLEAN(x) \
- if (con->x) con->x->used = 0;
-
+ if (con->x) con->x->used = 0;
+
#undef CLEAN
-
+
#define CLEAN(x) \
con->request.x = NULL;
-
+
CLEAN(http_host);
CLEAN(http_range);
CLEAN(http_content_type);
#undef CLEAN
con->request.content_length = 0;
-
+
array_reset(con->request.headers);
array_reset(con->response.headers);
array_reset(con->environment);
-
+
chunkqueue_reset(con->write_queue);
chunkqueue_reset(con->request_content_queue);
- /* the plugins should cleanup themself */
+ /* the plugins should cleanup themself */
for (i = 0; i < srv->plugins.used; i++) {
plugin *p = ((plugin **)(srv->plugins.ptr))[i];
plugin_data *pd = p->data;
@@ -876,40 +759,95 @@ int connection_reset(server *srv, connection *con) {
con->plugin_ctx[pd->id] = NULL;
}
-
- /* The cond_cache gets reset in response.c */
- /* config_cond_cache_reset(srv, con); */
-
+
+#if COND_RESULT_UNSET
+ for (i = srv->config_context->used - 1; i >= 0; i --) {
+ con->cond_cache[i].result = COND_RESULT_UNSET;
+ con->cond_cache[i].patterncount = 0;
+ }
+#else
+ memset(con->cond_cache, 0, sizeof(cond_cache_t) * srv->config_context->used);
+#endif
+
con->header_len = 0;
con->in_error_handler = 0;
-
+
config_setup_connection(srv, con);
-
+
return 0;
}
/**
+ *
+ * search for \r\n\r\n
+ *
+ * this is a special 32bit version which is using a sliding window for
+ * the comparisions
+ *
+ * how it works:
+ *
+ * b: 'abcdefg'
+ * rnrn: 'cdef'
+ *
+ * cmpbuf: abcd != cdef
+ * cmpbuf: bcde != cdef
+ * cmpbuf: cdef == cdef -> return &c
+ *
+ * cmpbuf and rnrn are treated as 32bit uint and bit-ops are used to
+ * maintain cmpbuf and rnrn
+ *
+ */
+
+char *buffer_search_rnrn(buffer *b) {
+ uint32_t cmpbuf, rnrn;
+ char *cp;
+ size_t i;
+
+ if (b->used < 4) return NULL;
+
+ rnrn = ('\r' << 24) | ('\n' << 16) |
+ ('\r' << 8) | ('\n' << 0);
+
+ cmpbuf = (b->ptr[0] << 24) | (b->ptr[1] << 16) |
+ (b->ptr[2] << 8) | (b->ptr[3] << 0);
+
+ cp = b->ptr + 4;
+ for (i = 0; i < b->used - 4; i++) {
+ if (cmpbuf == rnrn) return cp - 4;
+
+ cmpbuf = (cmpbuf << 8 | *(cp++)) & 0xffffffff;
+ }
+
+ return NULL;
+}
+/**
* handle all header and content read
*
* we get called by the state-engine and by the fdevent-handler
*/
-static int connection_handle_read_state(server *srv, connection *con) {
- connection_state_t ostate = con->state;
- chunk *c, *last_chunk;
- off_t last_offset;
+int connection_handle_read_state(server *srv, connection *con) {
+ int ostate = con->state;
+ char *h_term = NULL;
+ chunk *c;
chunkqueue *cq = con->read_queue;
chunkqueue *dst_cq = con->request_content_queue;
- int is_closed = 0; /* the connection got closed, if we don't have a complete header, -> error */
-
+
if (con->is_readable) {
con->read_idle_ts = srv->cur_ts;
-
+
switch(connection_handle_read(srv, con)) {
case -1:
return -1;
case -2:
- is_closed = 1;
- break;
+ /* remote side closed the connection
+ * if we still have content, handle it, if not leave here */
+
+ if (cq->first == cq->last &&
+ cq->first->mem->used == 0) {
+
+ /* conn-closed, leave here */
+ connection_set_state(srv, con, CON_STATE_ERROR);
+ }
default:
break;
}
@@ -926,7 +864,6 @@ static int connection_handle_read_state(server *srv, connection *con) {
c->next = cq->unused;
cq->unused = c;
- cq->unused_chunks++;
c = cq->first;
} else if (c->next && c->next->mem->used == 0) {
@@ -939,125 +876,128 @@ static int connection_handle_read_state(server *srv, connection *con) {
fc->next = cq->unused;
cq->unused = fc;
- cq->unused_chunks++;
/* the last node was empty */
if (c->next == NULL) {
cq->last = c;
- }
+ }
c = c->next;
} else {
c = c->next;
}
}
-
- /* we might have got several packets at once
- */
+
+ /* nothing to handle */
+ if (cq->first == NULL) return 0;
switch(ostate) {
case CON_STATE_READ:
- /* if there is a \r\n\r\n in the chunkqueue
- *
- * scan the chunk-queue twice
- * 1. to find the \r\n\r\n
- * 2. to copy the header-packet
- *
- */
-
- last_chunk = NULL;
- last_offset = 0;
-
- for (c = cq->first; c; c = c->next) {
+ /* prepare con->request.request */
+ c = cq->first;
+
+ /* check if we need the full package */
+ if (con->request.request->used == 0) {
buffer b;
- size_t i;
-
+
b.ptr = c->mem->ptr + c->offset;
b.used = c->mem->used - c->offset;
- if (b.used > 0) b.used--; /* buffer "used" includes terminating zero */
-
- for (i = 0; i < b.used; i++) {
- char ch = b.ptr[i];
-
- if ('\r' == ch) {
- /* chec if \n\r\n follows */
- size_t j = i+1;
- chunk *cc = c;
- const char header_end[] = "\r\n\r\n";
- int header_end_match_pos = 1;
-
- for ( ; cc; cc = cc->next, j = 0 ) {
- buffer bb;
- bb.ptr = cc->mem->ptr + cc->offset;
- bb.used = cc->mem->used - cc->offset;
- if (bb.used > 0) bb.used--; /* buffer "used" includes terminating zero */
-
- for ( ; j < bb.used; j++) {
- ch = bb.ptr[j];
-
- if (ch == header_end[header_end_match_pos]) {
- header_end_match_pos++;
- if (4 == header_end_match_pos) {
- last_chunk = cc;
- last_offset = j+1;
- goto found_header_end;
- }
- } else {
- goto reset_search;
- }
- }
- }
- }
-reset_search: ;
+
+ if (NULL != (h_term = buffer_search_rnrn(&b))) {
+ /* \r\n\r\n found
+ * - copy everything incl. the terminator to request.request
+ */
+
+ buffer_copy_string_len(con->request.request,
+ b.ptr,
+ h_term - b.ptr + 4);
+
+ /* the buffer has been read up to the terminator */
+ c->offset += h_term - b.ptr + 4;
+ } else {
+ /* not found, copy everything */
+ buffer_copy_string_len(con->request.request, c->mem->ptr + c->offset, c->mem->used - c->offset - 1);
+ c->offset = c->mem->used - 1;
}
- }
-found_header_end:
-
- /* found */
- if (last_chunk) {
- buffer_reset(con->request.request);
-
- for (c = cq->first; c; c = c->next) {
- buffer b;
-
- b.ptr = c->mem->ptr + c->offset;
- b.used = c->mem->used - c->offset;
-
- if (c == last_chunk) {
- b.used = last_offset + 1;
- }
-
- buffer_append_string_buffer(con->request.request, &b);
-
- if (c == last_chunk) {
- c->offset += last_offset;
-
- break;
- } else {
- /* the whole packet was copied */
- c->offset = c->mem->used - 1;
- }
+ } else {
+ /* have to take care of overlapping header terminators */
+
+ size_t l = con->request.request->used - 2;
+ char *s = con->request.request->ptr;
+ buffer b;
+
+ b.ptr = c->mem->ptr + c->offset;
+ b.used = c->mem->used - c->offset;
+
+ if (con->request.request->used - 1 > 3 &&
+ c->mem->used > 1 &&
+ s[l-2] == '\r' &&
+ s[l-1] == '\n' &&
+ s[l-0] == '\r' &&
+ c->mem->ptr[0] == '\n') {
+ buffer_append_string_len(con->request.request, c->mem->ptr + c->offset, 1);
+ c->offset += 1;
+
+ h_term = con->request.request->ptr;
+ } else if (con->request.request->used - 1 > 2 &&
+ c->mem->used > 2 &&
+ s[l-1] == '\r' &&
+ s[l-0] == '\n' &&
+ c->mem->ptr[0] == '\r' &&
+ c->mem->ptr[1] == '\n') {
+ buffer_append_string_len(con->request.request, c->mem->ptr + c->offset, 2);
+ c->offset += 2;
+
+ h_term = con->request.request->ptr;
+ } else if (con->request.request->used - 1 > 1 &&
+ c->mem->used > 3 &&
+ s[l-0] == '\r' &&
+ c->mem->ptr[0] == '\n' &&
+ c->mem->ptr[1] == '\r' &&
+ c->mem->ptr[2] == '\n') {
+ buffer_append_string_len(con->request.request, c->mem->ptr + c->offset, 3);
+ c->offset += 3;
+
+ h_term = con->request.request->ptr;
+ } else if (NULL != (h_term = buffer_search_string_len(&b, "\r\n\r\n", 4))) {
+ /* \r\n\r\n found
+ * - copy everything incl. the terminator to request.request
+ */
+
+ buffer_append_string_len(con->request.request,
+ c->mem->ptr + c->offset,
+ c->offset + h_term - b.ptr + 4);
+
+ /* the buffer has been read up to the terminator */
+ c->offset += h_term - b.ptr + 4;
+ } else {
+ /* not found, copy everything */
+ buffer_append_string_len(con->request.request, c->mem->ptr + c->offset, c->mem->used - c->offset - 1);
+ c->offset = c->mem->used - 1;
}
+ }
+ /* con->request.request is setup up */
+ if (h_term) {
connection_set_state(srv, con, CON_STATE_REQUEST_END);
- } else if (chunkqueue_length(cq) > 64 * 1024) {
- log_error_write(srv, __FILE__, __LINE__, "s", "oversized request-header -> sending Status 414");
+ } else if (con->request.request->used > 64 * 1024) {
+ log_error_write(srv, __FILE__, __LINE__, "sd", "http-header larger then 64k -> disconnected", chunkqueue_length(cq));
con->http_status = 414; /* Request-URI too large */
con->keep_alive = 0;
- connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
+ connection_set_state(srv, con, CON_STATE_REQUEST_END);
}
break;
- case CON_STATE_READ_POST:
+ case CON_STATE_READ_POST:
for (c = cq->first; c && (dst_cq->bytes_in != (off_t)con->request.content_length); c = c->next) {
off_t weWant, weHave, toRead;
-
+
weWant = con->request.content_length - dst_cq->bytes_in;
-
+
assert(c->mem->used);
-
+
weHave = c->mem->used - c->offset - 1;
-
+
toRead = weHave > weWant ? weWant : weHave;
/* the new way, copy everything into a chunkqueue whcih might use tempfiles */
@@ -1066,13 +1006,13 @@ found_header_end:
/* copy everything to max 1Mb sized tempfiles */
/*
- * if the last chunk is
+ * if the last chunk is
* - smaller than 1Mb (size < 1Mb)
* - not read yet (offset == 0)
* -> append to it
* otherwise
- * -> create a new chunk
- *
+ * -> create a new chunk
+ *
* */
if (dst_cq->last &&
@@ -1087,9 +1027,6 @@ found_header_end:
if (dst_c->file.fd == -1) {
/* this should not happen as we cache the fd, but you never know */
dst_c->file.fd = open(dst_c->file.name->ptr, O_WRONLY | O_APPEND);
-#ifdef FD_CLOEXEC
- fcntl(dst_c->file.fd, F_SETFD, FD_CLOEXEC);
-#endif
}
} else {
/* the chunk is too large now, close it */
@@ -1108,14 +1045,14 @@ found_header_end:
/* we have a chunk, let's write to it */
if (dst_c->file.fd == -1) {
- /* we don't have file to write to,
+ /* we don't have file to write to,
* EACCES might be one reason.
*
* Instead of sending 500 we send 413 and say the request is too large
* */
log_error_write(srv, __FILE__, __LINE__, "sbs",
- "denying upload as opening to temp-file for upload failed:",
+ "denying upload as opening to temp-file for upload failed:",
dst_c->file.name, strerror(errno));
con->http_status = 413; /* Request-Entity too large */
@@ -1126,15 +1063,15 @@ found_header_end:
}
if (toRead != write(dst_c->file.fd, c->mem->ptr + c->offset, toRead)) {
- /* write failed for some reason ... disk full ? */
+ /* write failed for some reason ... disk full ? */
log_error_write(srv, __FILE__, __LINE__, "sbs",
- "denying upload as writing to file failed:",
+ "denying upload as writing to file failed:",
dst_c->file.name, strerror(errno));
-
+
con->http_status = 413; /* Request-Entity too large */
con->keep_alive = 0;
connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
-
+
close(dst_c->file.fd);
dst_c->file.fd = -1;
@@ -1142,7 +1079,7 @@ found_header_end:
}
dst_c->file.length += toRead;
-
+
if (dst_cq->bytes_in + toRead == (off_t)con->request.content_length) {
/* we read everything, close the chunk */
close(dst_c->file.fd);
@@ -1151,17 +1088,10 @@ found_header_end:
} else {
buffer *b;
- if (dst_cq->last &&
- dst_cq->last->type == MEM_CHUNK) {
- b = dst_cq->last->mem;
- } else {
- b = chunkqueue_get_append_buffer(dst_cq);
- /* prepare buffer size for remaining POST data; is < 64kb */
- buffer_prepare_copy(b, con->request.content_length - dst_cq->bytes_in + 1);
- }
- buffer_append_string_len(b, c->mem->ptr + c->offset, toRead);
+ b = chunkqueue_get_append_buffer(dst_cq);
+ buffer_copy_string_len(b, c->mem->ptr + c->offset, toRead);
}
-
+
c->offset += toRead;
dst_cq->bytes_in += toRead;
}
@@ -1170,15 +1100,8 @@ found_header_end:
if (dst_cq->bytes_in == (off_t)con->request.content_length) {
connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
}
-
+
break;
- default: break;
- }
-
- /* the connection got closed and we didn't got enough data to leave one of the READ states
- * the only way is to leave here */
- if (is_closed && ostate == con->state) {
- connection_set_state(srv, con, CON_STATE_ERROR);
}
chunkqueue_remove_finished_chunks(cq);
@@ -1186,39 +1109,35 @@ found_header_end:
return 0;
}
-static handler_t connection_handle_fdevent(server *srv, void *context, int revents) {
+handler_t connection_handle_fdevent(void *s, void *context, int revents) {
+ server *srv = (server *)s;
connection *con = context;
-
+
joblist_append(srv, con);
-
- if (con->conf.is_ssl) {
- /* ssl may read and write for both reads and writes */
- if (revents & (FDEVENT_IN | FDEVENT_OUT)) {
- con->is_readable = 1;
- con->is_writable = 1;
- }
- } else {
- if (revents & FDEVENT_IN) {
- con->is_readable = 1;
- }
- if (revents & FDEVENT_OUT) {
- con->is_writable = 1;
- /* we don't need the event twice */
- }
+
+ if (revents & FDEVENT_IN) {
+ con->is_readable = 1;
+#if 0
+ log_error_write(srv, __FILE__, __LINE__, "sd", "read-wait - done", con->fd);
+#endif
}
-
-
+ if (revents & FDEVENT_OUT) {
+ con->is_writable = 1;
+ /* we don't need the event twice */
+ }
+
+
if (revents & ~(FDEVENT_IN | FDEVENT_OUT)) {
/* looks like an error */
-
+
/* FIXME: revents = 0x19 still means that we should read from the queue */
if (revents & FDEVENT_HUP) {
if (con->state == CON_STATE_CLOSE) {
- con->close_timeout_ts = srv->cur_ts - (HTTP_LINGER_TIMEOUT+1);
+ con->close_timeout_ts = 0;
} else {
/* sigio reports the wrong event here
- *
- * there was no HUP at all
+ *
+ * there was no HUP at all
*/
#ifdef USE_LINUX_SIGIO
if (srv->ev->in_sigio == 1) {
@@ -1230,50 +1149,63 @@ static handler_t connection_handle_fdevent(server *srv, void *context, int reven
#else
connection_set_state(srv, con, CON_STATE_ERROR);
#endif
-
+
}
} else if (revents & FDEVENT_ERR) {
- /* error, connection reset, whatever... we don't want to spam the logfile */
-#if 0
+#ifndef USE_LINUX_SIGIO
log_error_write(srv, __FILE__, __LINE__, "sd",
"connection closed: poll() -> ERR", con->fd);
-#endif
+#endif
connection_set_state(srv, con, CON_STATE_ERROR);
} else {
log_error_write(srv, __FILE__, __LINE__, "sd",
"connection closed: poll() -> ???", revents);
- }
+ }
}
-
+
if (con->state == CON_STATE_READ ||
con->state == CON_STATE_READ_POST) {
connection_handle_read_state(srv, con);
}
-
+
if (con->state == CON_STATE_WRITE &&
!chunkqueue_is_empty(con->write_queue) &&
con->is_writable) {
-
+
if (-1 == connection_handle_write(srv, con)) {
connection_set_state(srv, con, CON_STATE_ERROR);
-
+
log_error_write(srv, __FILE__, __LINE__, "ds",
con->fd,
"handle write failed.");
+ } else if (con->state == CON_STATE_WRITE) {
+ con->write_request_ts = srv->cur_ts;
}
}
-
+
if (con->state == CON_STATE_CLOSE) {
/* flush the read buffers */
- int len;
- char buf[1024];
-
- len = read(con->fd, buf, sizeof(buf));
- if (len == 0 || (len < 0 && errno != EAGAIN && errno != EINTR) ) {
- con->close_timeout_ts = srv->cur_ts - (HTTP_LINGER_TIMEOUT+1);
+ int b;
+
+ if (ioctl(con->fd, FIONREAD, &b)) {
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "ioctl() failed", strerror(errno));
+ }
+
+ if (b > 0) {
+ char buf[1024];
+ log_error_write(srv, __FILE__, __LINE__, "sdd",
+ "CLOSE-read()", con->fd, b);
+
+ /* */
+ read(con->fd, buf, sizeof(buf));
+ } else {
+ /* nothing to read */
+
+ con->close_timeout_ts = 0;
}
}
-
+
return HANDLER_FINISHED;
}
@@ -1286,65 +1218,43 @@ connection *connection_accept(server *srv, server_socket *srv_socket) {
sock_addr cnt_addr;
socklen_t cnt_len;
/* accept it and register the fd */
-
- /**
- * check if we can still open a new connections
- *
- * see #1216
- */
-
- if (srv->conns->used >= srv->max_conns) {
- return NULL;
- }
-
+
cnt_len = sizeof(cnt_addr);
if (-1 == (cnt = accept(srv_socket->fd, (struct sockaddr *) &cnt_addr, &cnt_len))) {
- switch (errno) {
- case EAGAIN:
-#if EWOULDBLOCK != EAGAIN
- case EWOULDBLOCK:
-#endif
- case EINTR:
- /* we were stopped _before_ we had a connection */
- case ECONNABORTED: /* this is a FreeBSD thingy */
- /* we were stopped _after_ we had a connection */
- break;
- case EMFILE:
- /* out of fds */
- break;
- default:
+ if ((errno != EAGAIN) &&
+ (errno != EINTR)) {
log_error_write(srv, __FILE__, __LINE__, "ssd", "accept failed:", strerror(errno), errno);
}
return NULL;
} else {
connection *con;
-
+
srv->cur_fds++;
-
+
/* ok, we have the connection, register it */
#if 0
log_error_write(srv, __FILE__, __LINE__, "sd",
"appected()", cnt);
#endif
srv->con_opened++;
-
+
con = connections_get_new_connection(srv);
-
+
con->fd = cnt;
con->fde_ndx = -1;
-#if 0
+#if 0
gettimeofday(&(con->start_tv), NULL);
-#endif
+#endif
fdevent_register(srv->ev, con->fd, connection_handle_fdevent, con);
-
+
connection_set_state(srv, con, CON_STATE_REQUEST_START);
-
+
con->connection_start = srv->cur_ts;
con->dst_addr = cnt_addr;
buffer_copy_string(con->dst_addr_buf, inet_ntop_cache_get_ip(srv, &(con->dst_addr)));
con->srv_socket = srv_socket;
-
+
if (-1 == (fdevent_fcntl_set(srv->ev, con->fd))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "fcntl failed: ", strerror(errno));
return NULL;
@@ -1353,19 +1263,17 @@ connection *connection_accept(server *srv, server_socket *srv_socket) {
/* connect FD to SSL */
if (srv_socket->is_ssl) {
if (NULL == (con->ssl = SSL_new(srv_socket->ssl_ctx))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
ERR_error_string(ERR_get_error(), NULL));
-
+
return NULL;
}
-
- con->renegotiations = 0;
- SSL_set_app_data(con->ssl, con);
+
SSL_set_accept_state(con->ssl);
con->conf.is_ssl=1;
-
+
if (1 != (SSL_set_fd(con->ssl, cnt))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
ERR_error_string(ERR_get_error(), NULL));
return NULL;
}
@@ -1381,133 +1289,129 @@ int connection_state_machine(server *srv, connection *con) {
#ifdef USE_OPENSSL
server_socket *srv_sock = con->srv_socket;
#endif
-
+
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
- "state at start",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
+ "state at start",
con->fd,
connection_get_state(con->state));
}
while (done == 0) {
size_t ostate = con->state;
-
+ int b;
+
switch (con->state) {
case CON_STATE_REQUEST_START: /* transient */
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
"state for fd", con->fd, connection_get_state(con->state));
}
-
+
con->request_start = srv->cur_ts;
con->read_idle_ts = srv->cur_ts;
-
+
con->request_count++;
con->loops_per_request = 0;
-
+
connection_set_state(srv, con, CON_STATE_READ);
-
- /* patch con->conf.is_ssl if the connection is a ssl-socket already */
-
-#ifdef USE_OPENSSL
- con->conf.is_ssl = srv_sock->is_ssl;
-#endif
-
+
break;
case CON_STATE_REQUEST_END: /* transient */
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
"state for fd", con->fd, connection_get_state(con->state));
}
-
- buffer_reset(con->uri.authority);
- buffer_reset(con->uri.path);
- buffer_reset(con->uri.query);
- buffer_reset(con->request.orig_uri);
-
+
if (http_request_parse(srv, con)) {
/* we have to read some data from the POST request */
-
+
connection_set_state(srv, con, CON_STATE_READ_POST);
break;
}
-
+
connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
-
+
break;
case CON_STATE_HANDLE_REQUEST:
- /*
+ /*
* the request is parsed
- *
+ *
* decided what to do with the request
- * -
- *
- *
+ * -
+ *
+ *
*/
-
+
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
"state for fd", con->fd, connection_get_state(con->state));
}
-
+
switch (r = http_response_prepare(srv, con)) {
case HANDLER_FINISHED:
- if (con->mode == DIRECT) {
- if (con->http_status == 404 ||
- con->http_status == 403) {
- /* 404 error-handler */
-
- if (con->in_error_handler == 0 &&
- (!buffer_is_empty(con->conf.error_handler) ||
- !buffer_is_empty(con->error_handler))) {
- /* call error-handler */
-
- con->error_handler_saved_status = con->http_status;
- con->http_status = 0;
-
- if (buffer_is_empty(con->error_handler)) {
- buffer_copy_string_buffer(con->request.uri, con->conf.error_handler);
- } else {
- buffer_copy_string_buffer(con->request.uri, con->error_handler);
- }
- buffer_reset(con->physical.path);
-
- con->in_error_handler = 1;
-
- connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
-
- done = -1;
- break;
- } else if (con->in_error_handler) {
- /* error-handler is a 404 */
-
- con->http_status = con->error_handler_saved_status;
+ if (con->http_status == 404 ||
+ con->http_status == 403) {
+ /* 404 error-handler */
+
+ if (con->in_error_handler == 0 &&
+ (!buffer_is_empty(con->conf.error_handler) ||
+ !buffer_is_empty(con->error_handler))) {
+ /* call error-handler */
+
+ con->error_handler_saved_status = con->http_status;
+ con->http_status = 0;
+
+ if (buffer_is_empty(con->error_handler)) {
+ buffer_copy_string_buffer(con->request.uri, con->conf.error_handler);
+ } else {
+ buffer_copy_string_buffer(con->request.uri, con->error_handler);
}
+ buffer_reset(con->physical.path);
+
+ con->in_error_handler = 1;
+
+ connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
+
+ done = -1;
+ break;
} else if (con->in_error_handler) {
- /* error-handler is back and has generated content */
- /* if Status: was set, take it otherwise use 200 */
+ /* error-handler is a 404 */
+
+ /* continue as normal, status is the same */
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "Warning: Either the error-handler returned status 404 or the error-handler itself was not found:", con->request.uri);
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "returning the original status", con->error_handler_saved_status);
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "If this is a rails app: check your production.log");
+ con->http_status = con->error_handler_saved_status;
}
+ } else if (con->in_error_handler) {
+ /* error-handler is back and has generated content */
+ /* if Status: was set, take it otherwise use 200 */
}
+
if (con->http_status == 0) con->http_status = 200;
-
+
/* we have something to send, go on */
connection_set_state(srv, con, CON_STATE_RESPONSE_START);
break;
case HANDLER_WAIT_FOR_FD:
srv->want_fds++;
-
+
fdwaitqueue_append(srv, con);
-
+
connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
-
+
break;
case HANDLER_COMEBACK:
done = -1;
case HANDLER_WAIT_FOR_EVENT:
/* come back here */
connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
-
+
break;
case HANDLER_ERROR:
/* something went wrong */
@@ -1517,44 +1421,44 @@ int connection_state_machine(server *srv, connection *con) {
log_error_write(srv, __FILE__, __LINE__, "sdd", "unknown ret-value: ", con->fd, r);
break;
}
-
+
break;
case CON_STATE_RESPONSE_START:
- /*
+ /*
* the decision is done
* - create the HTTP-Response-Header
- *
+ *
*/
-
+
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
"state for fd", con->fd, connection_get_state(con->state));
}
-
+
if (-1 == connection_handle_write_prepare(srv, con)) {
connection_set_state(srv, con, CON_STATE_ERROR);
-
+
break;
}
-
+
connection_set_state(srv, con, CON_STATE_WRITE);
break;
case CON_STATE_RESPONSE_END: /* transient */
/* log the request */
-
+
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
"state for fd", con->fd, connection_get_state(con->state));
}
-
+
plugins_call_handle_request_done(srv, con);
-
+
srv->con_written++;
-
+
if (con->keep_alive) {
connection_set_state(srv, con, CON_STATE_REQUEST_START);
-
-#if 0
+
+#if 0
con->request_start = srv->cur_ts;
con->read_idle_ts = srv->cur_ts;
#endif
@@ -1567,7 +1471,7 @@ int connection_state_machine(server *srv, connection *con) {
log_error_write(srv, __FILE__, __LINE__, "sd", "unhandling return value", r);
break;
}
-
+
#ifdef USE_OPENSSL
if (srv_sock->is_ssl) {
switch (SSL_shutdown(con->ssl)) {
@@ -1575,89 +1479,90 @@ int connection_state_machine(server *srv, connection *con) {
/* done */
break;
case 0:
- /* wait for fd-event
- *
+ /* wait for fd-event
+ *
* FIXME: wait for fdevent and call SSL_shutdown again
- *
+ *
*/
-
+
break;
default:
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
ERR_error_string(ERR_get_error(), NULL));
}
}
#endif
- if ((0 == shutdown(con->fd, SHUT_WR))) {
- con->close_timeout_ts = srv->cur_ts;
- connection_set_state(srv, con, CON_STATE_CLOSE);
- } else {
- connection_close(srv, con);
- }
-
+ connection_close(srv, con);
+
srv->con_closed++;
}
-
+
connection_reset(srv, con);
-
+
break;
case CON_STATE_CONNECT:
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
"state for fd", con->fd, connection_get_state(con->state));
}
-
+
chunkqueue_reset(con->read_queue);
-
+
con->request_count = 0;
-
+
break;
case CON_STATE_CLOSE:
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
"state for fd", con->fd, connection_get_state(con->state));
}
-
- /* we have to do the linger_on_close stuff regardless
- * of con->keep_alive; even non-keepalive sockets may
- * still have unread data, and closing before reading
- * it will make the client not see all our output.
- */
- {
- int len;
- char buf[1024];
-
- len = read(con->fd, buf, sizeof(buf));
- if (len == 0 || (len < 0 && errno != EAGAIN && errno != EINTR) ) {
- con->close_timeout_ts = srv->cur_ts - (HTTP_LINGER_TIMEOUT+1);
+
+ if (con->keep_alive) {
+ if (ioctl(con->fd, FIONREAD, &b)) {
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "ioctl() failed", strerror(errno));
}
+ if (b > 0) {
+ char buf[1024];
+ log_error_write(srv, __FILE__, __LINE__, "sdd",
+ "CLOSE-read()", con->fd, b);
+
+ /* */
+ read(con->fd, buf, sizeof(buf));
+ } else {
+ /* nothing to read */
+
+ con->close_timeout_ts = 0;
+ }
+ } else {
+ con->close_timeout_ts = 0;
}
-
- if (srv->cur_ts - con->close_timeout_ts > HTTP_LINGER_TIMEOUT) {
+
+ if (srv->cur_ts - con->close_timeout_ts > 1) {
connection_close(srv, con);
-
+
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"connection closed for fd", con->fd);
}
}
-
+
break;
case CON_STATE_READ_POST:
case CON_STATE_READ:
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
"state for fd", con->fd, connection_get_state(con->state));
}
-
+
connection_handle_read_state(srv, con);
break;
case CON_STATE_WRITE:
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
"state for fd", con->fd, connection_get_state(con->state));
}
-
+
/* only try to write if we have something in the queue */
if (!chunkqueue_is_empty(con->write_queue)) {
#if 0
@@ -1673,70 +1578,42 @@ int connection_state_machine(server *srv, connection *con) {
con->fd,
"handle write failed.");
connection_set_state(srv, con, CON_STATE_ERROR);
+ } else if (con->state == CON_STATE_WRITE) {
+ con->write_request_ts = srv->cur_ts;
}
}
-
+
break;
case CON_STATE_ERROR: /* transient */
-
+
/* even if the connection was drop we still have to write it to the access log */
if (con->http_status) {
plugins_call_handle_request_done(srv, con);
}
#ifdef USE_OPENSSL
if (srv_sock->is_ssl) {
- int ret, ssl_r;
- unsigned long err;
- ERR_clear_error();
+ int ret;
switch ((ret = SSL_shutdown(con->ssl))) {
case 1:
/* ok */
break;
case 0:
- ERR_clear_error();
- if (-1 != (ret = SSL_shutdown(con->ssl))) break;
-
- /* fall through */
+ SSL_shutdown(con->ssl);
+ break;
default:
-
- switch ((ssl_r = SSL_get_error(con->ssl, ret))) {
- case SSL_ERROR_WANT_WRITE:
- case SSL_ERROR_WANT_READ:
- break;
- case SSL_ERROR_SYSCALL:
- /* perhaps we have error waiting in our error-queue */
- if (0 != (err = ERR_get_error())) {
- do {
- log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
- ssl_r, ret,
- ERR_error_string(err, NULL));
- } while((err = ERR_get_error()));
- } else if (errno != 0) { /* ssl bug (see lighttpd ticket #2213): sometimes errno == 0 */
- log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL (error):",
- ssl_r, ret, errno,
- strerror(errno));
- }
-
- break;
- default:
- while((err = ERR_get_error())) {
- log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
- ssl_r, ret,
- ERR_error_string(err, NULL));
- }
-
- break;
- }
+ log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:",
+ SSL_get_error(con->ssl, ret),
+ ERR_error_string(ERR_get_error(), NULL));
+ return -1;
}
}
- ERR_clear_error();
#endif
-
+
switch(con->mode) {
case DIRECT:
#if 0
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "emergency exit: direct",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "emergency exit: direct",
con->fd);
#endif
break;
@@ -1746,39 +1623,40 @@ int connection_state_machine(server *srv, connection *con) {
case HANDLER_FINISHED:
break;
default:
- log_error_write(srv, __FILE__, __LINE__, "sd", "unhandling return value", r);
+ log_error_write(srv, __FILE__, __LINE__, "");
break;
}
break;
}
-
+
connection_reset(srv, con);
-
+
/* close the connection */
- if ((0 == shutdown(con->fd, SHUT_WR))) {
+ if ((con->keep_alive == 1) &&
+ (0 == shutdown(con->fd, SHUT_WR))) {
con->close_timeout_ts = srv->cur_ts;
connection_set_state(srv, con, CON_STATE_CLOSE);
-
+
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"shutdown for fd", con->fd);
}
} else {
connection_close(srv, con);
}
-
+
con->keep_alive = 0;
-
+
srv->con_closed++;
-
+
break;
default:
- log_error_write(srv, __FILE__, __LINE__, "sdd",
+ log_error_write(srv, __FILE__, __LINE__, "sdd",
"unknown state:", con->fd, con->state);
-
+
break;
}
-
+
if (done == -1) {
done = 0;
} else if (ostate == con->state) {
@@ -1787,27 +1665,27 @@ int connection_state_machine(server *srv, connection *con) {
}
if (srv->srvconf.log_state_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
- "state at exit:",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
+ "state at exit:",
con->fd,
connection_get_state(con->state));
}
-
+
switch(con->state) {
case CON_STATE_READ_POST:
case CON_STATE_READ:
case CON_STATE_CLOSE:
- fdevent_event_set(srv->ev, &(con->fde_ndx), con->fd, FDEVENT_IN);
+ fdevent_event_add(srv->ev, &(con->fde_ndx), con->fd, FDEVENT_IN);
break;
case CON_STATE_WRITE:
- /* request write-fdevent only if we really need it
+ /* request write-fdevent only if we really need it
* - if we have data to write
- * - if the socket is not writable yet
+ * - if the socket is not writable yet
*/
- if (!chunkqueue_is_empty(con->write_queue) &&
+ if (!chunkqueue_is_empty(con->write_queue) &&
(con->is_writable == 0) &&
(con->traffic_limit_reached == 0)) {
- fdevent_event_set(srv->ev, &(con->fde_ndx), con->fd, FDEVENT_OUT);
+ fdevent_event_add(srv->ev, &(con->fde_ndx), con->fd, FDEVENT_OUT);
} else {
fdevent_event_del(srv->ev, &(con->fde_ndx), con->fd);
}
diff --git a/src/crc32.h b/src/crc32.h
index c5b4245..d671c53 100644
--- a/src/crc32.h
+++ b/src/crc32.h
@@ -2,15 +2,15 @@
#define __crc32cr_table_h__
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
#endif
#include <sys/types.h>
#if defined HAVE_STDINT_H
-# include <stdint.h>
+#include <stdint.h>
#elif defined HAVE_INTTYPES_H
-# include <inttypes.h>
+#include <inttypes.h>
#endif
uint32_t generate_crc32c(char *string, size_t length);
diff --git a/src/data_array.c b/src/data_array.c
index 094d8c0..9dfa6fd 100644
--- a/src/data_array.c
+++ b/src/data_array.c
@@ -1,9 +1,9 @@
-#include "array.h"
-
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include "array.h"
+
static data_unset *data_array_copy(const data_unset *s) {
data_array *src = (data_array *)s;
data_array *ds = data_array_init();
@@ -17,16 +17,16 @@ static data_unset *data_array_copy(const data_unset *s) {
static void data_array_free(data_unset *d) {
data_array *ds = (data_array *)d;
-
+
buffer_free(ds->key);
array_free(ds->value);
-
+
free(d);
}
static void data_array_reset(data_unset *d) {
data_array *ds = (data_array *)d;
-
+
/* reused array elements */
buffer_reset(ds->key);
array_reset(ds->value);
@@ -36,7 +36,7 @@ static int data_array_insert_dup(data_unset *dst, data_unset *src) {
UNUSED(dst);
src->free(src);
-
+
return 0;
}
@@ -48,18 +48,18 @@ static void data_array_print(const data_unset *d, int depth) {
data_array *data_array_init(void) {
data_array *ds;
-
+
ds = calloc(1, sizeof(*ds));
-
+
ds->key = buffer_init();
ds->value = array_init();
-
+
ds->copy = data_array_copy;
ds->free = data_array_free;
ds->reset = data_array_reset;
ds->insert_dup = data_array_insert_dup;
ds->print = data_array_print;
ds->type = TYPE_ARRAY;
-
+
return ds;
}
diff --git a/src/data_config.c b/src/data_config.c
index 80e38de..8b3735e 100644
--- a/src/data_config.c
+++ b/src/data_config.c
@@ -1,9 +1,9 @@
-#include "array.h"
-
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include "array.h"
+
static data_unset *data_config_copy(const data_unset *s) {
data_config *src = (data_config *)s;
data_config *ds = data_config_init();
@@ -17,26 +17,26 @@ static data_unset *data_config_copy(const data_unset *s) {
static void data_config_free(data_unset *d) {
data_config *ds = (data_config *)d;
-
+
buffer_free(ds->key);
buffer_free(ds->op);
buffer_free(ds->comp_key);
-
+
array_free(ds->value);
array_free(ds->childs);
-
+
if (ds->string) buffer_free(ds->string);
#ifdef HAVE_PCRE_H
if (ds->regex) pcre_free(ds->regex);
if (ds->regex_study) pcre_free(ds->regex_study);
#endif
-
+
free(d);
}
static void data_config_reset(data_unset *d) {
data_config *ds = (data_config *)d;
-
+
/* reused array elements */
buffer_reset(ds->key);
buffer_reset(ds->comp_key);
@@ -45,9 +45,9 @@ static void data_config_reset(data_unset *d) {
static int data_config_insert_dup(data_unset *dst, data_unset *src) {
UNUSED(dst);
-
+
src->free(src);
-
+
return 0;
}
@@ -56,15 +56,15 @@ static void data_config_print(const data_unset *d, int depth) {
array *a = (array *)ds->value;
size_t i;
size_t maxlen;
-
+
if (0 == ds->context_ndx) {
- fprintf(stdout, "config {\n");
+ fprintf(stderr, "config {\n");
}
else {
- fprintf(stdout, "$%s %s \"%s\" {\n",
+ fprintf(stderr, "$%s %s \"%s\" {\n",
ds->comp_key->ptr, ds->op->ptr, ds->string->ptr);
array_print_indent(depth + 1);
- fprintf(stdout, "# block %d\n", ds->context_ndx);
+ fprintf(stderr, "# block %d\n", ds->context_ndx);
}
depth ++;
@@ -75,64 +75,64 @@ static void data_config_print(const data_unset *d, int depth) {
size_t j;
array_print_indent(depth);
- fprintf(stdout, "%s", du->key->ptr);
+ fprintf(stderr, "%s", du->key->ptr);
for (j = maxlen - len; j > 0; j --) {
- fprintf(stdout, " ");
+ fprintf(stderr, " ");
}
- fprintf(stdout, " = ");
+ fprintf(stderr, " = ");
du->print(du, depth);
- fprintf(stdout, "\n");
+ fprintf(stderr, "\n");
}
if (ds->childs) {
- fprintf(stdout, "\n");
+ fprintf(stderr, "\n");
for (i = 0; i < ds->childs->used; i ++) {
data_unset *du = ds->childs->data[i];
/* only the 1st block of chaining */
if (NULL == ((data_config *)du)->prev) {
- fprintf(stdout, "\n");
+ fprintf(stderr, "\n");
array_print_indent(depth);
du->print(du, depth);
- fprintf(stdout, "\n");
+ fprintf(stderr, "\n");
}
}
}
depth --;
array_print_indent(depth);
- fprintf(stdout, "}");
+ fprintf(stderr, "}");
if (0 != ds->context_ndx) {
- fprintf(stdout, " # end of $%s %s \"%s\"",
+ fprintf(stderr, " # end of $%s %s \"%s\"",
ds->comp_key->ptr, ds->op->ptr, ds->string->ptr);
}
if (ds->next) {
- fprintf(stdout, "\n");
+ fprintf(stderr, "\n");
array_print_indent(depth);
- fprintf(stdout, "else ");
+ fprintf(stderr, "else ");
ds->next->print((data_unset *)ds->next, depth);
}
}
data_config *data_config_init(void) {
data_config *ds;
-
+
ds = calloc(1, sizeof(*ds));
-
+
ds->key = buffer_init();
ds->op = buffer_init();
ds->comp_key = buffer_init();
ds->value = array_init();
ds->childs = array_init();
ds->childs->is_weakref = 1;
-
+
ds->copy = data_config_copy;
ds->free = data_config_free;
ds->reset = data_config_reset;
ds->insert_dup = data_config_insert_dup;
ds->print = data_config_print;
ds->type = TYPE_CONFIG;
-
+
return ds;
}
diff --git a/src/data_count.c b/src/data_count.c
index 8d36c8b..ca51f67 100644
--- a/src/data_count.c
+++ b/src/data_count.c
@@ -1,9 +1,9 @@
-#include "array.h"
-
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include "array.h"
+
static data_unset *data_count_copy(const data_unset *s) {
data_count *src = (data_count *)s;
data_count *ds = data_count_init();
@@ -16,53 +16,53 @@ static data_unset *data_count_copy(const data_unset *s) {
static void data_count_free(data_unset *d) {
data_count *ds = (data_count *)d;
-
+
buffer_free(ds->key);
-
+
free(d);
}
static void data_count_reset(data_unset *d) {
data_count *ds = (data_count *)d;
-
+
buffer_reset(ds->key);
-
+
ds->count = 0;
}
static int data_count_insert_dup(data_unset *dst, data_unset *src) {
data_count *ds_dst = (data_count *)dst;
data_count *ds_src = (data_count *)src;
-
+
ds_dst->count += ds_src->count;
-
+
src->free(src);
-
+
return 0;
}
static void data_count_print(const data_unset *d, int depth) {
data_count *ds = (data_count *)d;
UNUSED(depth);
-
- fprintf(stdout, "count(%d)", ds->count);
+
+ fprintf(stderr, "count(%d)", ds->count);
}
data_count *data_count_init(void) {
data_count *ds;
-
+
ds = calloc(1, sizeof(*ds));
-
+
ds->key = buffer_init();
ds->count = 1;
-
+
ds->copy = data_count_copy;
ds->free = data_count_free;
ds->reset = data_count_reset;
ds->insert_dup = data_count_insert_dup;
ds->print = data_count_print;
ds->type = TYPE_COUNT;
-
+
return ds;
}
diff --git a/src/data_fastcgi.c b/src/data_fastcgi.c
index e13a470..714b290 100644
--- a/src/data_fastcgi.c
+++ b/src/data_fastcgi.c
@@ -1,10 +1,10 @@
-#include "array.h"
-#include "fastcgi.h"
-
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include "array.h"
+#include "fastcgi.h"
+
static data_unset *data_fastcgi_copy(const data_unset *s) {
data_fastcgi *src = (data_fastcgi *)s;
data_fastcgi *ds = data_fastcgi_init();
@@ -17,53 +17,53 @@ static data_unset *data_fastcgi_copy(const data_unset *s) {
static void data_fastcgi_free(data_unset *d) {
data_fastcgi *ds = (data_fastcgi *)d;
-
+
buffer_free(ds->key);
buffer_free(ds->host);
-
+
free(d);
}
static void data_fastcgi_reset(data_unset *d) {
data_fastcgi *ds = (data_fastcgi *)d;
-
+
buffer_reset(ds->key);
buffer_reset(ds->host);
-
+
}
static int data_fastcgi_insert_dup(data_unset *dst, data_unset *src) {
UNUSED(dst);
src->free(src);
-
+
return 0;
}
static void data_fastcgi_print(const data_unset *d, int depth) {
data_fastcgi *ds = (data_fastcgi *)d;
UNUSED(depth);
-
- fprintf(stdout, "fastcgi(%s)", ds->host->ptr);
+
+ fprintf(stderr, "fastcgi(%s)", ds->host->ptr);
}
data_fastcgi *data_fastcgi_init(void) {
data_fastcgi *ds;
-
+
ds = calloc(1, sizeof(*ds));
-
+
ds->key = buffer_init();
ds->host = buffer_init();
ds->port = 0;
ds->is_disabled = 0;
-
+
ds->copy = data_fastcgi_copy;
ds->free = data_fastcgi_free;
ds->reset = data_fastcgi_reset;
ds->insert_dup = data_fastcgi_insert_dup;
ds->print = data_fastcgi_print;
ds->type = TYPE_FASTCGI;
-
+
return ds;
}
diff --git a/src/data_integer.c b/src/data_integer.c
index 63cbb10..96d1d0a 100644
--- a/src/data_integer.c
+++ b/src/data_integer.c
@@ -1,9 +1,9 @@
-#include "array.h"
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "array.h"
+
static data_unset *data_integer_copy(const data_unset *s) {
data_integer *src = (data_integer *)s;
data_integer *ds = data_integer_init();
@@ -16,15 +16,15 @@ static data_unset *data_integer_copy(const data_unset *s) {
static void data_integer_free(data_unset *d) {
data_integer *ds = (data_integer *)d;
-
+
buffer_free(ds->key);
-
+
free(d);
}
static void data_integer_reset(data_unset *d) {
data_integer *ds = (data_integer *)d;
-
+
/* reused integer elements */
buffer_reset(ds->key);
ds->value = 0;
@@ -32,9 +32,9 @@ static void data_integer_reset(data_unset *d) {
static int data_integer_insert_dup(data_unset *dst, data_unset *src) {
UNUSED(dst);
-
+
src->free(src);
-
+
return 0;
}
@@ -42,24 +42,24 @@ static void data_integer_print(const data_unset *d, int depth) {
data_integer *ds = (data_integer *)d;
UNUSED(depth);
- fprintf(stdout, "%d", ds->value);
+ fprintf(stderr, "%d", ds->value);
}
data_integer *data_integer_init(void) {
data_integer *ds;
-
+
ds = calloc(1, sizeof(*ds));
-
+
ds->key = buffer_init();
ds->value = 0;
-
+
ds->copy = data_integer_copy;
ds->free = data_integer_free;
ds->reset = data_integer_reset;
ds->insert_dup = data_integer_insert_dup;
ds->print = data_integer_print;
ds->type = TYPE_INTEGER;
-
+
return ds;
}
diff --git a/src/data_string.c b/src/data_string.c
index 7648946..d9325da 100644
--- a/src/data_string.c
+++ b/src/data_string.c
@@ -1,10 +1,10 @@
-#include "array.h"
-
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
+#include "array.h"
+
static data_unset *data_string_copy(const data_unset *s) {
data_string *src = (data_string *)s;
data_string *ds = data_string_init();
@@ -17,16 +17,16 @@ static data_unset *data_string_copy(const data_unset *s) {
static void data_string_free(data_unset *d) {
data_string *ds = (data_string *)d;
-
+
buffer_free(ds->key);
buffer_free(ds->value);
-
+
free(d);
}
static void data_string_reset(data_unset *d) {
data_string *ds = (data_string *)d;
-
+
/* reused array elements */
buffer_reset(ds->key);
buffer_reset(ds->value);
@@ -35,87 +35,70 @@ static void data_string_reset(data_unset *d) {
static int data_string_insert_dup(data_unset *dst, data_unset *src) {
data_string *ds_dst = (data_string *)dst;
data_string *ds_src = (data_string *)src;
-
+
if (ds_dst->value->used) {
- buffer_append_string_len(ds_dst->value, CONST_STR_LEN(", "));
+ buffer_append_string(ds_dst->value, ", ");
buffer_append_string_buffer(ds_dst->value, ds_src->value);
} else {
buffer_copy_string_buffer(ds_dst->value, ds_src->value);
}
-
+
src->free(src);
-
+
return 0;
}
static int data_response_insert_dup(data_unset *dst, data_unset *src) {
data_string *ds_dst = (data_string *)dst;
data_string *ds_src = (data_string *)src;
-
+
if (ds_dst->value->used) {
- buffer_append_string_len(ds_dst->value, CONST_STR_LEN("\r\n"));
+ buffer_append_string(ds_dst->value, "\r\n");
buffer_append_string_buffer(ds_dst->value, ds_dst->key);
- buffer_append_string_len(ds_dst->value, CONST_STR_LEN(": "));
+ buffer_append_string(ds_dst->value, ": ");
buffer_append_string_buffer(ds_dst->value, ds_src->value);
} else {
buffer_copy_string_buffer(ds_dst->value, ds_src->value);
}
-
+
src->free(src);
-
+
return 0;
}
static void data_string_print(const data_unset *d, int depth) {
data_string *ds = (data_string *)d;
- unsigned int i;
UNUSED(depth);
- /* empty and uninitialized strings */
- if (ds->value->used < 1) {
- fputs("\"\"", stdout);
- return;
- }
-
- /* print out the string as is, except prepend " with backslash */
- putc('"', stdout);
- for (i = 0; i < ds->value->used - 1; i++) {
- unsigned char c = ds->value->ptr[i];
- if (c == '"') {
- fputs("\\\"", stdout);
- } else {
- putc(c, stdout);
- }
- }
- putc('"', stdout);
+ fprintf(stderr, "\"%s\"", ds->value->used ? ds->value->ptr : "");
}
data_string *data_string_init(void) {
data_string *ds;
-
+
ds = calloc(1, sizeof(*ds));
assert(ds);
-
+
ds->key = buffer_init();
ds->value = buffer_init();
-
+
ds->copy = data_string_copy;
ds->free = data_string_free;
ds->reset = data_string_reset;
ds->insert_dup = data_string_insert_dup;
ds->print = data_string_print;
ds->type = TYPE_STRING;
-
+
return ds;
}
data_string *data_response_init(void) {
data_string *ds;
-
+
ds = data_string_init();
ds->insert_dup = data_response_insert_dup;
-
+
return ds;
}
diff --git a/src/etag.c b/src/etag.c
index e7e9e3f..89dfb9c 100644
--- a/src/etag.c
+++ b/src/etag.c
@@ -1,51 +1,32 @@
+#include <string.h>
+
#include "buffer.h"
#include "etag.h"
-#if defined HAVE_STDINT_H
-# include <stdint.h>
-#elif defined HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-
-#include <string.h>
-
int etag_is_equal(buffer *etag, const char *matches) {
- if (etag && !buffer_is_empty(etag) && 0 == strcmp(etag->ptr, matches)) return 1;
+ if (0 == strcmp(etag->ptr, matches)) return 1;
return 0;
}
-int etag_create(buffer *etag, struct stat *st,etag_flags_t flags) {
- if (0 == flags) return 0;
-
- buffer_reset(etag);
-
- if (flags & ETAG_USE_INODE) {
- buffer_append_off_t(etag, st->st_ino);
- buffer_append_string_len(etag, CONST_STR_LEN("-"));
- }
-
- if (flags & ETAG_USE_SIZE) {
- buffer_append_off_t(etag, st->st_size);
- buffer_append_string_len(etag, CONST_STR_LEN("-"));
- }
+int etag_create(buffer *etag, struct stat *st) {
+ buffer_copy_off_t(etag, st->st_ino);
+ buffer_append_string_len(etag, CONST_STR_LEN("-"));
+ buffer_append_off_t(etag, st->st_size);
+ buffer_append_string_len(etag, CONST_STR_LEN("-"));
+ buffer_append_long(etag, st->st_mtime);
- if (flags & ETAG_USE_MTIME) {
- buffer_append_long(etag, st->st_mtime);
- }
-
return 0;
}
int etag_mutate(buffer *mut, buffer *etag) {
- size_t i;
- uint32_t h;
-
- for (h=0, i=0; i < etag->used-1; ++i) h = (h<<5)^(h>>27)^(etag->ptr[i]);
-
+ size_t h, i;
+
+ for (h=0, i=0; i < etag->used; ++i) h = (h<<5)^(h>>27)^(etag->ptr[i]);
+
buffer_reset(mut);
buffer_copy_string_len(mut, CONST_STR_LEN("\""));
- buffer_append_off_t(mut, h);
+ buffer_append_long(mut, h);
buffer_append_string_len(mut, CONST_STR_LEN("\""));
-
+
return 0;
}
diff --git a/src/etag.h b/src/etag.h
index 97cb063..53fae00 100644
--- a/src/etag.h
+++ b/src/etag.h
@@ -1,17 +1,15 @@
#ifndef ETAG_H
#define ETAG_H
-#include "buffer.h"
-
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-typedef enum { ETAG_USE_INODE = 1, ETAG_USE_MTIME = 2, ETAG_USE_SIZE = 4 } etag_flags_t;
+#include "buffer.h"
int etag_is_equal(buffer *etag, const char *matches);
-int etag_create(buffer *etag, struct stat *st, etag_flags_t flags);
+int etag_create(buffer *etag, struct stat *st);
int etag_mutate(buffer *mut, buffer *etag);
-
+
#endif
diff --git a/src/fastcgi.h b/src/fastcgi.h
index 31c00ad..15f1dea 100644
--- a/src/fastcgi.h
+++ b/src/fastcgi.h
@@ -1,4 +1,4 @@
-/*
+/*
* fastcgi.h --
*
* Defines for the FastCGI protocol.
@@ -123,7 +123,7 @@ typedef struct {
typedef struct {
- unsigned char type;
+ unsigned char type;
unsigned char reserved[7];
} FCGI_UnknownTypeBody;
diff --git a/src/fdevent.c b/src/fdevent.c
index 0ba73b9..fdf834f 100644
--- a/src/fdevent.c
+++ b/src/fdevent.c
@@ -1,127 +1,117 @@
-#include "base.h"
-#include "log.h"
-
#include <sys/types.h>
+#include "settings.h"
+
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
-#include <assert.h>
+#include "fdevent.h"
+#include "buffer.h"
-fdevents *fdevent_init(server *srv, size_t maxfds, fdevent_handler_t type) {
+fdevents *fdevent_init(size_t maxfds, fdevent_handler_t type) {
fdevents *ev;
-
+
ev = calloc(1, sizeof(*ev));
- ev->srv = srv;
ev->fdarray = calloc(maxfds, sizeof(*ev->fdarray));
ev->maxfds = maxfds;
-
+
switch(type) {
case FDEVENT_HANDLER_POLL:
if (0 != fdevent_poll_init(ev)) {
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "event-handler poll failed");
-
+ fprintf(stderr, "%s.%d: event-handler poll failed\n",
+ __FILE__, __LINE__);
+
return NULL;
}
- return ev;
+ break;
case FDEVENT_HANDLER_SELECT:
if (0 != fdevent_select_init(ev)) {
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "event-handler select failed");
+ fprintf(stderr, "%s.%d: event-handler select failed\n",
+ __FILE__, __LINE__);
return NULL;
}
- return ev;
+ break;
+ case FDEVENT_HANDLER_LINUX_RTSIG:
+ if (0 != fdevent_linux_rtsig_init(ev)) {
+ fprintf(stderr, "%s.%d: event-handler linux-rtsig failed, try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__);
+ return NULL;
+ }
+ break;
case FDEVENT_HANDLER_LINUX_SYSEPOLL:
if (0 != fdevent_linux_sysepoll_init(ev)) {
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "event-handler linux-sysepoll failed, try to set server.event-handler = \"poll\" or \"select\"");
+ fprintf(stderr, "%s.%d: event-handler linux-sysepoll failed, try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__);
return NULL;
}
- return ev;
+ break;
case FDEVENT_HANDLER_SOLARIS_DEVPOLL:
if (0 != fdevent_solaris_devpoll_init(ev)) {
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "event-handler solaris-devpoll failed, try to set server.event-handler = \"poll\" or \"select\"");
- return NULL;
- }
- return ev;
- case FDEVENT_HANDLER_SOLARIS_PORT:
- if (0 != fdevent_solaris_port_init(ev)) {
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "event-handler solaris-eventports failed, try to set server.event-handler = \"poll\" or \"select\"");
+ fprintf(stderr, "%s.%d: event-handler solaris-devpoll failed, try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__);
return NULL;
}
- return ev;
+ break;
case FDEVENT_HANDLER_FREEBSD_KQUEUE:
if (0 != fdevent_freebsd_kqueue_init(ev)) {
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "event-handler freebsd-kqueue failed, try to set server.event-handler = \"poll\" or \"select\"");
- return NULL;
- }
- return ev;
- case FDEVENT_HANDLER_LIBEV:
- if (0 != fdevent_libev_init(ev)) {
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "event-handler libev failed, try to set server.event-handler = \"poll\" or \"select\"");
+ fprintf(stderr, "%s.%d: event-handler freebsd-kqueue failed, try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__);
return NULL;
}
- return ev;
- case FDEVENT_HANDLER_UNSET:
break;
+ default:
+ fprintf(stderr, "%s.%d: event-handler is unknown, try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__);
+ return NULL;
}
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "event-handler is unknown, try to set server.event-handler = \"poll\" or \"select\"");
- return NULL;
+ return ev;
}
void fdevent_free(fdevents *ev) {
size_t i;
if (!ev) return;
-
+
if (ev->free) ev->free(ev);
-
+
for (i = 0; i < ev->maxfds; i++) {
if (ev->fdarray[i]) free(ev->fdarray[i]);
}
-
+
free(ev->fdarray);
free(ev);
}
int fdevent_reset(fdevents *ev) {
if (ev->reset) return ev->reset(ev);
-
+
return 0;
}
-static fdnode *fdnode_init() {
+fdnode *fdnode_init() {
fdnode *fdn;
-
+
fdn = calloc(1, sizeof(*fdn));
fdn->fd = -1;
return fdn;
}
-static void fdnode_free(fdnode *fdn) {
+void fdnode_free(fdnode *fdn) {
free(fdn);
}
int fdevent_register(fdevents *ev, int fd, fdevent_handler handler, void *ctx) {
fdnode *fdn;
-
+
fdn = fdnode_init();
fdn->handler = handler;
fdn->fd = fd;
fdn->ctx = ctx;
- fdn->handler_ctx = NULL;
- fdn->events = 0;
-
+
ev->fdarray[fd] = fdn;
return 0;
@@ -129,40 +119,33 @@ int fdevent_register(fdevents *ev, int fd, fdevent_handler handler, void *ctx) {
int fdevent_unregister(fdevents *ev, int fd) {
fdnode *fdn;
-
- if (!ev) return 0;
+ if (!ev) return 0;
fdn = ev->fdarray[fd];
-
- assert(fdn->events == 0);
-
+
fdnode_free(fdn);
-
+
ev->fdarray[fd] = NULL;
-
+
return 0;
}
int fdevent_event_del(fdevents *ev, int *fde_ndx, int fd) {
int fde = fde_ndx ? *fde_ndx : -1;
-
- if (NULL == ev->fdarray[fd]) return 0;
-
+
if (ev->event_del) fde = ev->event_del(ev, fde, fd);
- ev->fdarray[fd]->events = 0;
-
+
if (fde_ndx) *fde_ndx = fde;
-
+
return 0;
}
-int fdevent_event_set(fdevents *ev, int *fde_ndx, int fd, int events) {
+int fdevent_event_add(fdevents *ev, int *fde_ndx, int fd, int events) {
int fde = fde_ndx ? *fde_ndx : -1;
-
- if (ev->event_set) fde = ev->event_set(ev, fde, fd, events);
- ev->fdarray[fd]->events = events;
-
+
+ if (ev->event_add) fde = ev->event_add(ev, fde, fd, events);
+
if (fde_ndx) *fde_ndx = fde;
-
+
return 0;
}
@@ -173,27 +156,27 @@ int fdevent_poll(fdevents *ev, int timeout_ms) {
int fdevent_event_get_revent(fdevents *ev, size_t ndx) {
if (ev->event_get_revent == NULL) SEGFAULT();
-
+
return ev->event_get_revent(ev, ndx);
}
int fdevent_event_get_fd(fdevents *ev, size_t ndx) {
if (ev->event_get_fd == NULL) SEGFAULT();
-
+
return ev->event_get_fd(ev, ndx);
}
fdevent_handler fdevent_get_handler(fdevents *ev, int fd) {
if (ev->fdarray[fd] == NULL) SEGFAULT();
if (ev->fdarray[fd]->fd != fd) SEGFAULT();
-
+
return ev->fdarray[fd]->handler;
}
void * fdevent_get_context(fdevents *ev, int fd) {
if (ev->fdarray[fd] == NULL) SEGFAULT();
if (ev->fdarray[fd]->fd != fd) SEGFAULT();
-
+
return ev->fdarray[fd]->ctx;
}
@@ -203,7 +186,7 @@ int fdevent_fcntl_set(fdevents *ev, int fd) {
fcntl(fd, F_SETFD, FD_CLOEXEC);
#endif
if ((ev) && (ev->fcntl_set)) return ev->fcntl_set(ev, fd);
-#ifdef O_NONBLOCK
+#ifdef O_NONBLOCK
return fcntl(fd, F_SETFL, O_NONBLOCK | O_RDWR);
#else
return 0;
@@ -213,7 +196,7 @@ int fdevent_fcntl_set(fdevents *ev, int fd) {
int fdevent_event_next_fdndx(fdevents *ev, int ndx) {
if (ev->event_next_fdndx) return ev->event_next_fdndx(ev, ndx);
-
+
return -1;
}
diff --git a/src/fdevent.h b/src/fdevent.h
index 9dd9a6c..0bc05ca 100644
--- a/src/fdevent.h
+++ b/src/fdevent.h
@@ -2,30 +2,34 @@
#define _FDEVENT_H_
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
#endif
-
#include "settings.h"
#include "bitset.h"
-#if defined HAVE_STDINT_H
-# include <stdint.h>
-#elif defined HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-
-#include <sys/types.h>
-
/* select event-system */
#if defined(HAVE_EPOLL_CTL) && defined(HAVE_SYS_EPOLL_H)
+# if defined HAVE_STDINT_H
+# include <stdint.h>
+# endif
# define USE_LINUX_EPOLL
+# include <sys/epoll.h>
#endif
-/* MacOS 10.3.x has poll.h under /usr/include/, all other unixes
+/* MacOS 10.3.x has poll.h under /usr/include/, all other unixes
* under /usr/include/sys/ */
#if defined HAVE_POLL && (defined(HAVE_SYS_POLL_H) || defined(HAVE_POLL_H))
# define USE_POLL
+# ifdef HAVE_POLL_H
+# include <poll.h>
+# else
+# include <sys/poll.h>
+# endif
+# if defined HAVE_SIGTIMEDWAIT && defined(__linux__)
+# define USE_LINUX_SIGIO
+# include <signal.h>
+# endif
#endif
#if defined HAVE_SELECT
@@ -40,27 +44,21 @@
#if defined HAVE_SYS_DEVPOLL_H && defined(__sun)
# define USE_SOLARIS_DEVPOLL
-#endif
-
-#if defined HAVE_PORT_H && defined HAVE_PORT_CREATE && defined(__sun)
-# define USE_SOLARIS_PORT
-# include <port.h>
+# include <sys/devpoll.h>
#endif
#if defined HAVE_SYS_EVENT_H && defined HAVE_KQUEUE
# define USE_FREEBSD_KQUEUE
+# include <sys/event.h>
#endif
-#if defined HAVE_LIBEV
-# define USE_LIBEV
+#if defined HAVE_SYS_PORT_H && defined HAVE_PORT_CREATE
+# define USE_SOLARIS_PORT
+# include <sys/port.h>
#endif
-struct server;
-typedef handler_t (*fdevent_handler)(struct server *srv, void *ctx, int revents);
-
-/* these are the POLL* values from <bits/poll.h> (linux poll)
- */
+typedef handler_t (*fdevent_handler)(void *srv, void *ctx, int revents);
#define FDEVENT_IN BV(0)
#define FDEVENT_PRI BV(1)
@@ -69,115 +67,134 @@ typedef handler_t (*fdevent_handler)(struct server *srv, void *ctx, int revents)
#define FDEVENT_HUP BV(4)
#define FDEVENT_NVAL BV(5)
-typedef enum { FD_EVENT_TYPE_UNSET = -1,
- FD_EVENT_TYPE_CONNECTION,
- FD_EVENT_TYPE_FCGI_CONNECTION,
- FD_EVENT_TYPE_DIRWATCH,
- FD_EVENT_TYPE_CGI_CONNECTION
+typedef enum { FD_EVENT_TYPE_UNSET = -1,
+ FD_EVENT_TYPE_CONNECTION,
+ FD_EVENT_TYPE_FCGI_CONNECTION,
+ FD_EVENT_TYPE_DIRWATCH,
+ FD_EVENT_TYPE_CGI_CONNECTION
} fd_event_t;
-typedef enum { FDEVENT_HANDLER_UNSET,
+typedef enum { FDEVENT_HANDLER_UNSET,
FDEVENT_HANDLER_SELECT,
FDEVENT_HANDLER_POLL,
+ FDEVENT_HANDLER_LINUX_RTSIG,
FDEVENT_HANDLER_LINUX_SYSEPOLL,
FDEVENT_HANDLER_SOLARIS_DEVPOLL,
- FDEVENT_HANDLER_SOLARIS_PORT,
FDEVENT_HANDLER_FREEBSD_KQUEUE,
- FDEVENT_HANDLER_LIBEV
+ FDEVENT_HANDLER_SOLARIS_PORT
} fdevent_handler_t;
+/**
+ * a mapping from fd to connection structure
+ *
+ */
+typedef struct {
+ int fd; /**< the fd */
+ void *conn; /**< a reference the corresponding data-structure */
+ fd_event_t fd_type; /**< type of the fd */
+ int events; /**< registered events */
+ int revents;
+} fd_conn;
+
+typedef struct {
+ fd_conn *ptr;
+
+ size_t size;
+ size_t used;
+} fd_conn_buffer;
+
+/**
+ * array of unused fd's
+ *
+ */
typedef struct _fdnode {
fdevent_handler handler;
void *ctx;
- void *handler_ctx;
int fd;
- int events;
+
+ struct _fdnode *prev, *next;
} fdnode;
-/**
- * array of unused fd's
- *
- */
-
typedef struct {
int *ptr;
-
+
size_t used;
size_t size;
} buffer_int;
/**
* fd-event handler for select(), poll() and rt-signals on Linux 2.4
- *
+ *
*/
typedef struct fdevents {
- struct server *srv;
fdevent_handler_t type;
-
+
fdnode **fdarray;
size_t maxfds;
-
+
+#ifdef USE_LINUX_SIGIO
+ int in_sigio;
+ int signum;
+ sigset_t sigset;
+ siginfo_t siginfo;
+ bitset *sigbset;
+#endif
#ifdef USE_LINUX_EPOLL
int epoll_fd;
struct epoll_event *epoll_events;
#endif
#ifdef USE_POLL
struct pollfd *pollfds;
-
+
size_t size;
size_t used;
-
+
buffer_int unused;
#endif
#ifdef USE_SELECT
fd_set select_read;
fd_set select_write;
fd_set select_error;
-
+
fd_set select_set_read;
fd_set select_set_write;
fd_set select_set_error;
-
+
int select_max_fd;
#endif
#ifdef USE_SOLARIS_DEVPOLL
int devpoll_fd;
struct pollfd *devpollfds;
#endif
-#ifdef USE_SOLARIS_PORT
- port_event_t *port_events;
-#endif
#ifdef USE_FREEBSD_KQUEUE
int kq_fd;
struct kevent *kq_results;
+ bitset *kq_bevents;
#endif
#ifdef USE_SOLARIS_PORT
int port_fd;
#endif
-#ifdef USE_LIBEV
- struct ev_loop *libev_loop;
-#endif
int (*reset)(struct fdevents *ev);
void (*free)(struct fdevents *ev);
-
- int (*event_set)(struct fdevents *ev, int fde_ndx, int fd, int events);
+
+ int (*event_add)(struct fdevents *ev, int fde_ndx, int fd, int events);
int (*event_del)(struct fdevents *ev, int fde_ndx, int fd);
int (*event_get_revent)(struct fdevents *ev, size_t ndx);
int (*event_get_fd)(struct fdevents *ev, size_t ndx);
-
+
int (*event_next_fdndx)(struct fdevents *ev, int ndx);
-
+
int (*poll)(struct fdevents *ev, int timeout_ms);
-
+
int (*fcntl_set)(struct fdevents *ev, int fd);
} fdevents;
-fdevents *fdevent_init(struct server *srv, size_t maxfds, fdevent_handler_t type);
-int fdevent_reset(fdevents *ev); /* "init" after fork() */
+fdevents *fdevent_init(size_t maxfds, fdevent_handler_t type);
+int fdevent_reset(fdevents *ev);
void fdevent_free(fdevents *ev);
-int fdevent_event_set(fdevents *ev, int *fde_ndx, int fd, int events); /* events can be FDEVENT_IN, FDEVENT_OUT or FDEVENT_IN | FDEVENT_OUT */
+int fdevent_event_add(fdevents *ev, int *fde_ndx, int fd, int events);
int fdevent_event_del(fdevents *ev, int *fde_ndx, int fd);
int fdevent_event_get_revent(fdevents *ev, size_t ndx);
int fdevent_event_get_fd(fdevents *ev, size_t ndx);
@@ -195,10 +212,11 @@ int fdevent_fcntl_set(fdevents *ev, int fd);
int fdevent_select_init(fdevents *ev);
int fdevent_poll_init(fdevents *ev);
+int fdevent_linux_rtsig_init(fdevents *ev);
int fdevent_linux_sysepoll_init(fdevents *ev);
int fdevent_solaris_devpoll_init(fdevents *ev);
-int fdevent_solaris_port_init(fdevents *ev);
int fdevent_freebsd_kqueue_init(fdevents *ev);
-int fdevent_libev_init(fdevents *ev);
#endif
+
+
diff --git a/src/fdevent_freebsd_kqueue.c b/src/fdevent_freebsd_kqueue.c
index 220e265..b955726 100644
--- a/src/fdevent_freebsd_kqueue.c
+++ b/src/fdevent_freebsd_kqueue.c
@@ -1,7 +1,3 @@
-#include "fdevent.h"
-#include "buffer.h"
-#include "log.h"
-
#include <sys/types.h>
#include <unistd.h>
@@ -12,97 +8,81 @@
#include <signal.h>
#include <fcntl.h>
+#include "fdevent.h"
+#include "settings.h"
+#include "buffer.h"
+#include "server.h"
+
#ifdef USE_FREEBSD_KQUEUE
-# include <sys/event.h>
-# include <sys/time.h>
+#include <sys/event.h>
+#include <sys/time.h>
static void fdevent_freebsd_kqueue_free(fdevents *ev) {
close(ev->kq_fd);
free(ev->kq_results);
+ bitset_free(ev->kq_bevents);
}
static int fdevent_freebsd_kqueue_event_del(fdevents *ev, int fde_ndx, int fd) {
- int ret, n = 0;
- struct kevent kev[2];
+ int filter, ret;
+ struct kevent kev;
struct timespec ts;
- int oevents;
if (fde_ndx < 0) return -1;
- oevents = ev->fdarray[fd]->events;
+ filter = bitset_test_bit(ev->kq_bevents, fd) ? EVFILT_READ : EVFILT_WRITE;
- if (oevents & FDEVENT_IN) {
- EV_SET(&kev[n], fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
- n++;
- }
- if (oevents & FDEVENT_OUT) {
- EV_SET(&kev[n], fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
- n++;
- }
-
- if (0 == n) return -1;
+ EV_SET(&kev, fd, filter, EV_DELETE, 0, 0, NULL);
ts.tv_sec = 0;
ts.tv_nsec = 0;
ret = kevent(ev->kq_fd,
- &kev, n,
- NULL, 0,
- &ts);
+ &kev, 1,
+ NULL, 0,
+ &ts);
if (ret == -1) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SS",
- "kqueue event delete failed: ", strerror(errno));
+ fprintf(stderr, "%s.%d: kqueue failed polling: %s\n",
+ __FILE__, __LINE__, strerror(errno));
return -1;
}
-
+
return -1;
}
-static int fdevent_freebsd_kqueue_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
- int ret, n = 0;
- struct kevent kev[2];
+static int fdevent_freebsd_kqueue_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
+ int filter, ret;
+ struct kevent kev;
struct timespec ts;
- int oevents = ev->fdarray[fd]->events;
- int addevents = events & ~oevents;
- int delevents = ~events & oevents;
UNUSED(fde_ndx);
- if (events == oevents) return fd;
+ filter = (events & FDEVENT_IN) ? EVFILT_READ : EVFILT_WRITE;
- if (addevents & FDEVENT_IN) {
- EV_SET(&kev[n], fd, EVFILT_READ, EV_ADD|EV_CLEAR, 0, 0, NULL);
- n++;
- } else if (delevents & FDEVENT_IN) {
- EV_SET(&kev[n], fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
- n++;
- }
- if (addevents & FDEVENT_OUT) {
- EV_SET(&kev[n], fd, EVFILT_WRITE, EV_ADD|EV_CLEAR, 0, 0, NULL);
- n++;
- } else if (delevents & FDEVENT_OUT) {
- EV_SET(&kev[n], fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
- n++;
- }
-
- if (0 == n) return fd;
+ EV_SET(&kev, fd, filter, EV_ADD|EV_CLEAR, 0, 0, NULL);
ts.tv_sec = 0;
ts.tv_nsec = 0;
-
+
ret = kevent(ev->kq_fd,
- kev, n,
- NULL, 0,
- &ts);
+ &kev, 1,
+ NULL, 0,
+ &ts);
if (ret == -1) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SS",
- "kqueue event set failed: ", strerror(errno));
+ fprintf(stderr, "%s.%d: kqueue failed polling: %s\n",
+ __FILE__, __LINE__, strerror(errno));
return -1;
}
+
+ if (filter == EVFILT_READ) {
+ bitset_set_bit(ev->kq_bevents, fd);
+ } else {
+ bitset_clear_bit(ev->kq_bevents, fd);
+ }
return fd;
}
@@ -115,9 +95,9 @@ static int fdevent_freebsd_kqueue_poll(fdevents *ev, int timeout_ms) {
ts.tv_nsec = (timeout_ms % 1000) * 1000000;
ret = kevent(ev->kq_fd,
- NULL, 0,
- ev->kq_results, ev->maxfds,
- &ts);
+ NULL, 0,
+ ev->kq_results, ev->maxfds,
+ &ts);
if (ret == -1) {
switch(errno) {
@@ -125,8 +105,8 @@ static int fdevent_freebsd_kqueue_poll(fdevents *ev, int timeout_ms) {
/* we got interrupted, perhaps just a SIGCHLD of a CGI script */
return 0;
default:
- log_error_write(ev->srv, __FILE__, __LINE__, "SS",
- "kqueue failed polling: ", strerror(errno));
+ fprintf(stderr, "%s.%d: kqueue failed polling: %s\n",
+ __FILE__, __LINE__, strerror(errno));
break;
}
}
@@ -144,7 +124,7 @@ static int fdevent_freebsd_kqueue_event_get_revent(fdevents *ev, size_t ndx) {
} else if (e == EVFILT_WRITE) {
events |= FDEVENT_OUT;
}
-
+
e = ev->kq_results[ndx].flags;
if (e & EV_EOF) {
@@ -170,12 +150,12 @@ static int fdevent_freebsd_kqueue_event_next_fdndx(fdevents *ev, int ndx) {
static int fdevent_freebsd_kqueue_reset(fdevents *ev) {
if (-1 == (ev->kq_fd = kqueue())) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "kqueue failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
-
+ fprintf(stderr, "%s.%d: kqueue failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__, strerror(errno));
+
return -1;
}
-
+
return 0;
}
@@ -190,7 +170,7 @@ int fdevent_freebsd_kqueue_init(fdevents *ev) {
SET(reset);
SET(event_del);
- SET(event_set);
+ SET(event_add);
SET(event_next_fdndx);
SET(event_get_fd);
@@ -199,13 +179,14 @@ int fdevent_freebsd_kqueue_init(fdevents *ev) {
ev->kq_fd = -1;
ev->kq_results = calloc(ev->maxfds, sizeof(*ev->kq_results));
+ ev->kq_bevents = bitset_init(ev->maxfds);
/* check that kqueue works */
if (-1 == (ev->kq_fd = kqueue())) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "kqueue failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
-
+ fprintf(stderr, "%s.%d: kqueue failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__, strerror(errno));
+
return -1;
}
@@ -218,8 +199,8 @@ int fdevent_freebsd_kqueue_init(fdevents *ev) {
int fdevent_freebsd_kqueue_init(fdevents *ev) {
UNUSED(ev);
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "kqueue not available, try to set server.event-handler = \"poll\" or \"select\"");
+ fprintf(stderr, "%s.%d: kqueue not available, try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__);
return -1;
}
diff --git a/src/fdevent_libev.c b/src/fdevent_libev.c
deleted file mode 100644
index de62676..0000000
--- a/src/fdevent_libev.c
+++ /dev/null
@@ -1,171 +0,0 @@
-#include "fdevent.h"
-#include "buffer.h"
-#include "log.h"
-
-#include <assert.h>
-
-#ifdef USE_LIBEV
-
-# include <ev.h>
-
-static void io_watcher_cb(struct ev_loop *loop, ev_io *w, int revents) {
- fdevents *ev = w->data;
- fdnode *fdn = ev->fdarray[w->fd];
- int r = 0;
- UNUSED(loop);
-
- if (revents & EV_READ) r |= FDEVENT_IN;
- if (revents & EV_WRITE) r |= FDEVENT_OUT;
- if (revents & EV_ERROR) r |= FDEVENT_ERR;
-
- switch (r = (*fdn->handler)(ev->srv, fdn->ctx, r)) {
- case HANDLER_FINISHED:
- case HANDLER_GO_ON:
- case HANDLER_WAIT_FOR_EVENT:
- case HANDLER_WAIT_FOR_FD:
- break;
- case HANDLER_ERROR:
- /* should never happen */
- SEGFAULT();
- break;
- default:
- log_error_write(ev->srv, __FILE__, __LINE__, "d", r);
- break;
- }
-}
-
-static void fdevent_libev_free(fdevents *ev) {
- UNUSED(ev);
-}
-
-static int fdevent_libev_event_del(fdevents *ev, int fde_ndx, int fd) {
- fdnode *fdn;
- ev_io *watcher;
-
- if (-1 == fde_ndx) return -1;
-
- fdn = ev->fdarray[fd];
- watcher = fdn->handler_ctx;
-
- if (!watcher) return -1;
-
- ev_io_stop(ev->libev_loop, watcher);
- free(watcher);
- fdn->handler_ctx = NULL;
-
- return -1;
-}
-
-static int fdevent_libev_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
- fdnode *fdn = ev->fdarray[fd];
- ev_io *watcher = fdn->handler_ctx;
- int ev_events = 0;
- UNUSED(fde_ndx);
-
- if (events & FDEVENT_IN) ev_events |= EV_READ;
- if (events & FDEVENT_OUT) ev_events |= EV_WRITE;
-
- if (!watcher) {
- fdn->handler_ctx = watcher = calloc(1, sizeof(ev_io));
- assert(watcher);
-
- ev_io_init(watcher, io_watcher_cb, fd, ev_events);
- watcher->data = ev;
- ev_io_start(ev->libev_loop, watcher);
- } else {
- if ((watcher->events & (EV_READ | EV_WRITE)) != ev_events) {
- ev_io_stop(ev->libev_loop, watcher);
- ev_io_set(watcher, watcher->fd, ev_events);
- ev_io_start(ev->libev_loop, watcher);
- }
- }
-
- return fd;
-}
-
-static void timeout_watcher_cb(struct ev_loop *loop, ev_timer *w, int revents) {
- UNUSED(loop);
- UNUSED(w);
- UNUSED(revents);
-}
-
-
-static int fdevent_libev_poll(fdevents *ev, int timeout_ms) {
- ev_timer timeout_watcher;
-
- ev_init(&timeout_watcher, timeout_watcher_cb);
- ev_timer_set(&timeout_watcher, ((ev_tstamp) timeout_ms)/1000.0, 0.0);
- ev_timer_start(ev->libev_loop, &timeout_watcher);
-
- ev_loop(ev->libev_loop, EVLOOP_ONESHOT);
-
- ev_timer_stop(ev->libev_loop, &timeout_watcher);
-
- return 0;
-}
-
-static int fdevent_libev_event_get_revent(fdevents *ev, size_t ndx) {
- UNUSED(ev);
- UNUSED(ndx);
-
- return 0;
-}
-
-static int fdevent_libev_event_get_fd(fdevents *ev, size_t ndx) {
- UNUSED(ev);
- UNUSED(ndx);
-
- return -1;
-}
-
-static int fdevent_libev_event_next_fdndx(fdevents *ev, int ndx) {
- UNUSED(ev);
- UNUSED(ndx);
-
- return -1;
-}
-
-static int fdevent_libev_reset(fdevents *ev) {
- UNUSED(ev);
-
- ev_default_fork();
-
- return 0;
-}
-
-int fdevent_libev_init(fdevents *ev) {
- ev->type = FDEVENT_HANDLER_LIBEV;
-#define SET(x) \
- ev->x = fdevent_libev_##x;
-
- SET(free);
- SET(poll);
- SET(reset);
-
- SET(event_del);
- SET(event_set);
-
- SET(event_next_fdndx);
- SET(event_get_fd);
- SET(event_get_revent);
-
- if (NULL == (ev->libev_loop = ev_default_loop(0))) {
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "ev_default_loop failed , try to set server.event-handler = \"poll\" or \"select\"");
-
- return -1;
- }
-
- return 0;
-}
-
-#else
-int fdevent_libev_init(fdevents *ev) {
- UNUSED(ev);
-
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "libev not supported, try to set server.event-handler = \"poll\" or \"select\"");
-
- return -1;
-}
-#endif
diff --git a/src/fdevent_linux_rtsig.c b/src/fdevent_linux_rtsig.c
new file mode 100644
index 0000000..dcefff8
--- /dev/null
+++ b/src/fdevent_linux_rtsig.c
@@ -0,0 +1,260 @@
+#include <sys/types.h>
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+#include <limits.h>
+
+#define __USE_GNU
+#include <fcntl.h>
+
+#include "fdevent.h"
+#include "settings.h"
+#include "buffer.h"
+
+#ifdef USE_LINUX_SIGIO
+static void fdevent_linux_rtsig_free(fdevents *ev) {
+ free(ev->pollfds);
+ if (ev->unused.ptr) free(ev->unused.ptr);
+
+ bitset_free(ev->sigbset);
+}
+
+
+static int fdevent_linux_rtsig_event_del(fdevents *ev, int fde_ndx, int fd) {
+ if (fde_ndx < 0) return -1;
+
+ if ((size_t)fde_ndx >= ev->used) {
+ fprintf(stderr, "%s.%d: del! out of range %d %zu\n", __FILE__, __LINE__, fde_ndx, ev->used);
+ SEGFAULT();
+ }
+
+ if (ev->pollfds[fde_ndx].fd == fd) {
+ size_t k = fde_ndx;
+
+ ev->pollfds[k].fd = -1;
+
+ bitset_clear_bit(ev->sigbset, fd);
+
+ if (ev->unused.size == 0) {
+ ev->unused.size = 16;
+ ev->unused.ptr = malloc(sizeof(*(ev->unused.ptr)) * ev->unused.size);
+ } else if (ev->unused.size == ev->unused.used) {
+ ev->unused.size += 16;
+ ev->unused.ptr = realloc(ev->unused.ptr, sizeof(*(ev->unused.ptr)) * ev->unused.size);
+ }
+
+ ev->unused.ptr[ev->unused.used++] = k;
+ } else {
+ fprintf(stderr, "%s.%d: del! %d %d\n", __FILE__, __LINE__, ev->pollfds[fde_ndx].fd, fd);
+
+ SEGFAULT();
+ }
+
+ return -1;
+}
+
+#if 0
+static int fdevent_linux_rtsig_event_compress(fdevents *ev) {
+ size_t j;
+
+ if (ev->used == 0) return 0;
+ if (ev->unused.used != 0) return 0;
+
+ for (j = ev->used - 1; j + 1 > 0; j--) {
+ if (ev->pollfds[j].fd == -1) ev->used--;
+ }
+
+
+ return 0;
+}
+#endif
+
+static int fdevent_linux_rtsig_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
+ /* known index */
+ if (fde_ndx != -1) {
+ if (ev->pollfds[fde_ndx].fd == fd) {
+ ev->pollfds[fde_ndx].events = events;
+
+ return fde_ndx;
+ }
+ fprintf(stderr, "%s.%d: add: (%d, %d)\n", __FILE__, __LINE__, fde_ndx, ev->pollfds[fde_ndx].fd);
+ SEGFAULT();
+ }
+
+ if (ev->unused.used > 0) {
+ int k = ev->unused.ptr[--ev->unused.used];
+
+ ev->pollfds[k].fd = fd;
+ ev->pollfds[k].events = events;
+
+ bitset_set_bit(ev->sigbset, fd);
+
+ return k;
+ } else {
+ if (ev->size == 0) {
+ ev->size = 16;
+ ev->pollfds = malloc(sizeof(*ev->pollfds) * ev->size);
+ } else if (ev->size == ev->used) {
+ ev->size += 16;
+ ev->pollfds = realloc(ev->pollfds, sizeof(*ev->pollfds) * ev->size);
+ }
+
+ ev->pollfds[ev->used].fd = fd;
+ ev->pollfds[ev->used].events = events;
+
+ bitset_set_bit(ev->sigbset, fd);
+
+ return ev->used++;
+ }
+}
+
+static int fdevent_linux_rtsig_poll(fdevents *ev, int timeout_ms) {
+ struct timespec ts;
+ int r;
+
+#if 0
+ fdevent_linux_rtsig_event_compress(ev);
+#endif
+
+ ev->in_sigio = 1;
+
+ ts.tv_sec = timeout_ms / 1000;
+ ts.tv_nsec = (timeout_ms % 1000) * 1000000;
+ r = sigtimedwait(&(ev->sigset), &(ev->siginfo), &(ts));
+
+ if (r == -1) {
+ if (errno == EAGAIN) return 0;
+ return r;
+ } else if (r == SIGIO) {
+ struct sigaction act;
+
+ /* flush the signal queue */
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = SIG_IGN;
+ sigaction(ev->signum, &act, NULL);
+
+ /* re-enable the signal queue */
+ act.sa_handler = SIG_DFL;
+ sigaction(ev->signum, &act, NULL);
+
+ ev->in_sigio = 0;
+ r = poll(ev->pollfds, ev->used, timeout_ms);
+
+ return r;
+ } else if (r == ev->signum) {
+# if 0
+ fprintf(stderr, "event: %d %02lx\n", ev->siginfo.si_fd, ev->siginfo.si_band);
+# endif
+ return bitset_test_bit(ev->sigbset, ev->siginfo.si_fd);
+ } else {
+ /* ? */
+ return -1;
+ }
+}
+
+static int fdevent_linux_rtsig_event_get_revent(fdevents *ev, size_t ndx) {
+ if (ev->in_sigio == 1) {
+# if 0
+ if (ev->siginfo.si_band == POLLERR) {
+ fprintf(stderr, "event: %d %02lx %02x %s\n", ev->siginfo.si_fd, ev->siginfo.si_band, errno, strerror(errno));
+ }
+# endif
+ if (ndx != 0) {
+ fprintf(stderr, "+\n");
+ return 0;
+ }
+
+ return ev->siginfo.si_band & 0x3f;
+ } else {
+ if (ndx >= ev->used) {
+ fprintf(stderr, "%s.%d: event: %zu %zu\n", __FILE__, __LINE__, ndx, ev->used);
+ return 0;
+ }
+ return ev->pollfds[ndx].revents;
+ }
+}
+
+static int fdevent_linux_rtsig_event_get_fd(fdevents *ev, size_t ndx) {
+ if (ev->in_sigio == 1) {
+ return ev->siginfo.si_fd;
+ } else {
+ return ev->pollfds[ndx].fd;
+ }
+}
+
+static int fdevent_linux_rtsig_fcntl_set(fdevents *ev, int fd) {
+ static pid_t pid = 0;
+
+ if (pid == 0) pid = getpid();
+
+ if (-1 == fcntl(fd, F_SETSIG, ev->signum)) return -1;
+
+ if (-1 == fcntl(fd, F_SETOWN, (int) pid)) return -1;
+
+ return fcntl(fd, F_SETFL, O_ASYNC | O_NONBLOCK | O_RDWR);
+}
+
+
+static int fdevent_linux_rtsig_event_next_fdndx(fdevents *ev, int ndx) {
+ if (ev->in_sigio == 1) {
+ if (ndx < 0) return 0;
+ return -1;
+ } else {
+ size_t i;
+
+ i = (ndx < 0) ? 0 : ndx + 1;
+ for (; i < ev->used; i++) {
+ if (ev->pollfds[i].revents) break;
+ }
+
+ return i;
+ }
+}
+
+int fdevent_linux_rtsig_init(fdevents *ev) {
+ ev->type = FDEVENT_HANDLER_LINUX_RTSIG;
+#define SET(x) \
+ ev->x = fdevent_linux_rtsig_##x;
+
+ SET(free);
+ SET(poll);
+
+ SET(event_del);
+ SET(event_add);
+
+ SET(event_next_fdndx);
+ SET(fcntl_set);
+ SET(event_get_fd);
+ SET(event_get_revent);
+
+ ev->signum = SIGRTMIN + 1;
+
+ sigemptyset(&(ev->sigset));
+ sigaddset(&(ev->sigset), ev->signum);
+ sigaddset(&(ev->sigset), SIGIO);
+ if (-1 == sigprocmask(SIG_BLOCK, &(ev->sigset), NULL)) {
+ fprintf(stderr, "%s.%d: sigprocmask failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__, strerror(errno));
+
+ return -1;
+ }
+
+ ev->in_sigio = 1;
+
+ ev->sigbset = bitset_init(ev->maxfds);
+
+ return 0;
+}
+#else
+int fdevent_linux_rtsig_init(fdevents *ev) {
+ UNUSED(ev);
+
+ fprintf(stderr, "%s.%d: linux-rtsig not supported, try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__);
+ return -1;
+}
+#endif
diff --git a/src/fdevent_linux_sysepoll.c b/src/fdevent_linux_sysepoll.c
index f761ed6..31caabd 100644
--- a/src/fdevent_linux_sysepoll.c
+++ b/src/fdevent_linux_sysepoll.c
@@ -1,7 +1,3 @@
-#include "fdevent.h"
-#include "buffer.h"
-#include "log.h"
-
#include <sys/types.h>
#include <unistd.h>
@@ -12,10 +8,11 @@
#include <signal.h>
#include <fcntl.h>
-#ifdef USE_LINUX_EPOLL
-
-# include <sys/epoll.h>
+#include "fdevent.h"
+#include "settings.h"
+#include "buffer.h"
+#ifdef USE_LINUX_EPOLL
static void fdevent_linux_sysepoll_free(fdevents *ev) {
close(ev->epoll_fd);
free(ev->epoll_events);
@@ -23,37 +20,36 @@ static void fdevent_linux_sysepoll_free(fdevents *ev) {
static int fdevent_linux_sysepoll_event_del(fdevents *ev, int fde_ndx, int fd) {
struct epoll_event ep;
-
+
if (fde_ndx < 0) return -1;
-
+
memset(&ep, 0, sizeof(ep));
-
+
ep.data.fd = fd;
ep.data.ptr = NULL;
-
+
if (0 != epoll_ctl(ev->epoll_fd, EPOLL_CTL_DEL, fd, &ep)) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "epoll_ctl failed: ", strerror(errno), ", dying");
-
+ fprintf(stderr, "%s.%d: epoll_ctl failed: %s, dying\n", __FILE__, __LINE__, strerror(errno));
+
SEGFAULT();
-
+
return 0;
}
-
-
+
+
return -1;
}
-static int fdevent_linux_sysepoll_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
+static int fdevent_linux_sysepoll_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
struct epoll_event ep;
int add = 0;
-
+
if (fde_ndx == -1) add = 1;
-
+
memset(&ep, 0, sizeof(ep));
-
+
ep.events = 0;
-
+
if (events & FDEVENT_IN) ep.events |= EPOLLIN;
if (events & FDEVENT_OUT) ep.events |= EPOLLOUT;
@@ -64,21 +60,20 @@ static int fdevent_linux_sysepoll_event_set(fdevents *ev, int fde_ndx, int fd, i
* sent.
*
*/
-
+
ep.events |= EPOLLERR | EPOLLHUP /* | EPOLLET */;
-
+
ep.data.ptr = NULL;
ep.data.fd = fd;
-
+
if (0 != epoll_ctl(ev->epoll_fd, add ? EPOLL_CTL_ADD : EPOLL_CTL_MOD, fd, &ep)) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "epoll_ctl failed: ", strerror(errno), ", dying");
-
+ fprintf(stderr, "%s.%d: epoll_ctl failed: %s, dying\n", __FILE__, __LINE__, strerror(errno));
+
SEGFAULT();
-
+
return 0;
}
-
+
return fd;
}
@@ -88,33 +83,32 @@ static int fdevent_linux_sysepoll_poll(fdevents *ev, int timeout_ms) {
static int fdevent_linux_sysepoll_event_get_revent(fdevents *ev, size_t ndx) {
int events = 0, e;
-
+
e = ev->epoll_events[ndx].events;
if (e & EPOLLIN) events |= FDEVENT_IN;
if (e & EPOLLOUT) events |= FDEVENT_OUT;
if (e & EPOLLERR) events |= FDEVENT_ERR;
if (e & EPOLLHUP) events |= FDEVENT_HUP;
if (e & EPOLLPRI) events |= FDEVENT_PRI;
-
- return events;
+
+ return e;
}
static int fdevent_linux_sysepoll_event_get_fd(fdevents *ev, size_t ndx) {
# if 0
- log_error_write(ev->srv, __FILE__, __LINE__, "SD, D",
- "fdevent_linux_sysepoll_event_get_fd: ", (int) ndx, ev->epoll_events[ndx].data.fd);
+ fprintf(stderr, "%s.%d: %d, %d\n", __FILE__, __LINE__, ndx, ev->epoll_events[ndx].data.fd);
# endif
-
+
return ev->epoll_events[ndx].data.fd;
}
static int fdevent_linux_sysepoll_event_next_fdndx(fdevents *ev, int ndx) {
size_t i;
-
+
UNUSED(ev);
i = (ndx < 0) ? 0 : ndx + 1;
-
+
return i;
}
@@ -122,27 +116,27 @@ int fdevent_linux_sysepoll_init(fdevents *ev) {
ev->type = FDEVENT_HANDLER_LINUX_SYSEPOLL;
#define SET(x) \
ev->x = fdevent_linux_sysepoll_##x;
-
+
SET(free);
SET(poll);
-
+
SET(event_del);
- SET(event_set);
-
+ SET(event_add);
+
SET(event_next_fdndx);
SET(event_get_fd);
SET(event_get_revent);
-
+
if (-1 == (ev->epoll_fd = epoll_create(ev->maxfds))) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "epoll_create failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
+ fprintf(stderr, "%s.%d: epoll_create failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__, strerror(errno));
return -1;
}
if (-1 == fcntl(ev->epoll_fd, F_SETFD, FD_CLOEXEC)) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "fcntl on epoll-fd failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
+ fprintf(stderr, "%s.%d: epoll_create failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__, strerror(errno));
close(ev->epoll_fd);
@@ -158,9 +152,9 @@ int fdevent_linux_sysepoll_init(fdevents *ev) {
int fdevent_linux_sysepoll_init(fdevents *ev) {
UNUSED(ev);
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "linux-sysepoll not supported, try to set server.event-handler = \"poll\" or \"select\"");
-
+ fprintf(stderr, "%s.%d: linux-sysepoll not supported, try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__);
+
return -1;
}
#endif
diff --git a/src/fdevent_poll.c b/src/fdevent_poll.c
index e8dc385..7d8017a 100644
--- a/src/fdevent_poll.c
+++ b/src/fdevent_poll.c
@@ -1,7 +1,3 @@
-#include "fdevent.h"
-#include "buffer.h"
-#include "log.h"
-
#include <sys/types.h>
#include <unistd.h>
@@ -12,14 +8,11 @@
#include <signal.h>
#include <fcntl.h>
-#ifdef USE_POLL
-
-# ifdef HAVE_POLL_H
-# include <poll.h>
-# else
-# include <sys/poll.h>
-# endif
+#include "fdevent.h"
+#include "settings.h"
+#include "buffer.h"
+#ifdef USE_POLL
static void fdevent_poll_free(fdevents *ev) {
free(ev->pollfds);
if (ev->unused.ptr) free(ev->unused.ptr);
@@ -27,20 +20,19 @@ static void fdevent_poll_free(fdevents *ev) {
static int fdevent_poll_event_del(fdevents *ev, int fde_ndx, int fd) {
if (fde_ndx < 0) return -1;
-
+
if ((size_t)fde_ndx >= ev->used) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SdD",
- "del! out of range ", fde_ndx, (int) ev->used);
+ fprintf(stderr, "%s.%d: del! out of range %d %zd\n", __FILE__, __LINE__, fde_ndx, ev->used);
SEGFAULT();
}
-
+
if (ev->pollfds[fde_ndx].fd == fd) {
size_t k = fde_ndx;
-
+
ev->pollfds[k].fd = -1;
/* ev->pollfds[k].events = 0; */
/* ev->pollfds[k].revents = 0; */
-
+
if (ev->unused.size == 0) {
ev->unused.size = 16;
ev->unused.ptr = malloc(sizeof(*(ev->unused.ptr)) * ev->unused.size);
@@ -48,55 +40,47 @@ static int fdevent_poll_event_del(fdevents *ev, int fde_ndx, int fd) {
ev->unused.size += 16;
ev->unused.ptr = realloc(ev->unused.ptr, sizeof(*(ev->unused.ptr)) * ev->unused.size);
}
-
+
ev->unused.ptr[ev->unused.used++] = k;
} else {
- log_error_write(ev->srv, __FILE__, __LINE__, "SdD",
- "del! ", ev->pollfds[fde_ndx].fd, fd);
-
SEGFAULT();
}
-
+
return -1;
}
#if 0
static int fdevent_poll_event_compress(fdevents *ev) {
size_t j;
-
+
if (ev->used == 0) return 0;
if (ev->unused.used != 0) return 0;
-
+
for (j = ev->used - 1; j + 1 > 0 && ev->pollfds[j].fd == -1; j--) ev->used--;
-
+
return 0;
}
#endif
-static int fdevent_poll_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
- int pevents = 0;
- if (events & FDEVENT_IN) pevents |= POLLIN;
- if (events & FDEVENT_OUT) pevents |= POLLOUT;
-
+static int fdevent_poll_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
/* known index */
-
+
if (fde_ndx != -1) {
if (ev->pollfds[fde_ndx].fd == fd) {
- ev->pollfds[fde_ndx].events = pevents;
-
+ ev->pollfds[fde_ndx].events = events;
+
return fde_ndx;
}
- log_error_write(ev->srv, __FILE__, __LINE__, "SdD",
- "set: ", fde_ndx, ev->pollfds[fde_ndx].fd);
+ fprintf(stderr, "%s.%d: add: (%d, %d)\n", __FILE__, __LINE__, fde_ndx, ev->pollfds[fde_ndx].fd);
SEGFAULT();
}
-
+
if (ev->unused.used > 0) {
int k = ev->unused.ptr[--ev->unused.used];
-
+
ev->pollfds[k].fd = fd;
- ev->pollfds[k].events = pevents;
-
+ ev->pollfds[k].events = events;
+
return k;
} else {
if (ev->size == 0) {
@@ -106,10 +90,10 @@ static int fdevent_poll_event_set(fdevents *ev, int fde_ndx, int fd, int events)
ev->size += 16;
ev->pollfds = realloc(ev->pollfds, sizeof(*ev->pollfds) * ev->size);
}
-
+
ev->pollfds[ev->used].fd = fd;
- ev->pollfds[ev->used].events = pevents;
-
+ ev->pollfds[ev->used].events = events;
+
return ev->used++;
}
}
@@ -123,16 +107,14 @@ static int fdevent_poll_poll(fdevents *ev, int timeout_ms) {
static int fdevent_poll_event_get_revent(fdevents *ev, size_t ndx) {
int r, poll_r;
-
if (ndx >= ev->used) {
- log_error_write(ev->srv, __FILE__, __LINE__, "sii",
- "dying because: event: ", (int) ndx, (int) ev->used);
-
+ fprintf(stderr, "%s.%d: dying because: event: %zd >= %zd\n", __FILE__, __LINE__, ndx, ev->used);
+
SEGFAULT();
-
+
return 0;
}
-
+
if (ev->pollfds[ndx].revents & POLLNVAL) {
/* should never happen */
SEGFAULT();
@@ -141,7 +123,7 @@ static int fdevent_poll_event_get_revent(fdevents *ev, size_t ndx) {
r = 0;
poll_r = ev->pollfds[ndx].revents;
- /* map POLL* to FDEVEN_*; they are probably the same, but still. */
+ /* map POLL* to FDEVEN_* */
if (poll_r & POLLIN) r |= FDEVENT_IN;
if (poll_r & POLLOUT) r |= FDEVENT_OUT;
@@ -149,8 +131,8 @@ static int fdevent_poll_event_get_revent(fdevents *ev, size_t ndx) {
if (poll_r & POLLHUP) r |= FDEVENT_HUP;
if (poll_r & POLLNVAL) r |= FDEVENT_NVAL;
if (poll_r & POLLPRI) r |= FDEVENT_PRI;
-
- return r;
+
+ return ev->pollfds[ndx].revents;
}
static int fdevent_poll_event_get_fd(fdevents *ev, size_t ndx) {
@@ -159,30 +141,30 @@ static int fdevent_poll_event_get_fd(fdevents *ev, size_t ndx) {
static int fdevent_poll_event_next_fdndx(fdevents *ev, int ndx) {
size_t i;
-
+
i = (ndx < 0) ? 0 : ndx + 1;
for (; i < ev->used; i++) {
- if (ev->pollfds[i].revents) return i;
+ if (ev->pollfds[i].revents) break;
}
-
- return -1;
+
+ return i;
}
int fdevent_poll_init(fdevents *ev) {
ev->type = FDEVENT_HANDLER_POLL;
#define SET(x) \
ev->x = fdevent_poll_##x;
-
+
SET(free);
SET(poll);
-
+
SET(event_del);
- SET(event_set);
-
+ SET(event_add);
+
SET(event_next_fdndx);
SET(event_get_fd);
SET(event_get_revent);
-
+
return 0;
}
@@ -193,9 +175,8 @@ int fdevent_poll_init(fdevents *ev) {
int fdevent_poll_init(fdevents *ev) {
UNUSED(ev);
- log_error_write(srv, __FILE__, __LINE__,
- "s", "poll is not supported, try to set server.event-handler = \"select\"");
-
+ fprintf(stderr, "%s.%d: poll is not supported, try to set server.event-handler = \"select\"\n",
+ __FILE__, __LINE__);
return -1;
}
#endif
diff --git a/src/fdevent_select.c b/src/fdevent_select.c
index 2e23dce..3eb10f3 100644
--- a/src/fdevent_select.c
+++ b/src/fdevent_select.c
@@ -1,7 +1,3 @@
-#include "fdevent.h"
-#include "buffer.h"
-#include "log.h"
-
#include <sys/time.h>
#include <sys/types.h>
@@ -13,6 +9,10 @@
#include <fcntl.h>
#include <assert.h>
+#include "fdevent.h"
+#include "settings.h"
+#include "buffer.h"
+
#ifdef USE_SELECT
static int fdevent_select_reset(fdevents *ev) {
@@ -34,45 +34,43 @@ static int fdevent_select_event_del(fdevents *ev, int fde_ndx, int fd) {
return -1;
}
-static int fdevent_select_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
+static int fdevent_select_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
UNUSED(fde_ndx);
/* we should be protected by max-fds, but you never know */
- assert(fd < ((int)FD_SETSIZE));
+ assert(fd < FD_SETSIZE);
if (events & FDEVENT_IN) {
FD_SET(fd, &(ev->select_set_read));
- } else {
- FD_CLR(fd, &(ev->select_set_read));
+ FD_CLR(fd, &(ev->select_set_write));
}
if (events & FDEVENT_OUT) {
+ FD_CLR(fd, &(ev->select_set_read));
FD_SET(fd, &(ev->select_set_write));
- } else {
- FD_CLR(fd, &(ev->select_set_write));
}
FD_SET(fd, &(ev->select_set_error));
-
+
if (fd > ev->select_max_fd) ev->select_max_fd = fd;
-
+
return fd;
}
static int fdevent_select_poll(fdevents *ev, int timeout_ms) {
struct timeval tv;
-
+
tv.tv_sec = timeout_ms / 1000;
tv.tv_usec = (timeout_ms % 1000) * 1000;
-
+
ev->select_read = ev->select_set_read;
ev->select_write = ev->select_set_write;
ev->select_error = ev->select_set_error;
-
+
return select(ev->select_max_fd + 1, &(ev->select_read), &(ev->select_write), &(ev->select_error), &tv);
}
static int fdevent_select_event_get_revent(fdevents *ev, size_t ndx) {
int revents = 0;
-
+
if (FD_ISSET(ndx, &(ev->select_read))) {
revents |= FDEVENT_IN;
}
@@ -82,7 +80,7 @@ static int fdevent_select_event_get_revent(fdevents *ev, size_t ndx) {
if (FD_ISSET(ndx, &(ev->select_error))) {
revents |= FDEVENT_ERR;
}
-
+
return revents;
}
@@ -94,33 +92,33 @@ static int fdevent_select_event_get_fd(fdevents *ev, size_t ndx) {
static int fdevent_select_event_next_fdndx(fdevents *ev, int ndx) {
int i;
-
+
i = (ndx < 0) ? 0 : ndx + 1;
-
+
for (; i < ev->select_max_fd + 1; i++) {
- if (FD_ISSET(i, &(ev->select_read))) return i;
- if (FD_ISSET(i, &(ev->select_write))) return i;
- if (FD_ISSET(i, &(ev->select_error))) return i;
+ if (FD_ISSET(i, &(ev->select_read))) break;
+ if (FD_ISSET(i, &(ev->select_write))) break;
+ if (FD_ISSET(i, &(ev->select_error))) break;
}
-
- return -1;
+
+ return i;
}
int fdevent_select_init(fdevents *ev) {
ev->type = FDEVENT_HANDLER_SELECT;
#define SET(x) \
ev->x = fdevent_select_##x;
-
+
SET(reset);
SET(poll);
-
+
SET(event_del);
- SET(event_set);
-
+ SET(event_add);
+
SET(event_next_fdndx);
SET(event_get_fd);
SET(event_get_revent);
-
+
return 0;
}
diff --git a/src/fdevent_solaris_devpoll.c b/src/fdevent_solaris_devpoll.c
index dd273e6..91238b0 100644
--- a/src/fdevent_solaris_devpoll.c
+++ b/src/fdevent_solaris_devpoll.c
@@ -1,7 +1,3 @@
-#include "fdevent.h"
-#include "buffer.h"
-#include "log.h"
-
#include <sys/types.h>
#include <unistd.h>
@@ -12,9 +8,11 @@
#include <signal.h>
#include <fcntl.h>
-#ifdef USE_SOLARIS_DEVPOLL
+#include "fdevent.h"
+#include "settings.h"
+#include "buffer.h"
-# include <sys/devpoll.h>
+#ifdef USE_SOLARIS_DEVPOLL
static void fdevent_solaris_devpoll_free(fdevents *ev) {
free(ev->devpollfds);
@@ -25,76 +23,60 @@ static void fdevent_solaris_devpoll_free(fdevents *ev) {
static int fdevent_solaris_devpoll_event_del(fdevents *ev, int fde_ndx, int fd) {
struct pollfd pfd;
-
+
if (fde_ndx < 0) return -1;
-
+
pfd.fd = fd;
pfd.events = POLLREMOVE;
pfd.revents = 0;
-
+
if (-1 == write(ev->devpoll_fd, &pfd, sizeof(pfd))) {
- log_error_write(ev->srv, __FILE__, __LINE__, "S(D, S)",
- "(del) write failed: ", fd, strerror(errno));
-
+ fprintf(stderr, "%s.%d: (del) write failed: (%d, %s)\n",
+ __FILE__, __LINE__,
+ fd, strerror(errno));
+
return -1;
}
-
+
return -1;
}
-static int fdevent_solaris_devpoll_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
+static int fdevent_solaris_devpoll_event_add(fdevents *ev, int fde_ndx, int fd, int events) {
struct pollfd pfd;
int add = 0;
-
- int pevents = 0;
- if (events & FDEVENT_IN) pevents |= POLLIN;
- if (events & FDEVENT_OUT) pevents |= POLLOUT;
-
+
if (fde_ndx == -1) add = 1;
-
+
pfd.fd = fd;
- pfd.events = pevents;
+ pfd.events = events;
pfd.revents = 0;
-
+
if (-1 == write(ev->devpoll_fd, &pfd, sizeof(pfd))) {
- log_error_write(ev->srv, __FILE__, __LINE__, "S(D, S)",
- "(set) write failed: ", fd, strerror(errno));
-
+ fprintf(stderr, "%s.%d: (del) write failed: (%d, %s)\n",
+ __FILE__, __LINE__,
+ fd, strerror(errno));
+
return -1;
}
-
+
return fd;
}
static int fdevent_solaris_devpoll_poll(fdevents *ev, int timeout_ms) {
struct dvpoll dopoll;
int ret;
-
+
dopoll.dp_timeout = timeout_ms;
- dopoll.dp_nfds = ev->maxfds - 1;
+ dopoll.dp_nfds = ev->maxfds;
dopoll.dp_fds = ev->devpollfds;
-
+
ret = ioctl(ev->devpoll_fd, DP_POLL, &dopoll);
-
+
return ret;
}
static int fdevent_solaris_devpoll_event_get_revent(fdevents *ev, size_t ndx) {
- int r, poll_r;
-
- r = 0;
- poll_r = ev->devpollfds[ndx].revents;
-
- /* map POLL* to FDEVEN_*; they are probably the same, but still. */
-
- if (poll_r & POLLIN) r |= FDEVENT_IN;
- if (poll_r & POLLOUT) r |= FDEVENT_OUT;
- if (poll_r & POLLERR) r |= FDEVENT_ERR;
- if (poll_r & POLLHUP) r |= FDEVENT_HUP;
- if (poll_r & POLLNVAL) r |= FDEVENT_NVAL;
- if (poll_r & POLLPRI) r |= FDEVENT_PRI;
-
- return r;
+ return ev->devpollfds[ndx].revents;
}
static int fdevent_solaris_devpoll_event_get_fd(fdevents *ev, size_t ndx) {
@@ -103,11 +85,11 @@ static int fdevent_solaris_devpoll_event_get_fd(fdevents *ev, size_t ndx) {
static int fdevent_solaris_devpoll_event_next_fdndx(fdevents *ev, int last_ndx) {
size_t i;
-
+
UNUSED(ev);
i = (last_ndx < 0) ? 0 : last_ndx + 1;
-
+
return i;
}
@@ -115,15 +97,15 @@ int fdevent_solaris_devpoll_reset(fdevents *ev) {
/* a forked process does only inherit the filedescriptor,
* but every operation on the device will lead to a EACCES */
if ((ev->devpoll_fd = open("/dev/poll", O_RDWR)) < 0) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "opening /dev/poll failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
+ fprintf(stderr, "%s.%d: opening /dev/poll failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__, strerror(errno));
return -1;
}
if (fcntl(ev->devpoll_fd, F_SETFD, FD_CLOEXEC) < 0) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "fcntl /dev/poll fd failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
+ fprintf(stderr, "%s.%d: opening /dev/poll failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__, strerror(errno));
close(ev->devpoll_fd);
@@ -135,23 +117,23 @@ int fdevent_solaris_devpoll_init(fdevents *ev) {
ev->type = FDEVENT_HANDLER_SOLARIS_DEVPOLL;
#define SET(x) \
ev->x = fdevent_solaris_devpoll_##x;
-
+
SET(free);
SET(poll);
SET(reset);
-
+
SET(event_del);
- SET(event_set);
-
+ SET(event_add);
+
SET(event_next_fdndx);
SET(event_get_fd);
SET(event_get_revent);
-
+
ev->devpollfds = malloc(sizeof(*ev->devpollfds) * ev->maxfds);
-
+
if ((ev->devpoll_fd = open("/dev/poll", O_RDWR)) < 0) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "opening /dev/poll failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
+ fprintf(stderr, "%s.%d: opening /dev/poll failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__, strerror(errno));
return -1;
}
@@ -168,9 +150,9 @@ int fdevent_solaris_devpoll_init(fdevents *ev) {
int fdevent_solaris_devpoll_init(fdevents *ev) {
UNUSED(ev);
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "solaris-devpoll not supported, try to set server.event-handler = \"poll\" or \"select\"");
-
+ fprintf(stderr, "%s.%d: solaris-devpoll not supported, try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__);
+
return -1;
}
#endif
diff --git a/src/fdevent_solaris_port.c b/src/fdevent_solaris_port.c
deleted file mode 100644
index 8dea4d2..0000000
--- a/src/fdevent_solaris_port.c
+++ /dev/null
@@ -1,172 +0,0 @@
-#include "fdevent.h"
-#include "buffer.h"
-#include "log.h"
-
-#include <sys/types.h>
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <signal.h>
-#include <fcntl.h>
-
-#ifdef USE_SOLARIS_PORT
-
-static const int SOLARIS_PORT_POLL_READ = POLLIN;
-static const int SOLARIS_PORT_POLL_WRITE = POLLOUT;
-static const int SOLARIS_PORT_POLL_READ_WRITE = POLLIN & POLLOUT;
-
-static int fdevent_solaris_port_event_del(fdevents *ev, int fde_ndx, int fd) {
- if (fde_ndx < 0) return -1;
-
- if (0 != port_dissociate(ev->port_fd, PORT_SOURCE_FD, fd)) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "port_dissociate failed: ", strerror(errno), ", dying");
-
- SEGFAULT();
-
- return 0;
- }
-
- return -1;
-}
-
-static int fdevent_solaris_port_event_set(fdevents *ev, int fde_ndx, int fd, int events) {
- const int* user_data = NULL;
-
- if ((events & FDEVENT_IN) && (events & FDEVENT_OUT)) {
- user_data = &SOLARIS_PORT_POLL_READ_WRITE;
- } else if (events & FDEVENT_IN) {
- user_data = &SOLARIS_PORT_POLL_READ;
- } else if (events & FDEVENT_OUT) {
- user_data = &SOLARIS_PORT_POLL_WRITE;
- }
-
- if (0 != port_associate(ev->port_fd, PORT_SOURCE_FD, fd, *user_data, (void*) user_data)) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "port_associate failed: ", strerror(errno), ", dying");
-
- SEGFAULT();
-
- return 0;
- }
-
- return fd;
-}
-
-static int fdevent_solaris_port_event_get_revent(fdevents *ev, size_t ndx) {
- int events = 0, e;
-
- e = ev->port_events[ndx].portev_events;
- if (e & POLLIN) events |= FDEVENT_IN;
- if (e & POLLOUT) events |= FDEVENT_OUT;
- if (e & POLLERR) events |= FDEVENT_ERR;
- if (e & POLLHUP) events |= FDEVENT_HUP;
- if (e & POLLPRI) events |= FDEVENT_PRI;
- if (e & POLLNVAL) events |= FDEVENT_NVAL;
-
- return e;
-}
-
-static int fdevent_solaris_port_event_get_fd(fdevents *ev, size_t ndx) {
- return ev->port_events[ndx].portev_object;
-}
-
-static int fdevent_solaris_port_event_next_fdndx(fdevents *ev, int ndx) {
- size_t i;
-
- UNUSED(ev);
-
- i = (ndx < 0) ? 0 : ndx + 1;
-
- return i;
-}
-
-static void fdevent_solaris_port_free(fdevents *ev) {
- close(ev->port_fd);
- free(ev->port_events);
-}
-
-/* if there is any error it will return the return values of port_getn, otherwise it will return number of events **/
-static int fdevent_solaris_port_poll(fdevents *ev, int timeout_ms) {
- int i = 0;
- int ret;
- unsigned int available_events, wait_for_events = 0;
- const int *user_data;
-
- struct timespec timeout;
-
- timeout.tv_sec = timeout_ms/1000L;
- timeout.tv_nsec = (timeout_ms % 1000L) * 1000000L;
-
- /* get the number of file descriptors with events */
- if ((ret = port_getn(ev->port_fd, ev->port_events, 0, &wait_for_events, &timeout)) < 0) return ret;
-
- /* wait for at least one event */
- if (0 == wait_for_events) wait_for_events = 1;
-
- available_events = wait_for_events;
-
- /* get the events of the file descriptors */
- if ((ret = port_getn(ev->port_fd, ev->port_events, ev->maxfds, &available_events, &timeout)) < 0) {
- /* if errno == ETIME and available_event == wait_for_events we didn't get any events */
- /* for other errors we didn't get any events either */
- if (!(errno == ETIME && wait_for_events != available_events)) return ret;
- }
-
- for (i = 0; i < available_events; ++i) {
- user_data = (const int *) ev->port_events[i].portev_user;
-
- if ((ret = port_associate(ev->port_fd, PORT_SOURCE_FD, ev->port_events[i].portev_object,
- *user_data, (void*) user_data)) < 0) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "port_associate failed: ", strerror(errno), ", dying");
-
- SEGFAULT();
-
- return 0;
- }
- }
-
- return available_events;
-}
-
-int fdevent_solaris_port_init(fdevents *ev) {
- ev->type = FDEVENT_HANDLER_SOLARIS_PORT;
-#define SET(x) \
- ev->x = fdevent_solaris_port_##x;
-
- SET(free);
- SET(poll);
-
- SET(event_del);
- SET(event_set);
-
- SET(event_next_fdndx);
- SET(event_get_fd);
- SET(event_get_revent);
-
- if ((ev->port_fd = port_create()) < 0) {
- log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
- "port_create() failed (", strerror(errno), "), try to set server.event-handler = \"poll\" or \"select\"");
-
- return -1;
- }
-
- ev->port_events = malloc(ev->maxfds * sizeof(*ev->port_events));
-
- return 0;
-}
-
-#else
-int fdevent_solaris_port_init(fdevents *ev) {
- UNUSED(ev);
-
- log_error_write(ev->srv, __FILE__, __LINE__, "S",
- "solaris-eventports not supported, try to set server.event-handler = \"poll\" or \"select\"");
-
- return -1;
-}
-#endif
diff --git a/src/http-header-glue.c b/src/http-header-glue.c
index a33ed3b..1e74098 100644
--- a/src/http-header-glue.c
+++ b/src/http-header-glue.c
@@ -1,14 +1,14 @@
+#define _GNU_SOURCE
+
+#include <string.h>
+#include <errno.h>
+#include <time.h>
+
#include "base.h"
#include "array.h"
#include "buffer.h"
#include "log.h"
#include "etag.h"
-#include "response.h"
-
-#include <string.h>
-#include <errno.h>
-
-#include <time.h>
/*
* This was 'borrowed' from tcpdump.
@@ -45,20 +45,20 @@
# ifdef HAVE_STRUCT_SOCKADDR_STORAGE
static size_t get_sa_len(const struct sockaddr *addr) {
switch (addr->sa_family) {
-
+
# ifdef AF_INET
case AF_INET:
return (sizeof (struct sockaddr_in));
# endif
-
+
# ifdef AF_INET6
case AF_INET6:
return (sizeof (struct sockaddr_in6));
# endif
-
+
default:
return (sizeof (struct sockaddr));
-
+
}
}
# define SA_LEN(addr) (get_sa_len(addr))
@@ -74,7 +74,7 @@ static size_t get_sa_len(const struct sockaddr *addr) {
int response_header_insert(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen) {
data_string *ds;
-
+
UNUSED(srv);
if (NULL == (ds = (data_string *)array_get_unused_element(con->response.headers, TYPE_STRING))) {
@@ -82,51 +82,36 @@ int response_header_insert(server *srv, connection *con, const char *key, size_t
}
buffer_copy_string_len(ds->key, key, keylen);
buffer_copy_string_len(ds->value, value, vallen);
-
+
array_insert_unique(con->response.headers, (data_unset *)ds);
-
+
return 0;
}
int response_header_overwrite(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen) {
data_string *ds;
-
+
UNUSED(srv);
/* if there already is a key by this name overwrite the value */
if (NULL != (ds = (data_string *)array_get_element(con->response.headers, key))) {
buffer_copy_string(ds->value, value);
-
+
return 0;
}
-
- return response_header_insert(srv, con, key, keylen, value, vallen);
-}
-
-int response_header_append(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen) {
- data_string *ds;
-
- UNUSED(srv);
-
- /* if there already is a key by this name append the value */
- if (NULL != (ds = (data_string *)array_get_element(con->response.headers, key))) {
- buffer_append_string_len(ds->value, CONST_STR_LEN(", "));
- buffer_append_string_len(ds->value, value, vallen);
- return 0;
- }
-
+
return response_header_insert(srv, con, key, keylen, value, vallen);
}
int http_response_redirect_to_directory(server *srv, connection *con) {
buffer *o;
-
+
o = buffer_init();
-
+
if (con->conf.is_ssl) {
- buffer_copy_string_len(o, CONST_STR_LEN("https://"));
+ buffer_copy_string(o, "https://");
} else {
- buffer_copy_string_len(o, CONST_STR_LEN("http://"));
+ buffer_copy_string(o, "http://");
}
if (con->uri.authority->used) {
buffer_append_string_buffer(o, con->uri.authority);
@@ -138,36 +123,36 @@ int http_response_redirect_to_directory(server *srv, connection *con) {
#endif
sock_addr our_addr;
socklen_t our_addr_len;
-
+
our_addr_len = sizeof(our_addr);
-
+
if (-1 == getsockname(con->fd, &(our_addr.plain), &our_addr_len)) {
con->http_status = 500;
-
+
log_error_write(srv, __FILE__, __LINE__, "ss",
"can't get sockname", strerror(errno));
-
+
buffer_free(o);
return 0;
}
-
-
+
+
/* Lookup name: secondly try to get hostname for bind address */
switch(our_addr.plain.sa_family) {
#ifdef HAVE_IPV6
case AF_INET6:
- if (0 != getnameinfo((const struct sockaddr *)(&our_addr.ipv6),
- SA_LEN((const struct sockaddr *)&our_addr.ipv6),
+ if (0 != getnameinfo((const struct sockaddr *)(&our_addr.ipv6),
+ SA_LEN((const struct sockaddr *)&our_addr.ipv6),
hbuf, sizeof(hbuf), NULL, 0, 0)) {
-
+
char dst[INET6_ADDRSTRLEN];
-
+
log_error_write(srv, __FILE__, __LINE__,
- "SSS", "NOTICE: getnameinfo failed: ",
+ "SSSS", "NOTICE: getnameinfo failed: ",
strerror(errno), ", using ip-address instead");
-
- buffer_append_string(o,
- inet_ntop(AF_INET6, (char *)&our_addr.ipv6.sin6_addr,
+
+ buffer_append_string(o,
+ inet_ntop(AF_INET6, (char *)&our_addr.ipv6.sin6_addr,
dst, sizeof(dst)));
} else {
buffer_append_string(o, hbuf);
@@ -177,9 +162,9 @@ int http_response_redirect_to_directory(server *srv, connection *con) {
case AF_INET:
if (NULL == (he = gethostbyaddr((char *)&our_addr.ipv4.sin_addr, sizeof(struct in_addr), AF_INET))) {
log_error_write(srv, __FILE__, __LINE__,
- "SdS", "NOTICE: gethostbyaddr failed: ",
+ "SdSS", "NOTICE: gethostbyaddr failed: ",
h_errno, ", using ip-address instead");
-
+
buffer_append_string(o, inet_ntoa(our_addr.ipv4.sin_addr));
} else {
buffer_append_string(o, he->h_name);
@@ -188,58 +173,57 @@ int http_response_redirect_to_directory(server *srv, connection *con) {
default:
log_error_write(srv, __FILE__, __LINE__,
"S", "ERROR: unsupported address-type");
-
+
buffer_free(o);
return -1;
}
-
- if (!((con->conf.is_ssl == 0 && srv->srvconf.port == 80) ||
+
+ if (!((con->conf.is_ssl == 0 && srv->srvconf.port == 80) ||
(con->conf.is_ssl == 1 && srv->srvconf.port == 443))) {
- buffer_append_string_len(o, CONST_STR_LEN(":"));
+ buffer_append_string(o, ":");
buffer_append_long(o, srv->srvconf.port);
}
}
buffer_append_string_buffer(o, con->uri.path);
- buffer_append_string_len(o, CONST_STR_LEN("/"));
+ buffer_append_string(o, "/");
if (!buffer_is_empty(con->uri.query)) {
- buffer_append_string_len(o, CONST_STR_LEN("?"));
+ buffer_append_string(o, "?");
buffer_append_string_buffer(o, con->uri.query);
}
-
+
response_header_insert(srv, con, CONST_STR_LEN("Location"), CONST_BUF_LEN(o));
-
+
con->http_status = 301;
- con->file_finished = 1;
-
+
buffer_free(o);
-
+
return 0;
}
buffer * strftime_cache_get(server *srv, time_t last_mod) {
struct tm *tm;
size_t i;
-
+
for (i = 0; i < FILE_CACHE_MAX; i++) {
/* found cache-entry */
if (srv->mtime_cache[i].mtime == last_mod) return srv->mtime_cache[i].str;
-
+
/* found empty slot */
if (srv->mtime_cache[i].mtime == 0) break;
}
-
+
if (i == FILE_CACHE_MAX) {
i = 0;
}
-
+
srv->mtime_cache[i].mtime = last_mod;
buffer_prepare_copy(srv->mtime_cache[i].str, 1024);
tm = gmtime(&(srv->mtime_cache[i].mtime));
- srv->mtime_cache[i].str->used = strftime(srv->mtime_cache[i].str->ptr,
+ srv->mtime_cache[i].str->used = strftime(srv->mtime_cache[i].str->ptr,
srv->mtime_cache[i].str->size - 1,
"%a, %d %b %Y %H:%M:%S GMT", tm);
srv->mtime_cache[i].str->used++;
-
+
return srv->mtime_cache[i].str;
}
@@ -254,63 +238,56 @@ int http_response_handle_cachable(server *srv, connection *con, buffer *mtime) {
* request. That is, if no entity tags match, then the server MUST NOT
* return a 304 (Not Modified) response.
*/
-
+
/* last-modified handling */
if (con->request.http_if_none_match) {
if (etag_is_equal(con->physical.etag, con->request.http_if_none_match)) {
- if (con->request.http_method == HTTP_METHOD_GET ||
+ if (con->request.http_method == HTTP_METHOD_GET ||
con->request.http_method == HTTP_METHOD_HEAD) {
-
+
/* check if etag + last-modified */
if (con->request.http_if_modified_since) {
size_t used_len;
char *semicolon;
-
+
if (NULL == (semicolon = strchr(con->request.http_if_modified_since, ';'))) {
used_len = strlen(con->request.http_if_modified_since);
} else {
used_len = semicolon - con->request.http_if_modified_since;
}
-
+
if (0 == strncmp(con->request.http_if_modified_since, mtime->ptr, used_len)) {
- if ('\0' == mtime->ptr[used_len]) con->http_status = 304;
+ con->http_status = 304;
return HANDLER_FINISHED;
} else {
char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")];
- time_t t_header, t_file;
- struct tm tm;
- /* check if we can safely copy the string */
- if (used_len >= sizeof(buf)) {
- log_error_write(srv, __FILE__, __LINE__, "ssdd",
- "DEBUG: Last-Modified check failed as the received timestamp was too long:",
+ /* convert to timestamp */
+ if (used_len < sizeof(buf)) {
+ time_t t_header, t_file;
+ struct tm tm;
+
+ strncpy(buf, con->request.http_if_modified_since, used_len);
+ buf[used_len] = '\0';
+
+ strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm);
+ t_header = mktime(&tm);
+
+ strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm);
+ t_file = mktime(&tm);
+
+ if (t_file > t_header) {
+ con->http_status = 304;
+ return HANDLER_FINISHED;
+ }
+ } else {
+ log_error_write(srv, __FILE__, __LINE__, "ssdd",
+ "DEBUG: Last-Modified check failed as the received timestamp was too long:",
con->request.http_if_modified_since, used_len, sizeof(buf) - 1);
-
+
con->http_status = 412;
- con->mode = DIRECT;
return HANDLER_FINISHED;
}
-
-
- strncpy(buf, con->request.http_if_modified_since, used_len);
- buf[used_len] = '\0';
-
- if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
- con->http_status = 412;
- con->mode = DIRECT;
- return HANDLER_FINISHED;
- }
- tm.tm_isdst = 0;
- t_header = mktime(&tm);
-
- strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm);
- tm.tm_isdst = 0;
- t_file = mktime(&tm);
-
- if (t_file > t_header) return HANDLER_GO_ON;
-
- con->http_status = 304;
- return HANDLER_FINISHED;
}
} else {
con->http_status = 304;
@@ -318,49 +295,20 @@ int http_response_handle_cachable(server *srv, connection *con, buffer *mtime) {
}
} else {
con->http_status = 412;
- con->mode = DIRECT;
return HANDLER_FINISHED;
}
}
} else if (con->request.http_if_modified_since) {
size_t used_len;
char *semicolon;
-
+
if (NULL == (semicolon = strchr(con->request.http_if_modified_since, ';'))) {
used_len = strlen(con->request.http_if_modified_since);
} else {
used_len = semicolon - con->request.http_if_modified_since;
}
-
+
if (0 == strncmp(con->request.http_if_modified_since, mtime->ptr, used_len)) {
- if ('\0' == mtime->ptr[used_len]) con->http_status = 304;
- return HANDLER_FINISHED;
- } else {
- char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")];
- time_t t_header, t_file;
- struct tm tm;
-
- /* convert to timestamp */
- if (used_len >= sizeof(buf)) return HANDLER_GO_ON;
-
- strncpy(buf, con->request.http_if_modified_since, used_len);
- buf[used_len] = '\0';
-
- if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
- /**
- * parsing failed, let's get out of here
- */
- return HANDLER_GO_ON;
- }
- tm.tm_isdst = 0;
- t_header = mktime(&tm);
-
- strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm);
- tm.tm_isdst = 0;
- t_file = mktime(&tm);
-
- if (t_file > t_header) return HANDLER_GO_ON;
-
con->http_status = 304;
return HANDLER_FINISHED;
}
diff --git a/src/http_auth.c b/src/http_auth.c
index d7d246b..478a2f7 100644
--- a/src/http_auth.c
+++ b/src/http_auth.c
@@ -1,8 +1,6 @@
-#include "server.h"
-#include "log.h"
-#include "http_auth.h"
-#include "inet_ntop_cache.h"
-#include "stream.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#ifdef HAVE_CRYPT_H
# include <crypt.h>
@@ -27,61 +25,49 @@
#include <unistd.h>
#include <ctype.h>
-#include "md5.h"
-
-#define HASHLEN 16
-#define HASHHEXLEN 32
-typedef unsigned char HASH[HASHLEN];
-typedef char HASHHEX[HASHHEXLEN+1];
+#include "server.h"
+#include "log.h"
+#include "http_auth.h"
+#include "http_auth_digest.h"
+#include "stream.h"
-static void CvtHex(const HASH Bin, char Hex[33]) {
- unsigned short i;
+#ifdef USE_OPENSSL
+# include <openssl/md5.h>
+#else
+# include "md5.h"
+#endif
- for (i = 0; i < 16; i++) {
- Hex[i*2] = int2hex((Bin[i] >> 4) & 0xf);
- Hex[i*2+1] = int2hex(Bin[i] & 0xf);
- }
- Hex[32] = '\0';
-}
-/**
- * the $apr1$ handling is taken from apache 1.3.x
- */
+#ifdef USE_PAM
+#include <security/pam_appl.h>
+#include <security/pam_misc.h>
-/*
- * The apr_md5_encode() routine uses much code obtained from the FreeBSD 3.0
- * MD5 crypt() function, which is licenced as follows:
- * ----------------------------------------------------------------------------
- * "THE BEER-WARE LICENSE" (Revision 42):
- * <phk@login.dknet.dk> wrote this file. As long as you retain this notice you
- * can do whatever you want with this stuff. If we meet some day, and you think
- * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
- * ----------------------------------------------------------------------------
- */
+static struct pam_conv conv = {
+ misc_conv,
+ NULL
+};
+#endif
handler_t auth_ldap_init(server *srv, mod_auth_plugin_config *s);
static const char base64_pad = '=';
-/* "A-Z a-z 0-9 + /" maps to 0-63 */
static const short base64_reverse_table[256] = {
-/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x00 - 0x0F */
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x10 - 0x1F */
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, /* 0x20 - 0x2F */
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, /* 0x30 - 0x3F */
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, /* 0x40 - 0x4F */
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, /* 0x50 - 0x5F */
- -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, /* 0x60 - 0x6F */
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, /* 0x70 - 0x7F */
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x80 - 0x8F */
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x90 - 0x9F */
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xA0 - 0xAF */
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xB0 - 0xBF */
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xC0 - 0xCF */
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xD0 - 0xDF */
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xE0 - 0xEF */
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xF0 - 0xFF */
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
+ -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};
@@ -89,25 +75,25 @@ static unsigned char * base64_decode(buffer *out, const char *in) {
unsigned char *result;
int ch, j = 0, k;
size_t i;
-
+
size_t in_len = strlen(in);
-
+
buffer_prepare_copy(out, in_len);
-
+
result = (unsigned char *)out->ptr;
-
+
ch = in[0];
/* run through the whole string, converting as we go */
for (i = 0; i < in_len; i++) {
- ch = (unsigned char) in[i];
-
+ ch = in[i];
+
if (ch == '\0') break;
-
+
if (ch == base64_pad) break;
-
+
ch = base64_reverse_table[ch];
if (ch < 0) continue;
-
+
switch(i % 4) {
case 0:
result[j] = ch << 2;
@@ -139,168 +125,168 @@ static unsigned char * base64_decode(buffer *out, const char *in) {
}
}
result[k] = '\0';
-
+
out->used = k;
-
+
return result;
}
static int http_auth_get_password(server *srv, mod_auth_plugin_data *p, buffer *username, buffer *realm, buffer *password) {
int ret = -1;
-
+
if (!username->used|| !realm->used) return -1;
-
+
if (p->conf.auth_backend == AUTH_BACKEND_HTDIGEST) {
stream f;
char * f_line;
-
+
if (buffer_is_empty(p->conf.auth_htdigest_userfile)) return -1;
-
+
if (0 != stream_open(&f, p->conf.auth_htdigest_userfile)) {
log_error_write(srv, __FILE__, __LINE__, "sbss", "opening digest-userfile", p->conf.auth_htdigest_userfile, "failed:", strerror(errno));
-
+
return -1;
}
-
+
f_line = f.start;
-
+
while (f_line - f.start != f.size) {
char *f_user, *f_pwd, *e, *f_realm;
size_t u_len, pwd_len, r_len;
-
+
f_user = f_line;
-
- /*
+
+ /*
* htdigest format
- *
- * user:realm:md5(user:realm:password)
+ *
+ * user:realm:md5(user:realm:password)
*/
-
+
if (NULL == (f_realm = memchr(f_user, ':', f.size - (f_user - f.start) ))) {
- log_error_write(srv, __FILE__, __LINE__, "sbs",
- "parsed error in", p->conf.auth_htdigest_userfile,
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
+ "parsed error in", p->conf.auth_htdigest_userfile,
"expected 'username:realm:hashed password'");
-
+
stream_close(&f);
-
+
return -1;
}
-
+
if (NULL == (f_pwd = memchr(f_realm + 1, ':', f.size - (f_realm + 1 - f.start)))) {
- log_error_write(srv, __FILE__, __LINE__, "sbs",
- "parsed error in", p->conf.auth_plain_userfile,
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
+ "parsed error in", p->conf.auth_plain_userfile,
"expected 'username:realm:hashed password'");
-
+
stream_close(&f);
-
+
return -1;
}
-
+
/* get pointers to the fields */
- u_len = f_realm - f_user;
+ u_len = f_realm - f_user;
f_realm++;
r_len = f_pwd - f_realm;
f_pwd++;
-
+
if (NULL != (e = memchr(f_pwd, '\n', f.size - (f_pwd - f.start)))) {
pwd_len = e - f_pwd;
} else {
pwd_len = f.size - (f_pwd - f.start);
}
-
+
if (username->used - 1 == u_len &&
(realm->used - 1 == r_len) &&
(0 == strncmp(username->ptr, f_user, u_len)) &&
(0 == strncmp(realm->ptr, f_realm, r_len))) {
/* found */
-
+
buffer_copy_string_len(password, f_pwd, pwd_len);
-
+
ret = 0;
break;
}
-
+
/* EOL */
if (!e) break;
-
+
f_line = e + 1;
}
-
+
stream_close(&f);
} else if (p->conf.auth_backend == AUTH_BACKEND_HTPASSWD ||
p->conf.auth_backend == AUTH_BACKEND_PLAIN) {
stream f;
char * f_line;
buffer *auth_fn;
-
+
auth_fn = (p->conf.auth_backend == AUTH_BACKEND_HTPASSWD) ? p->conf.auth_htpasswd_userfile : p->conf.auth_plain_userfile;
-
+
if (buffer_is_empty(auth_fn)) return -1;
-
+
if (0 != stream_open(&f, auth_fn)) {
- log_error_write(srv, __FILE__, __LINE__, "sbss",
+ log_error_write(srv, __FILE__, __LINE__, "sbss",
"opening plain-userfile", auth_fn, "failed:", strerror(errno));
-
+
return -1;
}
-
+
f_line = f.start;
-
+
while (f_line - f.start != f.size) {
char *f_user, *f_pwd, *e;
size_t u_len, pwd_len;
-
+
f_user = f_line;
-
- /*
+
+ /*
* htpasswd format
- *
+ *
* user:crypted passwd
*/
-
+
if (NULL == (f_pwd = memchr(f_user, ':', f.size - (f_user - f.start) ))) {
- log_error_write(srv, __FILE__, __LINE__, "sbs",
- "parsed error in", auth_fn,
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
+ "parsed error in", auth_fn,
"expected 'username:hashed password'");
-
+
stream_close(&f);
-
+
return -1;
}
-
+
/* get pointers to the fields */
- u_len = f_pwd - f_user;
+ u_len = f_pwd - f_user;
f_pwd++;
-
+
if (NULL != (e = memchr(f_pwd, '\n', f.size - (f_pwd - f.start)))) {
pwd_len = e - f_pwd;
} else {
pwd_len = f.size - (f_pwd - f.start);
}
-
+
if (username->used - 1 == u_len &&
(0 == strncmp(username->ptr, f_user, u_len))) {
/* found */
-
+
buffer_copy_string_len(password, f_pwd, pwd_len);
-
+
ret = 0;
break;
}
-
+
/* EOL */
if (!e) break;
-
+
f_line = e + 1;
}
-
+
stream_close(&f);
} else if (p->conf.auth_backend == AUTH_BACKEND_LDAP) {
ret = 0;
} else {
return -1;
}
-
+
return ret;
}
@@ -310,7 +296,7 @@ static int http_auth_match_rules(server *srv, mod_auth_plugin_data *p, const cha
int username_len;
data_string *require;
array *req;
-
+
UNUSED(group);
UNUSED(host);
@@ -318,12 +304,12 @@ static int http_auth_match_rules(server *srv, mod_auth_plugin_data *p, const cha
/* search auth-directives for path */
for (i = 0; i < p->conf.auth_require->used; i++) {
if (p->conf.auth_require->data[i]->key->used == 0) continue;
-
+
if (0 == strncmp(url, p->conf.auth_require->data[i]->key->ptr, p->conf.auth_require->data[i]->key->used - 1)) {
break;
}
}
-
+
if (i == p->conf.auth_require->used) {
return -1;
}
@@ -331,72 +317,66 @@ static int http_auth_match_rules(server *srv, mod_auth_plugin_data *p, const cha
req = ((data_array *)(p->conf.auth_require->data[i]))->value;
require = (data_string *)array_get_element(req, "require");
-
+
/* if we get here, the user we got a authed user */
if (0 == strcmp(require->value->ptr, "valid-user")) {
return 0;
}
-
+
/* user=name1|group=name3|host=name4 */
-
+
/* seperate the string by | */
#if 0
log_error_write(srv, __FILE__, __LINE__, "sb", "rules", require->value);
-#endif
-
+#endif
+
username_len = username ? strlen(username) : 0;
-
+
r = rules = require->value->ptr;
-
+
while (1) {
const char *eq;
const char *k, *v, *e;
int k_len, v_len, r_len;
-
+
e = strchr(r, '|');
-
+
if (e) {
r_len = e - r;
} else {
r_len = strlen(rules) - (r - rules);
}
-
+
/* from r to r + r_len is a rule */
-
+
if (0 == strncmp(r, "valid-user", r_len)) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "parsing the 'require' section in 'auth.require' failed: valid-user cannot be combined with other require rules",
- require->value);
+ log_error_write(srv, __FILE__, __LINE__, "s", "valid-user cannot be combined with other require rules");
return -1;
}
-
+
/* search for = in the rules */
if (NULL == (eq = strchr(r, '='))) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "parsing the 'require' section in 'auth.require' failed: a = is missing",
- require->value);
+ log_error_write(srv, __FILE__, __LINE__, "s", "= is missing");
return -1;
}
-
+
/* = out of range */
if (eq > r + r_len) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "parsing the 'require' section in 'auth.require' failed: = out of range",
- require->value);
-
+ log_error_write(srv, __FILE__, __LINE__, "s", "= out of range");
+
return -1;
}
-
+
/* the part before the = is user|group|host */
-
+
k = r;
k_len = eq - r;
v = eq + 1;
v_len = r_len - k_len - 1;
-
+
if (k_len == 4) {
if (0 == strncmp(k, "user", k_len)) {
- if (username &&
+ if (username &&
username_len == v_len &&
0 == strncmp(username, v, v_len)) {
return 0;
@@ -418,191 +398,19 @@ static int http_auth_match_rules(server *srv, mod_auth_plugin_data *p, const cha
log_error_write(srv, __FILE__, __LINE__, "s", "unknown key");
return -1;
}
-
+
if (!e) break;
r = e + 1;
}
-
+
log_error_write(srv, __FILE__, __LINE__, "s", "nothing matched");
-
+
return -1;
}
-#define APR_MD5_DIGESTSIZE 16
-#define APR1_ID "$apr1$"
-
-/*
- * The following MD5 password encryption code was largely borrowed from
- * the FreeBSD 3.0 /usr/src/lib/libcrypt/crypt.c file, which is
- * licenced as stated at the top of this file.
- */
-
-static void to64(char *s, unsigned long v, int n)
-{
- static const unsigned char itoa64[] = /* 0 ... 63 => ASCII - 64 */
- "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
-
- while (--n >= 0) {
- *s++ = itoa64[v&0x3f];
- v >>= 6;
- }
-}
-
-static void apr_md5_encode(const char *pw, const char *salt, char *result, size_t nbytes) {
- /*
- * Minimum size is 8 bytes for salt, plus 1 for the trailing NUL,
- * plus 4 for the '$' separators, plus the password hash itself.
- * Let's leave a goodly amount of leeway.
- */
-
- char passwd[120], *p;
- const char *sp, *ep;
- unsigned char final[APR_MD5_DIGESTSIZE];
- ssize_t sl, pl, i;
- li_MD5_CTX ctx, ctx1;
- unsigned long l;
-
- /*
- * Refine the salt first. It's possible we were given an already-hashed
- * string as the salt argument, so extract the actual salt value from it
- * if so. Otherwise just use the string up to the first '$' as the salt.
- */
- sp = salt;
-
- /*
- * If it starts with the magic string, then skip that.
- */
- if (!strncmp(sp, APR1_ID, strlen(APR1_ID))) {
- sp += strlen(APR1_ID);
- }
-
- /*
- * It stops at the first '$' or 8 chars, whichever comes first
- */
- for (ep = sp; (*ep != '\0') && (*ep != '$') && (ep < (sp + 8)); ep++) {
- continue;
- }
-
- /*
- * Get the length of the true salt
- */
- sl = ep - sp;
-
- /*
- * 'Time to make the doughnuts..'
- */
- li_MD5_Init(&ctx);
-
- /*
- * The password first, since that is what is most unknown
- */
- li_MD5_Update(&ctx, pw, strlen(pw));
-
- /*
- * Then our magic string
- */
- li_MD5_Update(&ctx, APR1_ID, strlen(APR1_ID));
-
- /*
- * Then the raw salt
- */
- li_MD5_Update(&ctx, sp, sl);
-
- /*
- * Then just as many characters of the MD5(pw, salt, pw)
- */
- li_MD5_Init(&ctx1);
- li_MD5_Update(&ctx1, pw, strlen(pw));
- li_MD5_Update(&ctx1, sp, sl);
- li_MD5_Update(&ctx1, pw, strlen(pw));
- li_MD5_Final(final, &ctx1);
- for (pl = strlen(pw); pl > 0; pl -= APR_MD5_DIGESTSIZE) {
- li_MD5_Update(&ctx, final,
- (pl > APR_MD5_DIGESTSIZE) ? APR_MD5_DIGESTSIZE : pl);
- }
-
- /*
- * Don't leave anything around in vm they could use.
- */
- memset(final, 0, sizeof(final));
-
- /*
- * Then something really weird...
- */
- for (i = strlen(pw); i != 0; i >>= 1) {
- if (i & 1) {
- li_MD5_Update(&ctx, final, 1);
- }
- else {
- li_MD5_Update(&ctx, pw, 1);
- }
- }
-
- /*
- * Now make the output string. We know our limitations, so we
- * can use the string routines without bounds checking.
- */
- strcpy(passwd, APR1_ID);
- strncat(passwd, sp, sl);
- strcat(passwd, "$");
-
- li_MD5_Final(final, &ctx);
-
- /*
- * And now, just to make sure things don't run too fast..
- * On a 60 Mhz Pentium this takes 34 msec, so you would
- * need 30 seconds to build a 1000 entry dictionary...
- */
- for (i = 0; i < 1000; i++) {
- li_MD5_Init(&ctx1);
- if (i & 1) {
- li_MD5_Update(&ctx1, pw, strlen(pw));
- }
- else {
- li_MD5_Update(&ctx1, final, APR_MD5_DIGESTSIZE);
- }
- if (i % 3) {
- li_MD5_Update(&ctx1, sp, sl);
- }
-
- if (i % 7) {
- li_MD5_Update(&ctx1, pw, strlen(pw));
- }
-
- if (i & 1) {
- li_MD5_Update(&ctx1, final, APR_MD5_DIGESTSIZE);
- }
- else {
- li_MD5_Update(&ctx1, pw, strlen(pw));
- }
- li_MD5_Final(final,&ctx1);
- }
-
- p = passwd + strlen(passwd);
-
- l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; to64(p, l, 4); p += 4;
- l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; to64(p, l, 4); p += 4;
- l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; to64(p, l, 4); p += 4;
- l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; to64(p, l, 4); p += 4;
- l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; to64(p, l, 4); p += 4;
- l = final[11] ; to64(p, l, 2); p += 2;
- *p = '\0';
-
- /*
- * Don't leave anything around in vm they could use.
- */
- memset(final, 0, sizeof(final));
-
- /* FIXME
- */
-#define apr_cpystrn strncpy
- apr_cpystrn(result, passwd, nbytes - 1);
-}
-
-
/**
- *
- *
+ *
+ *
* @param password password-string from the auth-backend
* @param pw password-string from the client
*/
@@ -612,49 +420,41 @@ static int http_auth_basic_password_compare(server *srv, mod_auth_plugin_data *p
UNUSED(req);
if (p->conf.auth_backend == AUTH_BACKEND_HTDIGEST) {
- /*
+ /*
* htdigest format
- *
- * user:realm:md5(user:realm:password)
+ *
+ * user:realm:md5(user:realm:password)
*/
-
- li_MD5_CTX Md5Ctx;
+
+ MD5_CTX Md5Ctx;
HASH HA1;
char a1[256];
-
- li_MD5_Init(&Md5Ctx);
- li_MD5_Update(&Md5Ctx, (unsigned char *)username->ptr, username->used - 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)realm->ptr, realm->used - 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)pw, strlen(pw));
- li_MD5_Final(HA1, &Md5Ctx);
-
+
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)username->ptr, username->used - 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)realm->ptr, realm->used - 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)pw, strlen(pw));
+ MD5_Final(HA1, &Md5Ctx);
+
CvtHex(HA1, a1);
-
+
if (0 == strcmp(password->ptr, a1)) {
return 0;
}
- } else if (p->conf.auth_backend == AUTH_BACKEND_HTPASSWD) {
- char sample[120];
- if (!strncmp(password->ptr, APR1_ID, strlen(APR1_ID))) {
- /*
- * The hash was created using $apr1$ custom algorithm.
- */
- apr_md5_encode(pw, password->ptr, sample, sizeof(sample));
- return (strcmp(sample, password->ptr) == 0) ? 0 : 1;
- } else {
-#ifdef HAVE_CRYPT
+ } else if (p->conf.auth_backend == AUTH_BACKEND_HTPASSWD) {
+#ifdef HAVE_CRYPT
char salt[32];
char *crypted;
size_t salt_len = 0;
- /*
+ /*
* htpasswd format
- *
+ *
* user:crypted password
*/
- /*
+ /*
* Algorithm Salt
* CRYPT_STD_DES 2-character (Default)
* CRYPT_EXT_DES 9-character
@@ -663,6 +463,7 @@ static int http_auth_basic_password_compare(server *srv, mod_auth_plugin_data *p
*/
if (password->used < 13 + 1) {
+ fprintf(stderr, "%s.%d\n", __FILE__, __LINE__);
return -1;
}
@@ -671,8 +472,9 @@ static int http_auth_basic_password_compare(server *srv, mod_auth_plugin_data *p
salt_len = 2;
} else if (password->ptr[0] == '$' && password->ptr[2] == '$') {
char *dollar = NULL;
-
+
if (NULL == (dollar = strchr(password->ptr + 3, '$'))) {
+ fprintf(stderr, "%s.%d\n", __FILE__, __LINE__);
return -1;
}
@@ -680,26 +482,55 @@ static int http_auth_basic_password_compare(server *srv, mod_auth_plugin_data *p
}
if (salt_len > sizeof(salt) - 1) {
+ fprintf(stderr, "%s.%d\n", __FILE__, __LINE__);
return -1;
}
strncpy(salt, password->ptr, salt_len);
salt[salt_len] = '\0';
-
+
crypted = crypt(pw, salt);
if (0 == strcmp(password->ptr, crypted)) {
return 0;
+ } else {
+ fprintf(stderr, "%s.%d\n", __FILE__, __LINE__);
}
-
-#endif
- }
- } else if (p->conf.auth_backend == AUTH_BACKEND_PLAIN) {
+
+#endif
+ } else if (p->conf.auth_backend == AUTH_BACKEND_PLAIN) {
if (0 == strcmp(password->ptr, pw)) {
return 0;
}
- } else if (p->conf.auth_backend == AUTH_BACKEND_LDAP) {
+ } else if (p->conf.auth_backend == AUTH_BACKEND_PAM) {
+#ifdef USE_PAM
+ pam_handle_t *pamh=NULL;
+ int retval;
+
+ retval = pam_start("lighttpd", username->ptr, &conv, &pamh);
+
+ if (retval == PAM_SUCCESS)
+ retval = pam_authenticate(pamh, 0); /* is user really user? */
+
+ if (retval == PAM_SUCCESS)
+ retval = pam_acct_mgmt(pamh, 0); /* permitted access? */
+
+ /* This is where we have been authorized or not. */
+
+ if (pam_end(pamh,retval) != PAM_SUCCESS) { /* close Linux-PAM */
+ pamh = NULL;
+ log_error_write(srv, __FILE__, __LINE__, "s", "failed to release authenticator");
+ }
+
+ if (retval == PAM_SUCCESS) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "Authenticated");
+ return 0;
+ } else {
+ log_error_write(srv, __FILE__, __LINE__, "s", "Not Authenticated");
+ }
+#endif
+ } else if (p->conf.auth_backend == AUTH_BACKEND_LDAP) {
#ifdef USE_LDAP
LDAP *ldap;
LDAPMessage *lm, *first;
@@ -707,129 +538,117 @@ static int http_auth_basic_password_compare(server *srv, mod_auth_plugin_data *p
int ret;
char *attrs[] = { LDAP_NO_ATTRS, NULL };
size_t i;
-
+
/* for now we stay synchronous */
-
- /*
+
+ /*
* 1. connect anonymously (done in plugin init)
* 2. get DN for uid = username
* 3. auth against ldap server
* 4. (optional) check a field
* 5. disconnect
- *
+ *
*/
-
+
/* check username
- *
+ *
* we have to protect us againt username which modifies out filter in
* a unpleasant way
*/
-
+
for (i = 0; i < username->used - 1; i++) {
char c = username->ptr[i];
-
+
if (!isalpha(c) &&
- !isdigit(c) &&
- (c != ' ') &&
- (c != '@') &&
- (c != '-') &&
- (c != '_') &&
- (c != '.') ) {
-
- log_error_write(srv, __FILE__, __LINE__, "sbd",
- "ldap: invalid character (- _.@a-zA-Z0-9 allowed) in username:", username, i);
-
+ !isdigit(c)) {
+
+ log_error_write(srv, __FILE__, __LINE__, "sbd",
+ "ldap: invalid character (a-zA-Z0-9 allowed) in username:", username, i);
+
return -1;
}
}
-
- if (p->conf.auth_ldap_allow_empty_pw != 1 && pw[0] == '\0')
- return -1;
-
+
+
+
/* build filter */
buffer_copy_string_buffer(p->ldap_filter, p->conf.ldap_filter_pre);
buffer_append_string_buffer(p->ldap_filter, username);
buffer_append_string_buffer(p->ldap_filter, p->conf.ldap_filter_post);
-
-
+
+
/* 2. */
- if (p->anon_conf->ldap == NULL ||
- LDAP_SUCCESS != (ret = ldap_search_s(p->anon_conf->ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
-
- /* try again; the ldap library sometimes fails for the first call but reconnects */
- if (p->anon_conf->ldap == NULL || ret != LDAP_SERVER_DOWN ||
- LDAP_SUCCESS != (ret = ldap_search_s(p->anon_conf->ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
-
- if (auth_ldap_init(srv, p->anon_conf) != HANDLER_GO_ON)
- return -1;
+ if (p->conf.ldap == NULL ||
+ LDAP_SUCCESS != (ret = ldap_search_s(p->conf.ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
+ if (auth_ldap_init(srv, &p->conf) != HANDLER_GO_ON)
+ return -1;
+ if (LDAP_SUCCESS != (ret = ldap_search_s(p->conf.ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
- if (p->anon_conf->ldap == NULL ||
- LDAP_SUCCESS != (ret = ldap_search_s(p->anon_conf->ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
- log_error_write(srv, __FILE__, __LINE__, "sssb",
- "ldap:", ldap_err2string(ret), "filter:", p->ldap_filter);
- return -1;
- }
+ log_error_write(srv, __FILE__, __LINE__, "sssb",
+ "ldap:", ldap_err2string(ret), "filter:", p->ldap_filter);
+
+ return -1;
}
}
-
- if (NULL == (first = ldap_first_entry(p->anon_conf->ldap, lm))) {
+
+ if (NULL == (first = ldap_first_entry(p->conf.ldap, lm))) {
log_error_write(srv, __FILE__, __LINE__, "s", "ldap ...");
-
+
ldap_msgfree(lm);
-
+
return -1;
}
-
- if (NULL == (dn = ldap_get_dn(p->anon_conf->ldap, first))) {
+
+ if (NULL == (dn = ldap_get_dn(p->conf.ldap, first))) {
log_error_write(srv, __FILE__, __LINE__, "s", "ldap ...");
-
+
ldap_msgfree(lm);
-
+
return -1;
}
-
+
ldap_msgfree(lm);
-
-
+
+
/* 3. */
if (NULL == (ldap = ldap_init(p->conf.auth_ldap_hostname->ptr, LDAP_PORT))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "ldap ...", strerror(errno));
return -1;
}
-
+
ret = LDAP_VERSION3;
if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(ldap, LDAP_OPT_PROTOCOL_VERSION, &ret))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
-
+
ldap_unbind_s(ldap);
-
+
return -1;
}
-
+
if (p->conf.auth_ldap_starttls == 1) {
if (LDAP_OPT_SUCCESS != (ret = ldap_start_tls_s(ldap, NULL, NULL))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "ldap startTLS failed:", ldap_err2string(ret));
-
+
ldap_unbind_s(ldap);
-
+
return -1;
}
}
-
+
if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(ldap, dn, pw))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
-
+
ldap_unbind_s(ldap);
-
+
return -1;
}
-
+
/* 5. */
ldap_unbind_s(ldap);
-
+
/* everything worked, good, access granted */
-
+
return 0;
#endif
}
@@ -839,73 +658,65 @@ static int http_auth_basic_password_compare(server *srv, mod_auth_plugin_data *p
int http_auth_basic_check(server *srv, connection *con, mod_auth_plugin_data *p, array *req, buffer *url, const char *realm_str) {
buffer *username, *password;
char *pw;
-
+
data_string *realm;
-
+
realm = (data_string *)array_get_element(req, "realm");
-
+
username = buffer_init();
-
- if (!base64_decode(username, realm_str)) {
- log_error_write(srv, __FILE__, __LINE__, "sb", "decodeing base64-string failed", username);
-
- buffer_free(username);
- return 0;
- }
-
+ password = buffer_init();
+
+ base64_decode(username, realm_str);
+
/* r2 == user:password */
if (NULL == (pw = strchr(username->ptr, ':'))) {
- log_error_write(srv, __FILE__, __LINE__, "sb", ": is missing in", username);
-
buffer_free(username);
+
+ log_error_write(srv, __FILE__, __LINE__, "sb", ": is missing in", username);
+
return 0;
}
-
+
*pw++ = '\0';
-
+
username->used = pw - username->ptr;
-
- password = buffer_init();
+
/* copy password to r1 */
if (http_auth_get_password(srv, p, username, realm->value, password)) {
buffer_free(username);
buffer_free(password);
-
- if (AUTH_BACKEND_UNSET == p->conf.auth_backend) {
- log_error_write(srv, __FILE__, __LINE__, "s", "auth.backend is not set");
- } else {
- log_error_write(srv, __FILE__, __LINE__, "ss", "get_password failed, IP:", inet_ntop_cache_get_ip(srv, &(con->dst_addr)));
- }
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s", "get_password failed");
+
return 0;
}
-
+
/* password doesn't match */
if (http_auth_basic_password_compare(srv, p, req, username, realm->value, password, pw)) {
- log_error_write(srv, __FILE__, __LINE__, "sbsBss", "password doesn't match for", con->uri.path, "username:", username, ", IP:", inet_ntop_cache_get_ip(srv, &(con->dst_addr)));
-
+ log_error_write(srv, __FILE__, __LINE__, "sbb", "password doesn't match for", con->uri.path, username);
+
buffer_free(username);
buffer_free(password);
-
+
return 0;
}
-
+
/* value is our allow-rules */
if (http_auth_match_rules(srv, p, url->ptr, username->ptr, NULL, NULL)) {
buffer_free(username);
buffer_free(password);
-
+
log_error_write(srv, __FILE__, __LINE__, "s", "rules didn't match");
-
+
return 0;
}
-
+
/* remember the username */
buffer_copy_string_buffer(p->auth_user, username);
-
+
buffer_free(username);
buffer_free(password);
-
+
return 1;
}
@@ -918,28 +729,28 @@ typedef struct {
int http_auth_digest_check(server *srv, connection *con, mod_auth_plugin_data *p, array *req, buffer *url, const char *realm_str) {
char a1[256];
char a2[256];
-
- char *username = NULL;
- char *realm = NULL;
- char *nonce = NULL;
- char *uri = NULL;
- char *algorithm = NULL;
- char *qop = NULL;
- char *cnonce = NULL;
- char *nc = NULL;
- char *respons = NULL;
-
+
+ char *username;
+ char *realm;
+ char *nonce;
+ char *uri;
+ char *algorithm;
+ char *qop;
+ char *cnonce;
+ char *nc;
+ char *respons;
+
char *e, *c;
const char *m = NULL;
int i;
buffer *password, *b, *username_buf, *realm_buf;
-
- li_MD5_CTX Md5Ctx;
+
+ MD5_CTX Md5Ctx;
HASH HA1;
HASH HA2;
HASH RespHash;
HASHHEX HA2Hex;
-
+
/* init pointers */
#define S(x) \
@@ -954,11 +765,11 @@ int http_auth_digest_check(server *srv, connection *con, mod_auth_plugin_data *p
{ S("cnonce=") },
{ S("nc=") },
{ S("response=") },
-
+
{ NULL, 0, NULL }
};
#undef S
-
+
dkv[0].ptr = &username;
dkv[1].ptr = &realm;
dkv[2].ptr = &nonce;
@@ -968,39 +779,41 @@ int http_auth_digest_check(server *srv, connection *con, mod_auth_plugin_data *p
dkv[6].ptr = &cnonce;
dkv[7].ptr = &nc;
dkv[8].ptr = &respons;
-
+ dkv[9].ptr = NULL;
+
UNUSED(req);
-
+
+ for (i = 0; dkv[i].key; i++) {
+ *(dkv[i].ptr) = NULL;
+ }
+
+
if (p->conf.auth_backend != AUTH_BACKEND_HTDIGEST &&
p->conf.auth_backend != AUTH_BACKEND_PLAIN) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"digest: unsupported backend (only htdigest or plain)");
-
+
return -1;
}
-
+
b = buffer_init_string(realm_str);
-
+
/* parse credentials from client */
for (c = b->ptr; *c; c++) {
- /* skip whitespaces */
- while (*c == ' ' || *c == '\t') c++;
- if (!*c) break;
-
for (i = 0; dkv[i].key; i++) {
if ((0 == strncmp(c, dkv[i].key, dkv[i].key_len))) {
- if ((c[dkv[i].key_len] == '"') &&
+ if ((c[dkv[i].key_len] == '"') &&
(NULL != (e = strchr(c + dkv[i].key_len + 1, '"')))) {
/* value with "..." */
*(dkv[i].ptr) = c + dkv[i].key_len + 1;
c = e;
-
+
*e = '\0';
} else if (NULL != (e = strchr(c + dkv[i].key_len, ','))) {
/* value without "...", terminated by ',' */
*(dkv[i].ptr) = c + dkv[i].key_len;
c = e;
-
+
*e = '\0';
} else {
/* value without "...", terminated by EOL */
@@ -1010,49 +823,34 @@ int http_auth_digest_check(server *srv, connection *con, mod_auth_plugin_data *p
}
}
}
-
+
if (p->conf.auth_debug > 1) {
log_error_write(srv, __FILE__, __LINE__, "ss", "username", username);
log_error_write(srv, __FILE__, __LINE__, "ss", "realm", realm);
log_error_write(srv, __FILE__, __LINE__, "ss", "nonce", nonce);
log_error_write(srv, __FILE__, __LINE__, "ss", "uri", uri);
- log_error_write(srv, __FILE__, __LINE__, "ss", "algorithm", algorithm);
+ log_error_write(srv, __FILE__, __LINE__, "ss", "algorigthm", algorithm);
log_error_write(srv, __FILE__, __LINE__, "ss", "qop", qop);
log_error_write(srv, __FILE__, __LINE__, "ss", "cnonce", cnonce);
log_error_write(srv, __FILE__, __LINE__, "ss", "nc", nc);
log_error_write(srv, __FILE__, __LINE__, "ss", "response", respons);
}
-
+
/* check if everything is transmitted */
- if (!username ||
+ if (!username ||
!realm ||
!nonce ||
!uri ||
- (qop && (!nc || !cnonce)) ||
+ (qop && !nc && !cnonce) ||
!respons ) {
/* missing field */
-
- log_error_write(srv, __FILE__, __LINE__, "s",
+
+ log_error_write(srv, __FILE__, __LINE__, "s",
"digest: missing field");
-
- buffer_free(b);
- return -1;
- }
-
- /**
- * protect the md5-sess against missing cnonce and nonce
- */
- if (algorithm &&
- 0 == strcasecmp(algorithm, "md5-sess") &&
- (!nonce || !cnonce)) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "digest: (md5-sess: missing field");
-
- buffer_free(b);
return -1;
}
- m = get_http_method_name(con->request.http_method);
+ m = get_http_method_name(con->request.http_method);
/* password-string == HA1 */
password = buffer_init();
@@ -1065,110 +863,108 @@ int http_auth_digest_check(server *srv, connection *con, mod_auth_plugin_data *p
buffer_free(realm_buf);
return 0;
}
-
+
buffer_free(username_buf);
buffer_free(realm_buf);
-
+
if (p->conf.auth_backend == AUTH_BACKEND_PLAIN) {
/* generate password from plain-text */
- li_MD5_Init(&Md5Ctx);
- li_MD5_Update(&Md5Ctx, (unsigned char *)username, strlen(username));
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)realm, strlen(realm));
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)password->ptr, password->used - 1);
- li_MD5_Final(HA1, &Md5Ctx);
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)username, strlen(username));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)realm, strlen(realm));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)password->ptr, password->used - 1);
+ MD5_Final(HA1, &Md5Ctx);
} else if (p->conf.auth_backend == AUTH_BACKEND_HTDIGEST) {
/* HA1 */
/* transform the 32-byte-hex-md5 to a 16-byte-md5 */
for (i = 0; i < HASHLEN; i++) {
- HA1[i] = hex2int(password->ptr[i*2]) << 4;
- HA1[i] |= hex2int(password->ptr[i*2+1]);
+ HA1[i] = hex2int(password->ptr[i*2]) << 4;
+ HA1[i] |= hex2int(password->ptr[i*2+1]);
}
} else {
/* we already check that above */
SEGFAULT();
}
-
+
buffer_free(password);
-
+
if (algorithm &&
strcasecmp(algorithm, "md5-sess") == 0) {
- li_MD5_Init(&Md5Ctx);
- /* Errata ID 1649: http://www.rfc-editor.org/errata_search.php?rfc=2617 */
- CvtHex(HA1, a1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)a1, 32);
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)nonce, strlen(nonce));
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)cnonce, strlen(cnonce));
- li_MD5_Final(HA1, &Md5Ctx);
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)HA1, 16);
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)nonce, strlen(nonce));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)cnonce, strlen(cnonce));
+ MD5_Final(HA1, &Md5Ctx);
}
-
+
CvtHex(HA1, a1);
-
+
/* calculate H(A2) */
- li_MD5_Init(&Md5Ctx);
- li_MD5_Update(&Md5Ctx, (unsigned char *)m, strlen(m));
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)uri, strlen(uri));
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)m, strlen(m));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)uri, strlen(uri));
if (qop && strcasecmp(qop, "auth-int") == 0) {
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)"", HASHHEXLEN);
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)"", HASHHEXLEN);
}
- li_MD5_Final(HA2, &Md5Ctx);
+ MD5_Final(HA2, &Md5Ctx);
CvtHex(HA2, HA2Hex);
-
+
/* calculate response */
- li_MD5_Init(&Md5Ctx);
- li_MD5_Update(&Md5Ctx, (unsigned char *)a1, HASHHEXLEN);
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)nonce, strlen(nonce));
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)a1, HASHHEXLEN);
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)nonce, strlen(nonce));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
if (qop && *qop) {
- li_MD5_Update(&Md5Ctx, (unsigned char *)nc, strlen(nc));
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)cnonce, strlen(cnonce));
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)qop, strlen(qop));
- li_MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)nc, strlen(nc));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)cnonce, strlen(cnonce));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)qop, strlen(qop));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
};
- li_MD5_Update(&Md5Ctx, (unsigned char *)HA2Hex, HASHHEXLEN);
- li_MD5_Final(RespHash, &Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)HA2Hex, HASHHEXLEN);
+ MD5_Final(RespHash, &Md5Ctx);
CvtHex(RespHash, a2);
-
+
if (0 != strcmp(a2, respons)) {
/* digest not ok */
-
+
if (p->conf.auth_debug) {
- log_error_write(srv, __FILE__, __LINE__, "sss",
+ log_error_write(srv, __FILE__, __LINE__, "sss",
"digest: digest mismatch", a2, respons);
}
-
- log_error_write(srv, __FILE__, __LINE__, "ssss",
- "digest: auth failed for ", username, ": wrong password, IP:", inet_ntop_cache_get_ip(srv, &(con->dst_addr)));
-
+
+ log_error_write(srv, __FILE__, __LINE__, "sss",
+ "digest: auth failed for", username, "wrong password");
+
buffer_free(b);
return 0;
}
-
+
/* value is our allow-rules */
if (http_auth_match_rules(srv, p, url->ptr, username, NULL, NULL)) {
buffer_free(b);
-
- log_error_write(srv, __FILE__, __LINE__, "s",
+
+ log_error_write(srv, __FILE__, __LINE__, "s",
"digest: rules did match");
-
+
return 0;
}
-
+
/* remember the username */
buffer_copy_string(p->auth_user, username);
-
+
buffer_free(b);
-
+
if (p->conf.auth_debug) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"digest: auth ok");
}
return 1;
@@ -1177,26 +973,25 @@ int http_auth_digest_check(server *srv, connection *con, mod_auth_plugin_data *p
int http_auth_digest_generate_nonce(server *srv, mod_auth_plugin_data *p, buffer *fn, char out[33]) {
HASH h;
- li_MD5_CTX Md5Ctx;
+ MD5_CTX Md5Ctx;
char hh[32];
-
+
UNUSED(p);
/* generate shared-secret */
- li_MD5_Init(&Md5Ctx);
- li_MD5_Update(&Md5Ctx, (unsigned char *)fn->ptr, fn->used - 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)"+", 1);
-
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)fn->ptr, fn->used - 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)"+", 1);
+
/* we assume sizeof(time_t) == 4 here, but if not it ain't a problem at all */
- LI_ltostr(hh, srv->cur_ts);
- li_MD5_Update(&Md5Ctx, (unsigned char *)hh, strlen(hh));
- li_MD5_Update(&Md5Ctx, (unsigned char *)srv->entropy, sizeof(srv->entropy));
- LI_ltostr(hh, rand());
- li_MD5_Update(&Md5Ctx, (unsigned char *)hh, strlen(hh));
-
- li_MD5_Final(h, &Md5Ctx);
-
+ ltostr(hh, srv->cur_ts);
+ MD5_Update(&Md5Ctx, (unsigned char *)hh, strlen(hh));
+ ltostr(hh, rand());
+ MD5_Update(&Md5Ctx, (unsigned char *)hh, strlen(hh));
+
+ MD5_Final(h, &Md5Ctx);
+
CvtHex(h, out);
-
+
return 0;
}
diff --git a/src/http_auth.h b/src/http_auth.h
index 5828a7e..0b664fa 100644
--- a/src/http_auth.h
+++ b/src/http_auth.h
@@ -9,26 +9,22 @@
# include <ldap.h>
#endif
-typedef enum {
- AUTH_BACKEND_UNSET,
- AUTH_BACKEND_PLAIN,
- AUTH_BACKEND_LDAP,
- AUTH_BACKEND_HTPASSWD,
- AUTH_BACKEND_HTDIGEST
-} auth_backend_t;
+typedef enum { AUTH_BACKEND_UNSET, AUTH_BACKEND_PLAIN,
+ AUTH_BACKEND_LDAP, AUTH_BACKEND_HTPASSWD,
+ AUTH_BACKEND_HTDIGEST, AUTH_BACKEND_PAM } auth_backend_t;
typedef struct {
/* auth */
array *auth_require;
-
+
buffer *auth_plain_groupfile;
buffer *auth_plain_userfile;
-
+
buffer *auth_htdigest_userfile;
buffer *auth_htpasswd_userfile;
-
+
buffer *auth_backend_conf;
-
+
buffer *auth_ldap_hostname;
buffer *auth_ldap_basedn;
buffer *auth_ldap_binddn;
@@ -36,16 +32,15 @@ typedef struct {
buffer *auth_ldap_filter;
buffer *auth_ldap_cafile;
unsigned short auth_ldap_starttls;
- unsigned short auth_ldap_allow_empty_pw;
-
+
unsigned short auth_debug;
-
+
/* generated */
auth_backend_t auth_backend;
-
+
#ifdef USE_LDAP
LDAP *ldap;
-
+
buffer *ldap_filter_pre;
buffer *ldap_filter_post;
#endif
@@ -54,16 +49,16 @@ typedef struct {
typedef struct {
PLUGIN_DATA;
buffer *tmp_buf;
-
+
buffer *auth_user;
#ifdef USE_LDAP
buffer *ldap_filter;
#endif
-
+
mod_auth_plugin_config **config_storage;
-
- mod_auth_plugin_config conf, *anon_conf; /* this is only used as long as no handler_ctx is setup */
+
+ mod_auth_plugin_config conf; /* this is only used as long as no handler_ctx is setup */
} mod_auth_plugin_data;
int http_auth_basic_check(server *srv, connection *con, mod_auth_plugin_data *p, array *req, buffer *url, const char *realm_str);
diff --git a/src/http_auth_digest.c b/src/http_auth_digest.c
new file mode 100644
index 0000000..8f7086f
--- /dev/null
+++ b/src/http_auth_digest.c
@@ -0,0 +1,101 @@
+#include <string.h>
+#include "http_auth_digest.h"
+
+#include "buffer.h"
+
+#ifndef USE_OPENSSL
+# include "md5.h"
+#endif
+
+void CvtHex(IN HASH Bin, OUT HASHHEX Hex) {
+ unsigned short i;
+
+ for (i = 0; i < HASHLEN; i++) {
+ Hex[i*2] = int2hex((Bin[i] >> 4) & 0xf);
+ Hex[i*2+1] = int2hex(Bin[i] & 0xf);
+ }
+ Hex[HASHHEXLEN] = '\0';
+}
+
+/* calculate H(A1) as per spec */
+void DigestCalcHA1(
+ IN char * pszAlg,
+ IN char * pszUserName,
+ IN char * pszRealm,
+ IN char * pszPassword,
+ IN char * pszNonce,
+ IN char * pszCNonce,
+ OUT HASHHEX SessionKey
+ )
+{
+ MD5_CTX Md5Ctx;
+ HASH HA1;
+
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)pszUserName, strlen(pszUserName));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)pszRealm, strlen(pszRealm));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)pszPassword, strlen(pszPassword));
+ MD5_Final(HA1, &Md5Ctx);
+ if (strcasecmp(pszAlg, "md5-sess") == 0) {
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)HA1, HASHLEN);
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)pszNonce, strlen(pszNonce));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)pszCNonce, strlen(pszCNonce));
+ MD5_Final(HA1, &Md5Ctx);
+ }
+ CvtHex(HA1, SessionKey);
+}
+
+/* calculate request-digest/response-digest as per HTTP Digest spec */
+void DigestCalcResponse(
+ IN HASHHEX HA1, /* H(A1) */
+ IN char * pszNonce, /* nonce from server */
+ IN char * pszNonceCount, /* 8 hex digits */
+ IN char * pszCNonce, /* client nonce */
+ IN char * pszQop, /* qop-value: "", "auth", "auth-int" */
+ IN char * pszMethod, /* method from the request */
+ IN char * pszDigestUri, /* requested URL */
+ IN HASHHEX HEntity, /* H(entity body) if qop="auth-int" */
+ OUT HASHHEX Response /* request-digest or response-digest */
+ )
+{
+ MD5_CTX Md5Ctx;
+ HASH HA2;
+ HASH RespHash;
+ HASHHEX HA2Hex;
+
+ /* calculate H(A2) */
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)pszMethod, strlen(pszMethod));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)pszDigestUri, strlen(pszDigestUri));
+ if (strcasecmp(pszQop, "auth-int") == 0) {
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)HEntity, HASHHEXLEN);
+ };
+ MD5_Final(HA2, &Md5Ctx);
+ CvtHex(HA2, HA2Hex);
+
+ /* calculate response */
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)HA1, HASHHEXLEN);
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)pszNonce, strlen(pszNonce));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ if (*pszQop) {
+ MD5_Update(&Md5Ctx, (unsigned char *)pszNonceCount, strlen(pszNonceCount));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)pszCNonce, strlen(pszCNonce));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)pszQop, strlen(pszQop));
+ MD5_Update(&Md5Ctx, (unsigned char *)":", 1);
+ }
+ MD5_Update(&Md5Ctx, (unsigned char *)HA2Hex, HASHHEXLEN);
+ MD5_Final(RespHash, &Md5Ctx);
+ CvtHex(RespHash, Response);
+}
+
diff --git a/src/http_auth_digest.h b/src/http_auth_digest.h
new file mode 100644
index 0000000..3f11d70
--- /dev/null
+++ b/src/http_auth_digest.h
@@ -0,0 +1,48 @@
+#ifndef _DIGCALC_H_
+#define _DIGCALC_H_
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define HASHLEN 16
+typedef unsigned char HASH[HASHLEN];
+#define HASHHEXLEN 32
+typedef char HASHHEX[HASHHEXLEN+1];
+#ifdef USE_OPENSSL
+#define IN const
+#else
+#define IN
+#endif
+#define OUT
+
+/* calculate H(A1) as per HTTP Digest spec */
+void DigestCalcHA1(
+ IN char * pszAlg,
+ IN char * pszUserName,
+ IN char * pszRealm,
+ IN char * pszPassword,
+ IN char * pszNonce,
+ IN char * pszCNonce,
+ OUT HASHHEX SessionKey
+ );
+
+/* calculate request-digest/response-digest as per HTTP Digest spec */
+void DigestCalcResponse(
+ IN HASHHEX HA1, /* H(A1) */
+ IN char * pszNonce, /* nonce from server */
+ IN char * pszNonceCount, /* 8 hex digits */
+ IN char * pszCNonce, /* client nonce */
+ IN char * pszQop, /* qop-value: "", "auth", "auth-int" */
+ IN char * pszMethod, /* method from the request */
+ IN char * pszDigestUri, /* requested URL */
+ IN HASHHEX HEntity, /* H(entity body) if qop="auth-int" */
+ OUT HASHHEX Response /* request-digest or response-digest */
+ );
+
+void CvtHex(
+ IN HASH Bin,
+ OUT HASHHEX Hex
+ );
+
+#endif
diff --git a/src/http_chunk.c b/src/http_chunk.c
index 5557edc..c128bf1 100644
--- a/src/http_chunk.c
+++ b/src/http_chunk.c
@@ -1,14 +1,9 @@
/**
* the HTTP chunk-API
- *
- *
+ *
+ *
*/
-#include "server.h"
-#include "chunk.h"
-#include "http_chunk.h"
-#include "log.h"
-
#include <sys/types.h>
#include <sys/stat.h>
@@ -20,22 +15,27 @@
#include <errno.h>
#include <string.h>
+#include "server.h"
+#include "chunk.h"
+#include "http_chunk.h"
+#include "log.h"
+
static int http_chunk_append_len(server *srv, connection *con, size_t len) {
size_t i, olen = len, j;
buffer *b;
-
+
b = srv->tmp_chunk_len;
-
+
if (len == 0) {
- buffer_copy_string_len(b, CONST_STR_LEN("0"));
+ buffer_copy_string(b, "0");
} else {
for (i = 0; i < 8 && len; i++) {
len >>= 4;
}
-
+
/* i is the number of hex digits we have */
buffer_prepare_copy(b, i + 1);
-
+
for (j = i-1, len = olen; j+1 > 0; j--) {
b->ptr[j] = (len & 0xf) + (((len & 0xf) <= 9) ? '0' : 'a' - 10);
len >>= 4;
@@ -43,80 +43,81 @@ static int http_chunk_append_len(server *srv, connection *con, size_t len) {
b->used = i;
b->ptr[b->used++] = '\0';
}
-
- buffer_append_string_len(b, CONST_STR_LEN("\r\n"));
+
+ buffer_append_string(b, "\r\n");
chunkqueue_append_buffer(con->write_queue, b);
-
+
return 0;
}
int http_chunk_append_file(server *srv, connection *con, buffer *fn, off_t offset, off_t len) {
chunkqueue *cq;
-
+
if (!con) return -1;
-
+
cq = con->write_queue;
-
+
if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
http_chunk_append_len(srv, con, len);
}
-
+
chunkqueue_append_file(cq, fn, offset, len);
-
+
if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED && len > 0) {
chunkqueue_append_mem(cq, "\r\n", 2 + 1);
}
-
+
return 0;
}
int http_chunk_append_buffer(server *srv, connection *con, buffer *mem) {
chunkqueue *cq;
-
+
if (!con) return -1;
-
+
cq = con->write_queue;
-
+
if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
http_chunk_append_len(srv, con, mem->used - 1);
}
-
+
chunkqueue_append_buffer(cq, mem);
-
+
if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED && mem->used > 0) {
chunkqueue_append_mem(cq, "\r\n", 2 + 1);
}
-
+
return 0;
}
int http_chunk_append_mem(server *srv, connection *con, const char * mem, size_t len) {
chunkqueue *cq;
-
+
if (!con) return -1;
-
+
cq = con->write_queue;
-
+
if (len == 0) {
if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
- chunkqueue_append_mem(cq, "0\r\n\r\n", 5 + 1);
+ http_chunk_append_len(srv, con, 0);
+ chunkqueue_append_mem(cq, "\r\n", 2 + 1);
} else {
chunkqueue_append_mem(cq, "", 1);
}
return 0;
}
-
+
if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
http_chunk_append_len(srv, con, len - 1);
}
-
+
chunkqueue_append_mem(cq, mem, len);
-
+
if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
chunkqueue_append_mem(cq, "\r\n", 2 + 1);
}
-
+
return 0;
}
@@ -124,9 +125,9 @@ int http_chunk_append_mem(server *srv, connection *con, const char * mem, size_t
off_t http_chunkqueue_length(server *srv, connection *con) {
if (!con) {
log_error_write(srv, __FILE__, __LINE__, "s", "connection is NULL!!");
-
+
return 0;
}
-
+
return chunkqueue_length(con->write_queue);
}
diff --git a/src/inet_ntop_cache.c b/src/inet_ntop_cache.c
index eac0681..c0b3aa1 100644
--- a/src/inet_ntop_cache.c
+++ b/src/inet_ntop_cache.c
@@ -1,16 +1,17 @@
-#include "base.h"
-#include "inet_ntop_cache.h"
-#include "sys-socket.h"
-
#include <sys/types.h>
#include <string.h>
+
+#include "base.h"
+#include "inet_ntop_cache.h"
+#include "sys-socket.h"
+
const char * inet_ntop_cache_get_ip(server *srv, sock_addr *addr) {
-#ifdef HAVE_IPV6
+#ifdef HAVE_IPV6
size_t ndx = 0, i;
for (i = 0; i < INET_NTOP_CACHE_MAX; i++) {
- if (srv->inet_ntop_cache[i].ts != 0 && srv->inet_ntop_cache[i].family == addr->plain.sa_family) {
+ if (srv->inet_ntop_cache[i].ts != 0) {
if (srv->inet_ntop_cache[i].family == AF_INET6 &&
0 == memcmp(srv->inet_ntop_cache[i].addr.ipv6.s6_addr, addr->ipv6.sin6_addr.s6_addr, 16)) {
/* IPv6 found in cache */
@@ -19,31 +20,31 @@ const char * inet_ntop_cache_get_ip(server *srv, sock_addr *addr) {
srv->inet_ntop_cache[i].addr.ipv4.s_addr == addr->ipv4.sin_addr.s_addr) {
/* IPv4 found in cache */
break;
-
+
}
}
}
-
+
if (i == INET_NTOP_CACHE_MAX) {
/* not found in cache */
-
+
i = ndx;
- inet_ntop(addr->plain.sa_family,
- addr->plain.sa_family == AF_INET6 ?
+ inet_ntop(addr->plain.sa_family,
+ addr->plain.sa_family == AF_INET6 ?
(const void *) &(addr->ipv6.sin6_addr) :
(const void *) &(addr->ipv4.sin_addr),
srv->inet_ntop_cache[i].b2, INET6_ADDRSTRLEN);
-
+
srv->inet_ntop_cache[i].ts = srv->cur_ts;
srv->inet_ntop_cache[i].family = addr->plain.sa_family;
-
+
if (srv->inet_ntop_cache[i].family == AF_INET) {
srv->inet_ntop_cache[i].addr.ipv4.s_addr = addr->ipv4.sin_addr.s_addr;
} else if (srv->inet_ntop_cache[i].family == AF_INET6) {
memcpy(srv->inet_ntop_cache[i].addr.ipv6.s6_addr, addr->ipv6.sin6_addr.s6_addr, 16);
}
}
-
+
return srv->inet_ntop_cache[i].b2;
#else
UNUSED(srv);
diff --git a/src/joblist.c b/src/joblist.c
index 677a1a5..dcab955 100644
--- a/src/joblist.c
+++ b/src/joblist.c
@@ -1,13 +1,13 @@
+#include <stdlib.h>
+#include <string.h>
+
#include "base.h"
#include "joblist.h"
#include "log.h"
-#include <stdlib.h>
-#include <string.h>
-
int joblist_append(server *srv, connection *con) {
if (con->in_joblist) return 0;
-
+
if (srv->joblist->size == 0) {
srv->joblist->size = 16;
srv->joblist->ptr = malloc(sizeof(*srv->joblist->ptr) * srv->joblist->size);
@@ -15,15 +15,15 @@ int joblist_append(server *srv, connection *con) {
srv->joblist->size += 16;
srv->joblist->ptr = realloc(srv->joblist->ptr, sizeof(*srv->joblist->ptr) * srv->joblist->size);
}
-
+
srv->joblist->ptr[srv->joblist->used++] = con;
-
+
return 0;
}
void joblist_free(server *srv, connections *joblist) {
UNUSED(srv);
-
+
free(joblist->ptr);
free(joblist);
}
@@ -31,14 +31,14 @@ void joblist_free(server *srv, connections *joblist) {
connection *fdwaitqueue_unshift(server *srv, connections *fdwaitqueue) {
connection *con;
UNUSED(srv);
-
-
+
+
if (fdwaitqueue->used == 0) return NULL;
-
+
con = fdwaitqueue->ptr[0];
-
+
memmove(fdwaitqueue->ptr, &(fdwaitqueue->ptr[1]), --fdwaitqueue->used * sizeof(*(fdwaitqueue->ptr)));
-
+
return con;
}
@@ -50,9 +50,9 @@ int fdwaitqueue_append(server *srv, connection *con) {
srv->fdwaitqueue->size += 16;
srv->fdwaitqueue->ptr = realloc(srv->fdwaitqueue->ptr, sizeof(*(srv->fdwaitqueue->ptr)) * srv->fdwaitqueue->size);
}
-
+
srv->fdwaitqueue->ptr[srv->fdwaitqueue->used++] = con;
-
+
return 0;
}
diff --git a/src/keyvalue.c b/src/keyvalue.c
index 8ca739b..c438a43 100644
--- a/src/keyvalue.c
+++ b/src/keyvalue.c
@@ -1,11 +1,10 @@
-#include "server.h"
-#include "keyvalue.h"
-#include "log.h"
-
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include "server.h"
+#include "keyvalue.h"
+
static keyvalue http_versions[] = {
{ HTTP_VERSION_1_1, "HTTP/1.1" },
{ HTTP_VERSION_1_0, "HTTP/1.0" },
@@ -28,13 +27,8 @@ static keyvalue http_methods[] = {
{ HTTP_METHOD_LABEL, "LABEL" },
{ HTTP_METHOD_CHECKOUT, "CHECKOUT" },
{ HTTP_METHOD_CHECKIN, "CHECKIN" },
- { HTTP_METHOD_MERGE, "MERGE" },
- { HTTP_METHOD_LOCK, "LOCK" },
- { HTTP_METHOD_UNLOCK, "UNLOCK" },
- { HTTP_METHOD_MKACTIVITY, "MKACTIVITY" },
{ HTTP_METHOD_UNCHECKOUT, "UNCHECKOUT" },
{ HTTP_METHOD_VERSION_CONTROL, "VERSION-CONTROL" },
- { HTTP_METHOD_CONNECT, "CONNECT" },
{ HTTP_METHOD_UNSET, NULL }
};
@@ -88,7 +82,7 @@ static keyvalue http_status[] = {
{ 504, "Gateway Timeout" },
{ 505, "HTTP Version Not Supported" },
{ 507, "Insufficient Storage" }, /* WebDAV */
-
+
{ -1, NULL }
};
@@ -103,12 +97,12 @@ static keyvalue http_status_body[] = {
{ 501, "501.html" },
{ 503, "503.html" },
{ 505, "505.html" },
-
+
{ -1, NULL }
};
-const char *keyvalue_get_value(keyvalue *kv, int k) {
+const char *keyvalue_get_value(keyvalue *kv, int k) {
int i;
for (i = 0; kv[i].value; i++) {
if (kv[i].key == k) return kv[i].value;
@@ -116,7 +110,7 @@ const char *keyvalue_get_value(keyvalue *kv, int k) {
return NULL;
}
-int keyvalue_get_key(keyvalue *kv, const char *s) {
+int keyvalue_get_key(keyvalue *kv, const char *s) {
int i;
for (i = 0; kv[i].value; i++) {
if (0 == strcmp(kv[i].value, s)) return kv[i].key;
@@ -126,9 +120,9 @@ int keyvalue_get_key(keyvalue *kv, const char *s) {
keyvalue_buffer *keyvalue_buffer_init(void) {
keyvalue_buffer *kvb;
-
+
kvb = calloc(1, sizeof(*kvb));
-
+
return kvb;
}
@@ -136,49 +130,49 @@ int keyvalue_buffer_append(keyvalue_buffer *kvb, int key, const char *value) {
size_t i;
if (kvb->size == 0) {
kvb->size = 4;
-
+
kvb->kv = malloc(kvb->size * sizeof(*kvb->kv));
-
+
for(i = 0; i < kvb->size; i++) {
kvb->kv[i] = calloc(1, sizeof(**kvb->kv));
}
} else if (kvb->used == kvb->size) {
kvb->size += 4;
-
+
kvb->kv = realloc(kvb->kv, kvb->size * sizeof(*kvb->kv));
-
+
for(i = kvb->used; i < kvb->size; i++) {
kvb->kv[i] = calloc(1, sizeof(**kvb->kv));
}
}
-
+
kvb->kv[kvb->used]->key = key;
kvb->kv[kvb->used]->value = strdup(value);
-
+
kvb->used++;
-
+
return 0;
}
void keyvalue_buffer_free(keyvalue_buffer *kvb) {
size_t i;
-
+
for (i = 0; i < kvb->size; i++) {
if (kvb->kv[i]->value) free(kvb->kv[i]->value);
free(kvb->kv[i]);
}
-
+
if (kvb->kv) free(kvb->kv);
-
+
free(kvb);
}
s_keyvalue_buffer *s_keyvalue_buffer_init(void) {
s_keyvalue_buffer *kvb;
-
+
kvb = calloc(1, sizeof(*kvb));
-
+
return kvb;
}
@@ -187,50 +181,50 @@ int s_keyvalue_buffer_append(s_keyvalue_buffer *kvb, const char *key, const char
if (kvb->size == 0) {
kvb->size = 4;
kvb->used = 0;
-
+
kvb->kv = malloc(kvb->size * sizeof(*kvb->kv));
-
+
for(i = 0; i < kvb->size; i++) {
kvb->kv[i] = calloc(1, sizeof(**kvb->kv));
}
} else if (kvb->used == kvb->size) {
kvb->size += 4;
-
+
kvb->kv = realloc(kvb->kv, kvb->size * sizeof(*kvb->kv));
-
+
for(i = kvb->used; i < kvb->size; i++) {
kvb->kv[i] = calloc(1, sizeof(**kvb->kv));
}
}
-
+
kvb->kv[kvb->used]->key = key ? strdup(key) : NULL;
kvb->kv[kvb->used]->value = strdup(value);
-
+
kvb->used++;
-
+
return 0;
}
void s_keyvalue_buffer_free(s_keyvalue_buffer *kvb) {
size_t i;
-
+
for (i = 0; i < kvb->size; i++) {
if (kvb->kv[i]->key) free(kvb->kv[i]->key);
if (kvb->kv[i]->value) free(kvb->kv[i]->value);
free(kvb->kv[i]);
}
-
+
if (kvb->kv) free(kvb->kv);
-
+
free(kvb);
}
httpauth_keyvalue_buffer *httpauth_keyvalue_buffer_init(void) {
httpauth_keyvalue_buffer *kvb;
-
+
kvb = calloc(1, sizeof(*kvb));
-
+
return kvb;
}
@@ -238,42 +232,42 @@ int httpauth_keyvalue_buffer_append(httpauth_keyvalue_buffer *kvb, const char *k
size_t i;
if (kvb->size == 0) {
kvb->size = 4;
-
+
kvb->kv = malloc(kvb->size * sizeof(*kvb->kv));
-
+
for(i = 0; i < kvb->size; i++) {
kvb->kv[i] = calloc(1, sizeof(**kvb->kv));
}
} else if (kvb->used == kvb->size) {
kvb->size += 4;
-
+
kvb->kv = realloc(kvb->kv, kvb->size * sizeof(*kvb->kv));
-
+
for(i = kvb->used; i < kvb->size; i++) {
kvb->kv[i] = calloc(1, sizeof(**kvb->kv));
}
}
-
+
kvb->kv[kvb->used]->key = strdup(key);
kvb->kv[kvb->used]->realm = strdup(realm);
kvb->kv[kvb->used]->type = type;
-
+
kvb->used++;
-
+
return 0;
}
void httpauth_keyvalue_buffer_free(httpauth_keyvalue_buffer *kvb) {
size_t i;
-
+
for (i = 0; i < kvb->size; i++) {
if (kvb->kv[i]->key) free(kvb->kv[i]->key);
if (kvb->kv[i]->realm) free(kvb->kv[i]->realm);
free(kvb->kv[i]);
}
-
+
if (kvb->kv) free(kvb->kv);
-
+
free(kvb);
}
@@ -307,60 +301,59 @@ http_method_t get_http_method_key(const char *s) {
pcre_keyvalue_buffer *pcre_keyvalue_buffer_init(void) {
pcre_keyvalue_buffer *kvb;
-
+
kvb = calloc(1, sizeof(*kvb));
-
+
return kvb;
}
-int pcre_keyvalue_buffer_append(server *srv, pcre_keyvalue_buffer *kvb, const char *key, const char *value) {
+int pcre_keyvalue_buffer_append(pcre_keyvalue_buffer *kvb, const char *key, const char *value) {
#ifdef HAVE_PCRE_H
size_t i;
const char *errptr;
int erroff;
pcre_keyvalue *kv;
#endif
-
+
if (!key) return -1;
#ifdef HAVE_PCRE_H
if (kvb->size == 0) {
kvb->size = 4;
kvb->used = 0;
-
+
kvb->kv = malloc(kvb->size * sizeof(*kvb->kv));
-
+
for(i = 0; i < kvb->size; i++) {
kvb->kv[i] = calloc(1, sizeof(**kvb->kv));
}
} else if (kvb->used == kvb->size) {
kvb->size += 4;
-
+
kvb->kv = realloc(kvb->kv, kvb->size * sizeof(*kvb->kv));
-
+
for(i = kvb->used; i < kvb->size; i++) {
kvb->kv[i] = calloc(1, sizeof(**kvb->kv));
}
}
-
+
kv = kvb->kv[kvb->used];
if (NULL == (kv->key = pcre_compile(key,
0, &errptr, &erroff, NULL))) {
-
- log_error_write(srv, __FILE__, __LINE__, "SS",
- "rexexp compilation error at ", errptr);
+
+ fprintf(stderr, "%s.%d: rexexp compilation error at %s\n", __FILE__, __LINE__, errptr);
return -1;
}
- if (NULL == (kv->key_extra = pcre_study(kv->key, 0, &errptr)) &&
+ if (NULL == (kv->key_extra = pcre_study(kv->key, 0, &errptr)) &&
errptr != NULL) {
return -1;
}
-
+
kv->value = buffer_init_string(value);
-
+
kvb->used++;
-
+
return 0;
#else
UNUSED(kvb);
@@ -382,9 +375,9 @@ void pcre_keyvalue_buffer_free(pcre_keyvalue_buffer *kvb) {
if (kv->value) buffer_free(kv->value);
free(kv);
}
-
+
if (kvb->kv) free(kvb->kv);
#endif
-
+
free(kvb);
}
diff --git a/src/keyvalue.h b/src/keyvalue.h
index 209b2cf..7c78037 100644
--- a/src/keyvalue.h
+++ b/src/keyvalue.h
@@ -2,52 +2,45 @@
#define _KEY_VALUE_H_
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
#endif
#ifdef HAVE_PCRE_H
# include <pcre.h>
#endif
-struct server;
-
-typedef enum {
- HTTP_METHOD_UNSET = -1,
- HTTP_METHOD_GET,
- HTTP_METHOD_POST,
- HTTP_METHOD_HEAD,
- HTTP_METHOD_OPTIONS,
+typedef enum {
+ HTTP_METHOD_UNSET = -1,
+ HTTP_METHOD_GET,
+ HTTP_METHOD_POST,
+ HTTP_METHOD_HEAD,
+ HTTP_METHOD_OPTIONS,
HTTP_METHOD_PROPFIND, /* WebDAV */
- HTTP_METHOD_MKCOL,
- HTTP_METHOD_PUT,
- HTTP_METHOD_DELETE,
- HTTP_METHOD_COPY,
- HTTP_METHOD_MOVE,
- HTTP_METHOD_PROPPATCH,
+ HTTP_METHOD_MKCOL,
+ HTTP_METHOD_PUT,
+ HTTP_METHOD_DELETE,
+ HTTP_METHOD_COPY,
+ HTTP_METHOD_MOVE,
+ HTTP_METHOD_PROPPATCH,
HTTP_METHOD_REPORT, /* DeltaV */
HTTP_METHOD_CHECKOUT,
HTTP_METHOD_CHECKIN,
HTTP_METHOD_VERSION_CONTROL,
HTTP_METHOD_UNCHECKOUT,
- HTTP_METHOD_MKACTIVITY,
- HTTP_METHOD_MERGE,
- HTTP_METHOD_LOCK,
- HTTP_METHOD_UNLOCK,
- HTTP_METHOD_LABEL,
- HTTP_METHOD_CONNECT
+ HTTP_METHOD_LABEL
} http_method_t;
typedef enum { HTTP_VERSION_UNSET = -1, HTTP_VERSION_1_0, HTTP_VERSION_1_1 } http_version_t;
typedef struct {
int key;
-
+
char *value;
} keyvalue;
typedef struct {
char *key;
-
+
char *value;
} s_keyvalue;
@@ -56,7 +49,7 @@ typedef struct {
pcre *key;
pcre_extra *key_extra;
#endif
-
+
buffer *value;
} pcre_keyvalue;
@@ -64,7 +57,7 @@ typedef enum { HTTP_AUTH_BASIC, HTTP_AUTH_DIGEST } httpauth_type;
typedef struct {
char *key;
-
+
char *realm;
httpauth_type type;
} httpauth_keyvalue;
@@ -104,7 +97,7 @@ int httpauth_keyvalue_buffer_append(httpauth_keyvalue_buffer *kvb, const char *k
void httpauth_keyvalue_buffer_free(httpauth_keyvalue_buffer *kvb);
pcre_keyvalue_buffer *pcre_keyvalue_buffer_init(void);
-int pcre_keyvalue_buffer_append(struct server *srv, pcre_keyvalue_buffer *kvb, const char *key, const char *value);
+int pcre_keyvalue_buffer_append(pcre_keyvalue_buffer *kvb, const char *key, const char *value);
void pcre_keyvalue_buffer_free(pcre_keyvalue_buffer *kvb);
#endif
diff --git a/src/lemon.c b/src/lemon.c
index 48df45f..dd87cdf 100644
--- a/src/lemon.c
+++ b/src/lemon.c
@@ -12,26 +12,12 @@
#include <ctype.h>
#include <stdlib.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-
-#define UNUSED(x) ( (void)(x) )
-
extern void qsort();
extern double strtod();
extern long strtol();
extern void free();
extern int access();
extern int atoi();
-extern char *getenv();
#ifndef __WIN32__
# if defined(_WIN32) || defined(WIN32)
@@ -39,14 +25,8 @@ extern char *getenv();
# endif
#endif
-#if __GNUC__ > 2
-#define NORETURN __attribute__ ((__noreturn__))
-#else
-#define NORETURN
-#endif
-
/* #define PRIVATE static */
-#define PRIVATE static
+#define PRIVATE
#ifdef TEST
#define MAXRHS 5 /* Set low to exercise exception code */
@@ -57,15 +37,13 @@ extern char *getenv();
char *msort();
extern void *malloc();
-extern void memory_error() NORETURN;
-
/******** From the file "action.h" *************************************/
struct action *Action_new();
struct action *Action_sort();
void Action_add();
/********* From the file "assert.h" ************************************/
-void myassert() NORETURN;
+void myassert();
#ifndef NDEBUG
# define assert(X) if(!(X))myassert(__FILE__,__LINE__)
#else
@@ -300,6 +278,7 @@ struct lemon {
};
#define MemoryCheck(X) if((X)==0){ \
+ extern void memory_error(); \
memory_error(); \
}
@@ -453,16 +432,14 @@ struct acttab {
#define acttab_yylookahead(X,N) ((X)->aAction[N].lookahead)
/* Free all memory associated with the given acttab */
-/*
-PRIVATE void acttab_free(acttab *p){
+void acttab_free(acttab *p){
free( p->aAction );
free( p->aLookahead );
free( p );
}
-*/
/* Allocate a new acttab structure */
-PRIVATE acttab *acttab_alloc(void){
+acttab *acttab_alloc(void){
acttab *p = malloc( sizeof(*p) );
if( p==0 ){
fprintf(stderr,"Unable to allocate memory for a new acttab.");
@@ -474,7 +451,7 @@ PRIVATE acttab *acttab_alloc(void){
/* Add a new action to the current transaction set
*/
-PRIVATE void acttab_action(acttab *p, int lookahead, int action){
+void acttab_action(acttab *p, int lookahead, int action){
if( p->nLookahead>=p->nLookaheadAlloc ){
p->nLookaheadAlloc += 25;
p->aLookahead = realloc( p->aLookahead,
@@ -507,7 +484,7 @@ PRIVATE void acttab_action(acttab *p, int lookahead, int action){
**
** Return the offset into the action table of the new transaction.
*/
-PRIVATE int acttab_insert(acttab *p){
+int acttab_insert(acttab *p){
int i, j, k, n;
assert( p->nLookahead>0 );
@@ -602,7 +579,7 @@ int line;
*/
/* Find a precedence symbol of every rule in the grammar.
-**
+**
** Those rules which have a precedence symbol coded in the input
** grammar using the "[symbol]" construct will already have the
** rp->precsym field filled. Other rules take as their precedence
@@ -892,7 +869,7 @@ struct lemon *lemp;
cfp->status = INCOMPLETE;
}
}
-
+
do{
progress = 0;
for(i=0; i<lemp->nstate; i++){
@@ -923,7 +900,7 @@ struct lemon *lemp;
struct symbol *sp;
struct rule *rp;
- /* Add all of the reduce actions
+ /* Add all of the reduce actions
** A reduce action is added for each element of the followset of
** a configuration which has its dot at the extreme right.
*/
@@ -1006,7 +983,6 @@ struct symbol *errsym; /* The error symbol (if defined. NULL otherwise) */
{
struct symbol *spx, *spy;
int errcnt = 0;
- UNUSED(errsym);
assert( apx->sp==apy->sp ); /* Otherwise there would be no conflict */
if( apx->type==SHIFT && apy->type==REDUCE ){
spx = apx->sp;
@@ -1041,7 +1017,7 @@ struct symbol *errsym; /* The error symbol (if defined. NULL otherwise) */
apx->type = RD_RESOLVED;
}
}else{
- assert(
+ assert(
apx->type==SH_RESOLVED ||
apx->type==RD_RESOLVED ||
apx->type==CONFLICT ||
@@ -1339,7 +1315,7 @@ void ErrorMsg(const char *filename, int lineno, const char *format, ...){
/* Report an out-of-memory condition and abort. This function
** is used mostly by the "MemoryCheck" macro in struct.h
*/
-void memory_error() {
+void memory_error(){
fprintf(stderr,"Out of memory. Aborting...\n");
exit(1);
}
@@ -1371,11 +1347,10 @@ char **argv;
struct lemon lem;
char *def_tmpl_name = "lempar.c";
- UNUSED(argc);
OptInit(argv,options,stderr);
if( version ){
printf("Lemon version 1.0\n");
- exit(0);
+ exit(0);
}
if( OptNArgs() < 1 ){
fprintf(stderr,"Exactly one filename argument is required.\n");
@@ -1614,6 +1589,7 @@ int k;
FILE *err;
{
int spcnt, i;
+ spcnt = 0;
if( argv[0] ) fprintf(err,"%s",argv[0]);
spcnt = strlen(argv[0]) + 1;
for(i=1; i<n && argv[i]; i++){
@@ -1675,7 +1651,7 @@ FILE *err;
}else if( op[j].type==OPT_FLAG ){
*((int*)op[j].arg) = v;
}else if( op[j].type==OPT_FFLAG ){
- (*(void(*)())(intptr_t)(op[j].arg))(v);
+ (*(void(*)())(op[j].arg))(v);
}else{
if( err ){
fprintf(err,"%smissing argument on switch.\n",emsg);
@@ -1757,19 +1733,19 @@ FILE *err;
*(double*)(op[j].arg) = dv;
break;
case OPT_FDBL:
- (*(void(*)())(intptr_t)(op[j].arg))(dv);
+ (*(void(*)())(op[j].arg))(dv);
break;
case OPT_INT:
*(int*)(op[j].arg) = lv;
break;
case OPT_FINT:
- (*(void(*)())(intptr_t)(op[j].arg))((int)lv);
+ (*(void(*)())(op[j].arg))((int)lv);
break;
case OPT_STR:
*(char**)(op[j].arg) = sv;
break;
case OPT_FSTR:
- (*(void(*)())(intptr_t)(op[j].arg))(sv);
+ (*(void(*)())(op[j].arg))(sv);
break;
}
}
@@ -2055,7 +2031,7 @@ to follow the previous rule.");
case IN_RHS:
if( x[0]=='.' ){
struct rule *rp;
- rp = (struct rule *)malloc( sizeof(struct rule) +
+ rp = (struct rule *)malloc( sizeof(struct rule) +
sizeof(struct symbol*)*psp->nrhs + sizeof(char*)*psp->nrhs );
if( rp==0 ){
ErrorMsg(psp->filename,psp->tokenlineno,
@@ -2310,10 +2286,10 @@ to follow the previous rule.");
** token is passed to the function "parseonetoken" which builds all
** the appropriate data structures in the global state vector "gp".
*/
-struct pstate ps;
void Parse(gp)
struct lemon *gp;
{
+ struct pstate ps;
FILE *fp;
char *filebuf;
size_t filesize;
@@ -2341,7 +2317,6 @@ struct lemon *gp;
if( filebuf==0 ){
ErrorMsg(ps.filename,0,"Can't allocate %d of memory to hold this file.",
filesize+1);
- fclose(fp);
gp->errorcnt++;
return;
}
@@ -2349,7 +2324,6 @@ struct lemon *gp;
ErrorMsg(ps.filename,0,"Can't read in all %d bytes of this file.",
filesize);
free(filebuf);
- fclose(fp);
gp->errorcnt++;
return;
}
@@ -2572,7 +2546,7 @@ char *mode;
return fp;
}
-/* Duplicate the input file without comments and without actions
+/* Duplicate the input file without comments and without actions
** on rules */
void Reprint(lemp)
struct lemon *lemp;
@@ -2614,7 +2588,7 @@ struct lemon *lemp;
}
}
-PRIVATE void ConfigPrint(fp,cfp)
+void ConfigPrint(fp,cfp)
FILE *fp;
struct config *cfp;
{
@@ -2651,7 +2625,7 @@ struct lemon *lemp;
}
/* Print a plink chain */
-void PlinkPrint(out,plp,tag)
+PRIVATE void PlinkPrint(out,plp,tag)
FILE *out;
struct plink *plp;
char *tag;
@@ -2668,7 +2642,7 @@ char *tag;
/* Print an action to the given file descriptor. Return FALSE if
** nothing was actually printed.
*/
-PRIVATE int PrintAction(struct action *ap, FILE *fp, int indent){
+int PrintAction(struct action *ap, FILE *fp, int indent){
int result = 1;
switch( ap->type ){
case SHIFT:
@@ -2742,7 +2716,6 @@ struct lemon *lemp;
return;
}
- extern int access();
/* Search for the file "name" which is in the same directory as
** the exacutable */
PRIVATE char *pathsearch(argv0,name,modemask)
@@ -2753,6 +2726,7 @@ int modemask;
char *pathlist;
char *path,*cp;
char c;
+ extern int access();
#ifdef __WIN32__
cp = strrchr(argv0,'\\');
@@ -2766,6 +2740,7 @@ int modemask;
if( path ) sprintf(path,"%s/%s",argv0,name);
*cp = c;
}else{
+ extern char *getenv();
pathlist = getenv("PATH");
if( pathlist==0 ) pathlist = ".:/bin:/usr/bin";
path = (char *)malloc( strlen(pathlist)+strlen(name)+2 );
@@ -2847,7 +2822,7 @@ int *lineno;
PRIVATE FILE *tplt_open(lemp)
struct lemon *lemp;
{
-
+
char buf[1000];
FILE *in;
char *tpltname;
@@ -2904,7 +2879,7 @@ int *lineno;
** The following routine emits code for the destructor for the
** symbol sp
*/
-PRIVATE void emit_destructor_code(out,sp,lemp,lineno)
+void emit_destructor_code(out,sp,lemp,lineno)
FILE *out;
struct symbol *sp;
struct lemon *lemp;
@@ -2920,7 +2895,7 @@ int *lineno;
}else if( sp->destructor ){
cp = sp->destructor;
fprintf(out,"#line %d \"%s\"\n{",sp->destructorln,lemp->filename);
- }else{
+ }else if( lemp->vardest ){
cp = lemp->vardest;
if( cp==0 ) return;
fprintf(out,"#line %d \"%s\"\n{",lemp->vardestln,lemp->filename);
@@ -2942,7 +2917,7 @@ int *lineno;
/*
** Return TRUE (non-zero) if the given symbol has a destructor.
*/
-PRIVATE int has_destructor(sp, lemp)
+int has_destructor(sp, lemp)
struct symbol *sp;
struct lemon *lemp;
{
@@ -2955,7 +2930,7 @@ struct lemon *lemp;
return ret;
}
-/*
+/*
** Generate code which executes when the rule "rp" is reduced. Write
** the code to "out". Make sure lineno stays up-to-date.
*/
@@ -3043,13 +3018,13 @@ int *lineno;
** union, also set the ".dtnum" field of every terminal and nonterminal
** symbol.
*/
-PRIVATE void print_stack_union(out,lemp,plineno,mhflag)
+void print_stack_union(out,lemp,plineno,mhflag)
FILE *out; /* The output stream */
struct lemon *lemp; /* The main info structure for this parser */
int *plineno; /* Pointer to the line number */
int mhflag; /* True if generating makeheaders output */
{
- int lineno; /* The line number of the output */
+ int lineno = *plineno; /* The line number of the output */
char **types; /* A hash table of datatypes */
int arraysize; /* Size of the "types" array */
int maxdtlength; /* Maximum length of any ".datatype" field. */
@@ -3409,7 +3384,7 @@ int mhflag; /* Output in makeheaders format if true */
/* Output the yy_shift_ofst[] table */
fprintf(out, "#define YY_SHIFT_USE_DFLT (%d)\n", mnTknOfst-1); lineno++;
- fprintf(out, "static %s yy_shift_ofst[] = {\n",
+ fprintf(out, "static %s yy_shift_ofst[] = {\n",
minimum_size_type(mnTknOfst-1, mxTknOfst)); lineno++;
n = lemp->nstate;
for(i=j=0; i<n; i++){
@@ -3430,7 +3405,7 @@ int mhflag; /* Output in makeheaders format if true */
/* Output the yy_reduce_ofst[] table */
fprintf(out, "#define YY_REDUCE_USE_DFLT (%d)\n", mnNtOfst-1); lineno++;
- fprintf(out, "static %s yy_reduce_ofst[] = {\n",
+ fprintf(out, "static %s yy_reduce_ofst[] = {\n",
minimum_size_type(mnNtOfst-1, mxNtOfst)); lineno++;
n = lemp->nstate;
for(i=j=0; i<n; i++){
@@ -3505,7 +3480,7 @@ int mhflag; /* Output in makeheaders format if true */
tplt_xfer(lemp->name,in,out,&lineno);
/* Generate code which executes every time a symbol is popped from
- ** the stack while processing errors or while destroying the parser.
+ ** the stack while processing errors or while destroying the parser.
** (In other words, generate the %destructor actions)
*/
if( lemp->tokendest ){
@@ -3547,7 +3522,7 @@ int mhflag; /* Output in makeheaders format if true */
tplt_print(out,lemp,lemp->overflow,lemp->overflowln,&lineno);
tplt_xfer(lemp->name,in,out,&lineno);
- /* Generate the table of rule information
+ /* Generate the table of rule information
**
** Note: This code depends on the fact that rules are number
** sequentually beginning with 0.
@@ -3614,7 +3589,7 @@ struct lemon *lemp;
for(i=1; i<lemp->nterminal; i++){
fprintf(out,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i);
}
- fclose(out);
+ fclose(out);
}
return;
}
@@ -3655,7 +3630,7 @@ struct lemon *lemp;
rbest = rp;
}
}
-
+
/* Do not make a default if the number of rules to default
** is not at least 2 */
if( nbest<2 ) continue;
@@ -3694,6 +3669,7 @@ char *SetNew(){
int i;
s = (char*)malloc( global_size );
if( s==0 ){
+ extern void memory_error();
memory_error();
}
for(i=0; i<global_size; i++) s[i] = 0;
@@ -3805,7 +3781,7 @@ void Strsafe_init(){
if( x1a ){
x1a->size = 1024;
x1a->count = 0;
- x1a->tbl = (x1node*)malloc(
+ x1a->tbl = (x1node*)malloc(
(sizeof(x1node) + sizeof(x1node*))*1024 );
if( x1a->tbl==0 ){
free(x1a);
@@ -3967,7 +3943,7 @@ void Symbol_init(){
if( x2a ){
x2a->size = 128;
x2a->count = 0;
- x2a->tbl = (x2node*)malloc(
+ x2a->tbl = (x2node*)malloc(
(sizeof(x2node) + sizeof(x2node*))*128 );
if( x2a->tbl==0 ){
free(x2a);
@@ -4173,7 +4149,7 @@ void State_init(){
if( x3a ){
x3a->size = 128;
x3a->count = 0;
- x3a->tbl = (x3node*)malloc(
+ x3a->tbl = (x3node*)malloc(
(sizeof(x3node) + sizeof(x3node*))*128 );
if( x3a->tbl==0 ){
free(x3a);
@@ -4319,7 +4295,7 @@ void Configtable_init(){
if( x4a ){
x4a->size = 64;
x4a->count = 0;
- x4a->tbl = (x4node*)malloc(
+ x4a->tbl = (x4node*)malloc(
(sizeof(x4node) + sizeof(x4node*))*64 );
if( x4a->tbl==0 ){
free(x4a);
diff --git a/src/lempar.c b/src/lempar.c
index 26708ea..ee1edbf 100644
--- a/src/lempar.c
+++ b/src/lempar.c
@@ -8,10 +8,10 @@
/* Next is all token values, in a form suitable for use by makeheaders.
** This section will be null unless lemon is run with the -m switch.
*/
-/*
+/*
** These constants (all generated automatically by the parser generator)
** specify the various kinds of tokens (terminals) that the parser
-** understands.
+** understands.
**
** Each symbol here is a terminal symbol in the grammar.
*/
@@ -29,7 +29,7 @@
** and nonterminals. "int" is used otherwise.
** YYNOCODE is a number of type YYCODETYPE which corresponds
** to no legal terminal or nonterminal number. This
-** number is used to fill in empty slots of the hash
+** number is used to fill in empty slots of the hash
** table.
** YYFALLBACK If defined, this indicates that one or more tokens
** have fall-back values which should be used if the
@@ -38,7 +38,7 @@
** and nonterminal numbers. "unsigned char" is
** used if there are fewer than 250 rules and
** states combined. "int" is used otherwise.
-** ParseTOKENTYPE is the data type used for minor tokens given
+** ParseTOKENTYPE is the data type used for minor tokens given
** directly to the parser from the tokenizer.
** YYMINORTYPE is the data type used for all minor tokens.
** This is typically a union of many types, one of
@@ -62,7 +62,7 @@
/* Next are that tables used to determine what action to take based on the
** current state and lookahead token. These tables are used to implement
** functions that take a state number and lookahead value and return an
-** action integer.
+** action integer.
**
** Suppose the action integer is N. Then the action is determined as
** follows
@@ -87,7 +87,7 @@
** If the index value yy_shift_ofst[S]+X is out of range or if the value
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
-** and that yy_default[S] should be used instead.
+** and that yy_default[S] should be used instead.
**
** The formula above is for computing the action when the lookahead is
** a terminal symbol. If the lookahead is a non-terminal (as occurs after
@@ -111,7 +111,7 @@
/* The next table maps tokens into fallback tokens. If a construct
** like the following:
-**
+**
** %fallback ID X Y Z.
**
** appears in the grammer, then ID becomes a fallback token for X, Y,
@@ -163,10 +163,10 @@ static char *yyTracePrompt = 0;
#endif /* NDEBUG */
#ifndef NDEBUG
-/*
+/*
** Turn parser tracing on by giving a stream to which to write the trace
** and a prompt to preface each trace message. Tracing is turned off
-** by making either argument NULL
+** by making either argument NULL
**
** Inputs:
** <ul>
@@ -180,20 +180,18 @@ static char *yyTracePrompt = 0;
** Outputs:
** None.
*/
-#if 0
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
yyTraceFILE = TraceFILE;
yyTracePrompt = zTracePrompt;
if( yyTraceFILE==0 ) yyTracePrompt = 0;
else if( yyTracePrompt==0 ) yyTraceFILE = 0;
}
-#endif
#endif /* NDEBUG */
#ifndef NDEBUG
/* For tracing shifts, the names of all terminals and nonterminals
** are required. The following table supplies these names */
-static const char *yyTokenName[] = {
+static const char *yyTokenName[] = {
%%
};
#endif /* NDEBUG */
@@ -210,10 +208,9 @@ static const char *yyRuleName[] = {
** This function returns the symbolic name associated with a token
** value.
*/
-#if 0
const char *ParseTokenName(int tokenType){
#ifndef NDEBUG
- if( tokenType>0 && (size_t)tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){
+ if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){
return yyTokenName[tokenType];
}else{
return "Unknown";
@@ -222,9 +219,8 @@ const char *ParseTokenName(int tokenType){
return "";
#endif
}
-#endif
-/*
+/*
** This function allocates a new parser.
** The only argument is a pointer to a function which works like
** malloc.
@@ -255,7 +251,7 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
/* Here is inserted the actions which take place when a
** terminal or non-terminal is destroyed. This can happen
** when the symbol is popped from the stack during a
- ** reduce or during error processing or when a parser is
+ ** reduce or during error processing or when a parser is
** being destroyed before it is finished parsing.
**
** Note: during a reduce, the only symbols destroyed are those
@@ -293,7 +289,7 @@ static int yy_pop_parser_stack(yyParser *pParser){
return yymajor;
}
-/*
+/*
** Deallocate and destroy a parser. Destructors are all called for
** all stack elements before shutting the parser down.
**
@@ -329,7 +325,7 @@ static int yy_find_shift_action(
){
int i;
int stateno = pParser->yystack[pParser->yyidx].stateno;
-
+
/* if( pParser->yyidx<0 ) return YY_NO_ACTION; */
i = yy_shift_ofst[stateno];
if( i==YY_SHIFT_USE_DFLT ){
@@ -339,7 +335,7 @@ static int yy_find_shift_action(
return YY_NO_ACTION;
}
i += iLookAhead;
- if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
+ if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK
int iFallback; /* Fallback token */
if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
@@ -373,7 +369,7 @@ static int yy_find_reduce_action(
){
int i;
int stateno = pParser->yystack[pParser->yyidx].stateno;
-
+
i = yy_reduce_ofst[stateno];
if( i==YY_REDUCE_USE_DFLT ){
return yy_default[stateno];
@@ -382,7 +378,7 @@ static int yy_find_reduce_action(
return YY_NO_ACTION;
}
i += iLookAhead;
- if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
+ if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
return yy_default[stateno];
}else{
return yy_action[i];
@@ -459,8 +455,8 @@ static void yy_reduce(
ParseARG_FETCH;
yymsp = &yypParser->yystack[yypParser->yyidx];
#ifndef NDEBUG
- if( yyTraceFILE && yyruleno>=0
- && (size_t)yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
+ if( yyTraceFILE && yyruleno>=0
+ && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
yyRuleName[yyruleno]);
}
@@ -516,8 +512,6 @@ static void yy_syntax_error(
YYMINORTYPE yyminor /* The minor type of the error token */
){
ParseARG_FETCH;
- UNUSED(yymajor);
- UNUSED(yyminor);
#define TOKEN (yyminor.yy0)
%%
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
@@ -614,7 +608,7 @@ void Parse(
#ifdef YYERRORSYMBOL
/* A syntax error has occurred.
** The response to an error depends upon whether or not the
- ** grammar defines an error token "ERROR".
+ ** grammar defines an error token "ERROR".
**
** This is what we do if the grammar does define ERROR:
**
diff --git a/src/lighttpd-angel.c b/src/lighttpd-angel.c
deleted file mode 100644
index d7dd1f4..0000000
--- a/src/lighttpd-angel.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/**
- * angel process for lighttpd
- *
- * the purpose is the run as root all the time and handle:
- * - restart on crash
- * - spawn on HUP to allow graceful restart
- * - ...
- *
- * it has to stay safe and small to be trustable
- */
-
-#include <sys/wait.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <time.h>
-#include <signal.h>
-
-#define BINPATH SBIN_DIR"/lighttpd"
-
-static siginfo_t last_sigterm_info;
-static siginfo_t last_sighup_info;
-
-static volatile sig_atomic_t start_process = 1;
-static volatile sig_atomic_t graceful_restart = 0;
-static volatile pid_t pid = -1;
-
-#define UNUSED(x) ( (void)(x) )
-
-static void sigaction_handler(int sig, siginfo_t *si, void *context) {
- int exitcode;
-
- UNUSED(context);
- switch (sig) {
- case SIGINT:
- case SIGTERM:
- memcpy(&last_sigterm_info, si, sizeof(*si));
-
- /** forward the sig to the child */
- kill(pid, sig);
- break;
- case SIGHUP: /** do a graceful restart */
- memcpy(&last_sighup_info, si, sizeof(*si));
-
- /** do a graceful shutdown on the main process and start a new child */
- kill(pid, SIGINT);
-
- usleep(5 * 1000); /** wait 5 microsec */
-
- start_process = 1;
- break;
- case SIGCHLD:
- /** a child died, de-combie it */
- wait(&exitcode);
- break;
- }
-}
-
-int main(int argc, char **argv) {
- int is_shutdown = 0;
- struct sigaction act;
-
- UNUSED(argc);
-
- /**
- * we are running as root BEWARE
- */
-
- memset(&act, 0, sizeof(act));
- act.sa_handler = SIG_IGN;
- sigaction(SIGPIPE, &act, NULL);
- sigaction(SIGUSR1, &act, NULL);
-
- act.sa_sigaction = sigaction_handler;
- sigemptyset(&act.sa_mask);
- act.sa_flags = SA_SIGINFO;
-
- sigaction(SIGINT, &act, NULL);
- sigaction(SIGTERM, &act, NULL);
- sigaction(SIGHUP, &act, NULL);
- sigaction(SIGALRM, &act, NULL);
- sigaction(SIGCHLD, &act, NULL);
-
- /* check that the compiled in path has the right user,
- *
- * BEWARE: there is a race between the check here and the exec later
- */
-
- while (!is_shutdown) {
- int exitcode = 0;
-
- if (start_process) {
- pid = fork();
-
- if (0 == pid) {
- /* i'm the child */
-
- argv[0] = BINPATH;
-
- execvp(BINPATH, argv);
-
- exit(1);
- } else if (-1 == pid) {
- /** error */
-
- return -1;
- }
-
- /* I'm the angel */
- start_process = 0;
- }
-
- if ((pid_t)-1 == waitpid(pid, &exitcode, 0)) {
- switch (errno) {
- case EINTR:
- /* someone sent a signal ...
- * do we have to shutdown or restart the process */
- break;
- case ECHILD:
- /**
- * make sure we are not in a race between the signal handler
- * and the process restart */
- if (!start_process) is_shutdown = 1;
- break;
- default:
- break;
- }
- } else {
- /** process went away */
-
- if (WIFEXITED(exitcode)) {
- /** normal exit */
-
- is_shutdown = 1;
-
- fprintf(stderr, "%s.%d: child (pid=%d) exited normally with exitcode: %d\n",
- __FILE__, __LINE__,
- pid,
- WEXITSTATUS(exitcode));
-
- } else if (WIFSIGNALED(exitcode)) {
- /** got a signal */
-
- fprintf(stderr, "%s.%d: child (pid=%d) exited unexpectedly with signal %d, restarting\n",
- __FILE__, __LINE__,
- pid,
- WTERMSIG(exitcode));
-
- start_process = 1;
- }
- }
- }
-
- return 0;
-}
-
diff --git a/src/log.c b/src/log.c
index 10db635..402e302 100644
--- a/src/log.c
+++ b/src/log.c
@@ -1,6 +1,4 @@
-#include "base.h"
-#include "log.h"
-#include "array.h"
+#define _GNU_SOURCE
#include <sys/types.h>
@@ -14,319 +12,206 @@
#include <stdarg.h>
#include <stdio.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef HAVE_SYSLOG_H
-# include <syslog.h>
+#include <syslog.h>
#endif
+#include "log.h"
+#include "array.h"
+
#ifdef HAVE_VALGRIND_VALGRIND_H
-# include <valgrind/valgrind.h>
+#include <valgrind/valgrind.h>
#endif
#ifndef O_LARGEFILE
# define O_LARGEFILE 0
#endif
-/* Close fd and _try_ to get a /dev/null for it instead.
- * close() alone may trigger some bugs when a
- * process opens another file and gets fd = STDOUT_FILENO or STDERR_FILENO
- * and later tries to just print on stdout/stderr
- *
- * Returns 0 on success and -1 on failure (fd gets closed in all cases)
- */
-int openDevNull(int fd) {
- int tmpfd;
- close(fd);
-#if defined(__WIN32)
- /* Cygwin should work with /dev/null */
- tmpfd = open("nul", O_RDWR);
-#else
- tmpfd = open("/dev/null", O_RDWR);
-#endif
- if (tmpfd != -1 && tmpfd != fd) {
- dup2(tmpfd, fd);
- close(tmpfd);
- }
- return (tmpfd != -1) ? 0 : -1;
-}
-
-int open_logfile_or_pipe(server *srv, const char* logfile) {
- int fd;
-
- if (logfile[0] == '|') {
-#ifdef HAVE_FORK
- /* create write pipe and spawn process */
-
- int to_log_fds[2];
-
- if (pipe(to_log_fds)) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
- return -1;
- }
-
- /* fork, execve */
- switch (fork()) {
- case 0:
- /* child */
- close(STDIN_FILENO);
-
- /* dup the filehandle to STDIN */
- if (to_log_fds[0] != STDIN_FILENO) {
- if (STDIN_FILENO != dup2(to_log_fds[0], STDIN_FILENO)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "dup2 failed: ", strerror(errno));
- exit(-1);
- }
- close(to_log_fds[0]);
- }
- close(to_log_fds[1]);
-
-#ifndef FD_CLOEXEC
- {
- int i;
- /* we don't need the client socket */
- for (i = 3; i < 256; i++) {
- close(i);
- }
- }
-#endif
-
- /* close old stderr */
- openDevNull(STDERR_FILENO);
-
- /* exec the log-process (skip the | ) */
- execl("/bin/sh", "sh", "-c", logfile + 1, NULL);
- log_error_write(srv, __FILE__, __LINE__, "sss",
- "spawning log process failed: ", strerror(errno),
- logfile + 1);
-
- exit(-1);
- break;
- case -1:
- /* error */
- log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed: ", strerror(errno));
- return -1;
- default:
- close(to_log_fds[0]);
- fd = to_log_fds[1];
- break;
- }
-
-#else
- return -1;
-#endif
- } else if (-1 == (fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
- log_error_write(srv, __FILE__, __LINE__, "SSSS",
- "opening errorlog '", logfile,
- "' failed: ", strerror(errno));
-
- return -1;
- }
-
-#ifdef FD_CLOEXEC
- fcntl(fd, F_SETFD, FD_CLOEXEC);
-#endif
-
- return fd;
-}
-
-
-/**
+/**
* open the errorlog
- *
- * we have 4 possibilities:
+ *
+ * we have 3 possibilities:
* - stderr (default)
- * - syslog
+ * - syslog
* - logfile
- * - pipe
- *
+ *
* if the open failed, report to the user and die
- *
+ *
*/
int log_error_open(server *srv) {
+ int fd;
+ int close_stderr = 1;
+
#ifdef HAVE_SYSLOG_H
/* perhaps someone wants to use syslog() */
openlog("lighttpd", LOG_CONS | LOG_PID, LOG_DAEMON);
#endif
-
- srv->errorlog_mode = ERRORLOG_FD;
- srv->errorlog_fd = STDERR_FILENO;
-
+ srv->errorlog_mode = ERRORLOG_STDERR;
+
if (srv->srvconf.errorlog_use_syslog) {
srv->errorlog_mode = ERRORLOG_SYSLOG;
} else if (!buffer_is_empty(srv->srvconf.errorlog_file)) {
const char *logfile = srv->srvconf.errorlog_file->ptr;
-
- if (-1 == (srv->errorlog_fd = open_logfile_or_pipe(srv, logfile))) {
+
+ if (-1 == (srv->errorlog_fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
+ log_error_write(srv, __FILE__, __LINE__, "SSSS",
+ "opening errorlog '", logfile,
+ "' failed: ", strerror(errno));
+
return -1;
}
- srv->errorlog_mode = (logfile[0] == '|') ? ERRORLOG_PIPE : ERRORLOG_FILE;
+#ifdef FD_CLOEXEC
+ /* close fd on exec (cgi) */
+ fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC);
+#endif
+ srv->errorlog_mode = ERRORLOG_FILE;
}
-
+
log_error_write(srv, __FILE__, __LINE__, "s", "server started");
-
- if (srv->errorlog_mode == ERRORLOG_FD && !srv->srvconf.dont_daemonize) {
- /* We can only log to stderr in dont-daemonize mode;
- * if we do daemonize and no errorlog file is specified, we log into /dev/null
- */
- srv->errorlog_fd = -1;
- }
-
- if (!buffer_is_empty(srv->srvconf.breakagelog_file)) {
- int breakage_fd;
- const char *logfile = srv->srvconf.breakagelog_file->ptr;
-
- if (srv->errorlog_mode == ERRORLOG_FD) {
- srv->errorlog_fd = dup(STDERR_FILENO);
-#ifdef FD_CLOEXEC
- fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC);
+
+#ifdef HAVE_VALGRIND_VALGRIND_H
+ /* don't close stderr for debugging purposes if run in valgrind */
+ if (RUNNING_ON_VALGRIND) close_stderr = 0;
#endif
- }
-
- if (-1 == (breakage_fd = open_logfile_or_pipe(srv, logfile))) {
- return -1;
- }
-
- if (STDERR_FILENO != breakage_fd) {
- dup2(breakage_fd, STDERR_FILENO);
- close(breakage_fd);
- }
- } else if (!srv->srvconf.dont_daemonize) {
- /* move stderr to /dev/null */
- openDevNull(STDERR_FILENO);
+ if (srv->errorlog_mode == ERRORLOG_STDERR) close_stderr = 0;
+
+ /* move stderr to /dev/null */
+ if (close_stderr &&
+ -1 != (fd = open("/dev/null", O_WRONLY))) {
+ close(STDERR_FILENO);
+ dup2(fd, STDERR_FILENO);
+ close(fd);
}
return 0;
}
-/**
+/**
* open the errorlog
- *
+ *
* if the open failed, report to the user and die
* if no filename is given, use syslog instead
- *
+ *
*/
int log_error_cycle(server *srv) {
- /* only cycle if the error log is a file */
-
+ /* only cycle if we are not in syslog-mode */
+
if (srv->errorlog_mode == ERRORLOG_FILE) {
const char *logfile = srv->srvconf.errorlog_file->ptr;
/* already check of opening time */
-
+
int new_fd;
-
- if (-1 == (new_fd = open_logfile_or_pipe(srv, logfile))) {
+
+ if (-1 == (new_fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
/* write to old log */
- log_error_write(srv, __FILE__, __LINE__, "SSSSS",
+ log_error_write(srv, __FILE__, __LINE__, "SSSSS",
"cycling errorlog '", logfile,
"' failed: ", strerror(errno),
", falling back to syslog()");
-
+
close(srv->errorlog_fd);
srv->errorlog_fd = -1;
-#ifdef HAVE_SYSLOG_H
+#ifdef HAVE_SYSLOG_H
srv->errorlog_mode = ERRORLOG_SYSLOG;
#endif
} else {
/* ok, new log is open, close the old one */
close(srv->errorlog_fd);
srv->errorlog_fd = new_fd;
-#ifdef FD_CLOEXEC
- /* close fd on exec (cgi) */
- fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC);
-#endif
}
}
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s", "logfiles cycled");
+
return 0;
}
int log_error_close(server *srv) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "server stopped");
+
switch(srv->errorlog_mode) {
- case ERRORLOG_PIPE:
case ERRORLOG_FILE:
- case ERRORLOG_FD:
- if (-1 != srv->errorlog_fd) {
- /* don't close STDERR */
- if (STDERR_FILENO != srv->errorlog_fd)
- close(srv->errorlog_fd);
- srv->errorlog_fd = -1;
- }
+ close(srv->errorlog_fd);
break;
case ERRORLOG_SYSLOG:
#ifdef HAVE_SYSLOG_H
closelog();
#endif
break;
+ case ERRORLOG_STDERR:
+ break;
}
-
+
return 0;
}
int log_error_write(server *srv, const char *filename, unsigned int line, const char *fmt, ...) {
va_list ap;
-
+
switch(srv->errorlog_mode) {
- case ERRORLOG_PIPE:
case ERRORLOG_FILE:
- case ERRORLOG_FD:
- if (-1 == srv->errorlog_fd) return 0;
+ case ERRORLOG_STDERR:
/* cache the generated timestamp */
if (srv->cur_ts != srv->last_generated_debug_ts) {
buffer_prepare_copy(srv->ts_debug_str, 255);
strftime(srv->ts_debug_str->ptr, srv->ts_debug_str->size - 1, "%Y-%m-%d %H:%M:%S", localtime(&(srv->cur_ts)));
srv->ts_debug_str->used = strlen(srv->ts_debug_str->ptr) + 1;
-
+
srv->last_generated_debug_ts = srv->cur_ts;
}
buffer_copy_string_buffer(srv->errorlog_buf, srv->ts_debug_str);
- buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN(": ("));
+ BUFFER_APPEND_STRING_CONST(srv->errorlog_buf, ": (");
break;
case ERRORLOG_SYSLOG:
/* syslog is generating its own timestamps */
- buffer_copy_string_len(srv->errorlog_buf, CONST_STR_LEN("("));
+ BUFFER_COPY_STRING_CONST(srv->errorlog_buf, "(");
break;
}
-
+
buffer_append_string(srv->errorlog_buf, filename);
- buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("."));
+ BUFFER_APPEND_STRING_CONST(srv->errorlog_buf, ".");
buffer_append_long(srv->errorlog_buf, line);
- buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN(") "));
-
-
+ BUFFER_APPEND_STRING_CONST(srv->errorlog_buf, ") ");
+
+
for(va_start(ap, fmt); *fmt; fmt++) {
int d;
char *s;
buffer *b;
off_t o;
-
+
switch(*fmt) {
case 's': /* string */
s = va_arg(ap, char *);
buffer_append_string(srv->errorlog_buf, s);
- buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(srv->errorlog_buf, " ");
break;
case 'b': /* buffer */
b = va_arg(ap, buffer *);
buffer_append_string_buffer(srv->errorlog_buf, b);
- buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(srv->errorlog_buf, " ");
break;
case 'd': /* int */
d = va_arg(ap, int);
buffer_append_long(srv->errorlog_buf, d);
- buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(srv->errorlog_buf, " ");
break;
case 'o': /* off_t */
o = va_arg(ap, off_t);
buffer_append_off_t(srv->errorlog_buf, o);
- buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(srv->errorlog_buf, " ");
break;
case 'x': /* int (hex) */
d = va_arg(ap, int);
- buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("0x"));
+ BUFFER_APPEND_STRING_CONST(srv->errorlog_buf, "0x");
buffer_append_long_hex(srv->errorlog_buf, d);
- buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(srv->errorlog_buf, " ");
break;
case 'S': /* string */
s = va_arg(ap, char *);
@@ -340,18 +225,9 @@ int log_error_write(server *srv, const char *filename, unsigned int line, const
d = va_arg(ap, int);
buffer_append_long(srv->errorlog_buf, d);
break;
- case 'O': /* off_t */
- o = va_arg(ap, off_t);
- buffer_append_off_t(srv->errorlog_buf, o);
- break;
- case 'X': /* int (hex) */
- d = va_arg(ap, int);
- buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("0x"));
- buffer_append_long_hex(srv->errorlog_buf, d);
- break;
case '(':
case ')':
- case '<':
+ case '<':
case '>':
case ',':
case ' ':
@@ -360,19 +236,21 @@ int log_error_write(server *srv, const char *filename, unsigned int line, const
}
}
va_end(ap);
-
+
switch(srv->errorlog_mode) {
- case ERRORLOG_PIPE:
case ERRORLOG_FILE:
- case ERRORLOG_FD:
- buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("\n"));
+ BUFFER_APPEND_STRING_CONST(srv->errorlog_buf, "\n");
write(srv->errorlog_fd, srv->errorlog_buf->ptr, srv->errorlog_buf->used - 1);
break;
+ case ERRORLOG_STDERR:
+ BUFFER_APPEND_STRING_CONST(srv->errorlog_buf, "\n");
+ write(STDERR_FILENO, srv->errorlog_buf->ptr, srv->errorlog_buf->used - 1);
+ break;
case ERRORLOG_SYSLOG:
syslog(LOG_ERR, "%s", srv->errorlog_buf->ptr);
break;
}
-
+
return 0;
}
diff --git a/src/log.h b/src/log.h
index 583288b..bffee3a 100644
--- a/src/log.h
+++ b/src/log.h
@@ -3,18 +3,11 @@
#include "server.h"
-/* Close fd and _try_ to get a /dev/null for it instead.
- * Returns 0 on success and -1 on failure (fd gets closed in all cases)
- */
-int openDevNull(int fd);
-
#define WP() log_error_write(srv, __FILE__, __LINE__, "");
-int open_logfile_or_pipe(server *srv, const char* logfile);
-
int log_error_open(server *srv);
int log_error_close(server *srv);
int log_error_write(server *srv, const char *filename, unsigned int line, const char *fmt, ...);
int log_error_cycle(server *srv);
-
+
#endif
diff --git a/src/md5.c b/src/md5.c
index f13d866..8b688f6 100644
--- a/src/md5.c
+++ b/src/md5.c
@@ -24,7 +24,7 @@ documentation and/or software.
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
#endif
#ifndef USE_OPENSSL
@@ -52,9 +52,9 @@ documentation and/or software.
#define S43 15
#define S44 21
-static void li_MD5Transform (UINT4 [4], const unsigned char [64]);
+static void MD5Transform (UINT4 [4], unsigned char [64]);
static void Encode (unsigned char *, UINT4 *, unsigned int);
-static void Decode (UINT4 *, const unsigned char *, unsigned int);
+static void Decode (UINT4 *, unsigned char *, unsigned int);
#ifdef HAVE_MEMCPY
#define MD5_memcpy(output, input, len) memcpy((output), (input), (len))
@@ -110,8 +110,8 @@ Rotation is separate from addition to prevent recomputation.
/* MD5 initialization. Begins an MD5 operation, writing a new context.
*/
-void li_MD5_Init (context)
-li_MD5_CTX *context; /* context */
+void MD5_Init (context)
+MD5_CTX *context; /* context */
{
context->count[0] = context->count[1] = 0;
/* Load magic initialization constants.
@@ -126,13 +126,12 @@ li_MD5_CTX *context; /* context */
operation, processing another message block, and updating the
context.
*/
-void li_MD5_Update (context, _input, inputLen)
-li_MD5_CTX *context; /* context */
-const void *_input; /* input block */
+void MD5_Update (context, input, inputLen)
+MD5_CTX *context; /* context */
+unsigned char *input; /* input block */
unsigned int inputLen; /* length of input block */
{
unsigned int i, ndx, partLen;
- const unsigned char *input = (const unsigned char*) _input;
/* Compute number of bytes mod 64 */
ndx = (unsigned int)((context->count[0] >> 3) & 0x3F);
@@ -151,10 +150,10 @@ unsigned int inputLen; /* length of input block */
if (inputLen >= partLen) {
MD5_memcpy
((POINTER)&context->buffer[ndx], (POINTER)input, partLen);
- li_MD5Transform (context->state, context->buffer);
+ MD5Transform (context->state, context->buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
- li_MD5Transform (context->state, &input[i]);
+ MD5Transform (context->state, &input[i]);
ndx = 0;
}
@@ -170,9 +169,9 @@ unsigned int inputLen; /* length of input block */
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
the message digest and zeroizing the context.
*/
-void li_MD5_Final (digest, context)
+void MD5_Final (digest, context)
unsigned char digest[16]; /* message digest */
-li_MD5_CTX *context; /* context */
+MD5_CTX *context; /* context */
{
unsigned char bits[8];
unsigned int ndx, padLen;
@@ -184,10 +183,10 @@ li_MD5_CTX *context; /* context */
*/
ndx = (unsigned int)((context->count[0] >> 3) & 0x3f);
padLen = (ndx < 56) ? (56 - ndx) : (120 - ndx);
- li_MD5_Update (context, PADDING, padLen);
+ MD5_Update (context, PADDING, padLen);
/* Append length (before padding) */
- li_MD5_Update (context, bits, 8);
+ MD5_Update (context, bits, 8);
/* Store state in digest */
Encode (digest, context->state, 16);
@@ -199,9 +198,9 @@ li_MD5_CTX *context; /* context */
/* MD5 basic transformation. Transforms state based on block.
*/
-static void li_MD5Transform (state, block)
+static void MD5Transform (state, block)
UINT4 state[4];
-const unsigned char block[64];
+unsigned char block[64];
{
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
@@ -314,7 +313,7 @@ unsigned int len;
*/
static void Decode (output, input, len)
UINT4 *output;
-const unsigned char *input;
+unsigned char *input;
unsigned int len;
{
unsigned int i, j;
diff --git a/src/md5.h b/src/md5.h
index 669a826..a1c0d76 100644
--- a/src/md5.h
+++ b/src/md5.h
@@ -39,8 +39,9 @@ typedef struct {
UINT4 state[4]; /* state (ABCD) */
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
-} li_MD5_CTX;
+} MD5_CTX;
+
+void MD5_Init (MD5_CTX *);
+void MD5_Update (MD5_CTX *, unsigned char *, unsigned int);
+void MD5_Final (unsigned char [16], MD5_CTX *);
-void li_MD5_Init (li_MD5_CTX *);
-void li_MD5_Update (li_MD5_CTX *, const void *, unsigned int);
-void li_MD5_Final (unsigned char [16], li_MD5_CTX *);
diff --git a/src/mod_access.c b/src/mod_access.c
index 3902435..aa8d16f 100644
--- a/src/mod_access.c
+++ b/src/mod_access.c
@@ -1,83 +1,83 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
#include "plugin.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
typedef struct {
array *access_deny;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
INIT_FUNC(mod_access_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
return p;
}
FREE_FUNC(mod_access_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
array_free(s->access_deny);
-
+
free(s);
}
free(p->config_storage);
}
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
SETDEFAULTS_FUNC(mod_access_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "url.access-deny", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->access_deny = array_init();
-
+
cv[0].destination = s->access_deny;
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
}
-
+
return HANDLER_GO_ON;
}
@@ -88,105 +88,70 @@ static int mod_access_patch_connection(server *srv, connection *con, plugin_data
plugin_config *s = p->config_storage[0];
PATCH(access_deny);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.access-deny"))) {
PATCH(access_deny);
}
}
}
-
+
return 0;
}
#undef PATCH
-/**
- * URI handler
- *
- * we will get called twice:
- * - after the clean up of the URL and
- * - after the pathinfo checks are done
- *
- * this handles the issue of trailing slashes
- */
URIHANDLER_FUNC(mod_access_uri_handler) {
plugin_data *p = p_d;
int s_len;
size_t k;
-
+
if (con->uri.path->used == 0) return HANDLER_GO_ON;
-
+
mod_access_patch_connection(srv, con, p);
-
+
s_len = con->uri.path->used - 1;
-
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "-- mod_access_uri_handler called");
- }
-
+
for (k = 0; k < p->conf.access_deny->used; k++) {
data_string *ds = (data_string *)p->conf.access_deny->data[k];
int ct_len = ds->value->used - 1;
- int denied = 0;
-
-
+
if (ct_len > s_len) continue;
+
if (ds->value->used == 0) continue;
-
- /* if we have a case-insensitive FS we have to lower-case the URI here too */
-
- if (con->conf.force_lowercase_filenames) {
- if (0 == strncasecmp(con->uri.path->ptr + s_len - ct_len, ds->value->ptr, ct_len)) {
- denied = 1;
- }
- } else {
- if (0 == strncmp(con->uri.path->ptr + s_len - ct_len, ds->value->ptr, ct_len)) {
- denied = 1;
- }
- }
-
- if (denied) {
+
+ if (0 == strncmp(con->uri.path->ptr + s_len - ct_len, ds->value->ptr, ct_len)) {
con->http_status = 403;
- con->mode = DIRECT;
-
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "url denied as we match:", ds->value);
- }
-
+
return HANDLER_FINISHED;
}
}
-
+
/* not found */
return HANDLER_GO_ON;
}
-int mod_access_plugin_init(plugin *p);
int mod_access_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("access");
-
+
p->init = mod_access_init;
p->set_defaults = mod_access_set_defaults;
- p->handle_uri_clean = mod_access_uri_handler;
- p->handle_subrequest_start = mod_access_uri_handler;
+ p->handle_uri_clean = mod_access_uri_handler;
p->cleanup = mod_access_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_accesslog.c b/src/mod_accesslog.c
index 8fa92ca..d77c889 100644
--- a/src/mod_accesslog.c
+++ b/src/mod_accesslog.c
@@ -1,12 +1,4 @@
-#include "base.h"
-#include "log.h"
-#include "buffer.h"
-
-#include "plugin.h"
-
-#include "inet_ntop_cache.h"
-
-#include "sys-socket.h"
+#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
@@ -21,13 +13,23 @@
#include <stdio.h>
+#include "base.h"
+#include "log.h"
+#include "buffer.h"
+
+#include "plugin.h"
+
+#include "inet_ntop_cache.h"
+
+#include "sys-socket.h"
+
#ifdef HAVE_SYSLOG_H
# include <syslog.h>
#endif
typedef struct {
char key;
- enum {
+ enum {
FORMAT_UNSET,
FORMAT_UNSUPPORTED,
FORMAT_PERCENT,
@@ -39,7 +41,7 @@ typedef struct {
FORMAT_STATUS,
FORMAT_BYTES_OUT_NO_HEADER,
FORMAT_HEADER,
-
+
FORMAT_REMOTE_ADDR,
FORMAT_LOCAL_ADDR,
FORMAT_COOKIE,
@@ -57,20 +59,20 @@ typedef struct {
FORMAT_CONNECTION_STATUS,
FORMAT_BYTES_IN,
FORMAT_BYTES_OUT,
-
+
FORMAT_RESPONSE_HEADER
} type;
} format_mapping;
/**
- *
- *
+ *
+ *
* "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
- *
+ *
*/
-const format_mapping fmap[] =
-{
+const format_mapping fmap[] =
+{
{ '%', FORMAT_PERCENT },
{ 'h', FORMAT_REMOTE_HOST },
{ 'l', FORMAT_REMOTE_IDENT },
@@ -80,7 +82,7 @@ const format_mapping fmap[] =
{ 's', FORMAT_STATUS },
{ 'b', FORMAT_BYTES_OUT_NO_HEADER },
{ 'i', FORMAT_HEADER },
-
+
{ 'a', FORMAT_REMOTE_ADDR },
{ 'A', FORMAT_LOCAL_ADDR },
{ 'B', FORMAT_BYTES_OUT_NO_HEADER },
@@ -101,23 +103,23 @@ const format_mapping fmap[] =
{ 'X', FORMAT_CONNECTION_STATUS },
{ 'I', FORMAT_BYTES_IN },
{ 'O', FORMAT_BYTES_OUT },
-
+
{ 'o', FORMAT_RESPONSE_HEADER },
-
+
{ '\0', FORMAT_UNSET }
};
typedef struct {
enum { FIELD_UNSET, FIELD_STRING, FIELD_FORMAT } type;
-
+
buffer *string;
int field;
} format_field;
typedef struct {
format_field **ptr;
-
+
size_t used;
size_t size;
} format_fields;
@@ -126,312 +128,226 @@ typedef struct {
buffer *access_logfile;
buffer *format;
unsigned short use_syslog;
-
-
+
+
int log_access_fd;
time_t last_generated_accesslog_ts;
time_t *last_generated_accesslog_ts_ptr;
-
-
+
+
buffer *access_logbuffer;
buffer *ts_accesslog_str;
- buffer *ts_accesslog_fmt_str;
- unsigned short append_tz_offset;
-
+
format_fields *parsed_format;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
plugin_config **config_storage;
- plugin_config conf;
+ plugin_config conf;
} plugin_data;
INIT_FUNC(mod_accesslog_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
return p;
}
-static void accesslog_append_escaped(buffer *dest, buffer *str) {
- char *ptr, *start, *end;
-
- /* replaces non-printable chars with \xHH where HH is the hex representation of the byte */
- /* exceptions: " => \", \ => \\, whitespace chars => \n \t etc. */
- if (str->used == 0) return;
- buffer_prepare_append(dest, str->used - 1);
-
- for (ptr = start = str->ptr, end = str->ptr + str->used - 1; ptr < end; ptr++) {
- char const c = *ptr;
- if (c >= ' ' && c <= '~' && c != '"' && c != '\\') {
- /* nothing to change, add later as one block */
- } else {
- /* copy previous part */
- if (start < ptr) {
- buffer_append_string_len(dest, start, ptr - start);
- }
- start = ptr + 1;
-
- switch (c) {
- case '"':
- BUFFER_APPEND_STRING_CONST(dest, "\\\"");
- break;
- case '\\':
- BUFFER_APPEND_STRING_CONST(dest, "\\\\");
- break;
- case '\b':
- BUFFER_APPEND_STRING_CONST(dest, "\\b");
- break;
- case '\n':
- BUFFER_APPEND_STRING_CONST(dest, "\\n");
- break;
- case '\r':
- BUFFER_APPEND_STRING_CONST(dest, "\\r");
- break;
- case '\t':
- BUFFER_APPEND_STRING_CONST(dest, "\\t");
- break;
- case '\v':
- BUFFER_APPEND_STRING_CONST(dest, "\\v");
- break;
- default: {
- /* non printable char => \xHH */
- char hh[5] = {'\\','x',0,0,0};
- char h = c / 16;
- hh[2] = (h > 9) ? (h - 10 + 'A') : (h + '0');
- h = c % 16;
- hh[3] = (h > 9) ? (h - 10 + 'A') : (h + '0');
- buffer_append_string_len(dest, &hh[0], 4);
- }
- break;
- }
- }
- }
-
- if (start < end) {
- buffer_append_string_len(dest, start, end - start);
- }
-}
-
-static int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
+int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
size_t i, j, k = 0, start = 0;
-
- if (format->used == 0) return -1;
-
+
for (i = 0; i < format->used - 1; i++) {
+
switch(format->ptr[i]) {
case '%':
- if (i > 0 && start != i) {
- /* copy the string before this % */
+ if (start != i) {
+ /* copy the string */
if (fields->size == 0) {
fields->size = 16;
fields->used = 0;
- fields->ptr = malloc(fields->size * sizeof(format_field * ));
+ fields->ptr = malloc(fields->size * sizeof(format_fields * ));
} else if (fields->used == fields->size) {
fields->size += 16;
- fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_field * ));
+ fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_fields * ));
}
-
- fields->ptr[fields->used] = malloc(sizeof(format_field));
+
+ fields->ptr[fields->used] = malloc(sizeof(format_fields));
fields->ptr[fields->used]->type = FIELD_STRING;
fields->ptr[fields->used]->string = buffer_init();
-
+
buffer_copy_string_len(fields->ptr[fields->used]->string, format->ptr + start, i - start);
-
+
fields->used++;
}
-
+
+
/* we need a new field */
-
+
if (fields->size == 0) {
fields->size = 16;
fields->used = 0;
- fields->ptr = malloc(fields->size * sizeof(format_field * ));
+ fields->ptr = malloc(fields->size * sizeof(format_fields * ));
} else if (fields->used == fields->size) {
fields->size += 16;
- fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_field * ));
+ fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_fields * ));
}
-
+
/* search for the terminating command */
switch (format->ptr[i+1]) {
case '>':
case '<':
- /* after the } has to be a character */
- if (format->ptr[i+2] == '\0') {
- log_error_write(srv, __FILE__, __LINE__, "s", "%< and %> have to be followed by a format-specifier");
- return -1;
- }
-
-
+ /* only for s */
+
for (j = 0; fmap[j].key != '\0'; j++) {
if (fmap[j].key != format->ptr[i+2]) continue;
-
+
/* found key */
-
- fields->ptr[fields->used] = malloc(sizeof(format_field));
+
+ fields->ptr[fields->used] = malloc(sizeof(format_fields));
fields->ptr[fields->used]->type = FIELD_FORMAT;
fields->ptr[fields->used]->field = fmap[j].type;
fields->ptr[fields->used]->string = NULL;
-
+
fields->used++;
-
+
break;
}
-
+
if (fmap[j].key == '\0') {
- log_error_write(srv, __FILE__, __LINE__, "s", "%< and %> have to be followed by a valid format-specifier");
+ log_error_write(srv, __FILE__, __LINE__, "ss", "config: ", "failed");
return -1;
}
-
+
start = i + 3;
- i = start - 1; /* skip the string */
-
+
break;
case '{':
/* go forward to } */
-
+
for (k = i+2; k < format->used - 1; k++) {
if (format->ptr[k] == '}') break;
}
-
+
if (k == format->used - 1) {
- log_error_write(srv, __FILE__, __LINE__, "s", "%{ has to be terminated by a }");
+ log_error_write(srv, __FILE__, __LINE__, "ss", "config: ", "failed");
return -1;
}
-
- /* after the } has to be a character */
if (format->ptr[k+1] == '\0') {
- log_error_write(srv, __FILE__, __LINE__, "s", "%{...} has to be followed by a format-specifier");
- return -1;
- }
-
- if (k == i + 2) {
- log_error_write(srv, __FILE__, __LINE__, "s", "%{...} has to be contain a string");
+ log_error_write(srv, __FILE__, __LINE__, "ss", "config: ", "failed");
return -1;
}
-
+
for (j = 0; fmap[j].key != '\0'; j++) {
if (fmap[j].key != format->ptr[k+1]) continue;
-
+
/* found key */
-
- fields->ptr[fields->used] = malloc(sizeof(format_field));
+
+ fields->ptr[fields->used] = malloc(sizeof(format_fields));
fields->ptr[fields->used]->type = FIELD_FORMAT;
fields->ptr[fields->used]->field = fmap[j].type;
fields->ptr[fields->used]->string = buffer_init();
-
+
buffer_copy_string_len(fields->ptr[fields->used]->string, format->ptr + i + 2, k - (i + 2));
-
+
fields->used++;
-
+
break;
}
-
+
if (fmap[j].key == '\0') {
- log_error_write(srv, __FILE__, __LINE__, "s", "%{...} has to be followed by a valid format-specifier");
+ log_error_write(srv, __FILE__, __LINE__, "ss", "config: ", "failed");
return -1;
}
-
+
start = k + 2;
- i = start - 1; /* skip the string */
-
+
break;
default:
- /* after the % has to be a character */
- if (format->ptr[i+1] == '\0') {
- log_error_write(srv, __FILE__, __LINE__, "s", "% has to be followed by a format-specifier");
- return -1;
- }
-
for (j = 0; fmap[j].key != '\0'; j++) {
if (fmap[j].key != format->ptr[i+1]) continue;
-
+
/* found key */
-
- fields->ptr[fields->used] = malloc(sizeof(format_field));
+
+ fields->ptr[fields->used] = malloc(sizeof(format_fields));
fields->ptr[fields->used]->type = FIELD_FORMAT;
fields->ptr[fields->used]->field = fmap[j].type;
fields->ptr[fields->used]->string = NULL;
-
+
fields->used++;
-
+
break;
}
-
+
if (fmap[j].key == '\0') {
- log_error_write(srv, __FILE__, __LINE__, "s", "% has to be followed by a valid format-specifier");
+ log_error_write(srv, __FILE__, __LINE__, "ss", "config: ", "failed");
return -1;
}
-
+
start = i + 2;
- i = start - 1; /* skip the string */
-
+
break;
}
-
+
break;
}
}
-
+
if (start < i) {
/* copy the string */
if (fields->size == 0) {
fields->size = 16;
fields->used = 0;
- fields->ptr = malloc(fields->size * sizeof(format_field * ));
+ fields->ptr = malloc(fields->size * sizeof(format_fields * ));
} else if (fields->used == fields->size) {
fields->size += 16;
- fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_field * ));
+ fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_fields * ));
}
-
- fields->ptr[fields->used] = malloc(sizeof(format_field));
+
+ fields->ptr[fields->used] = malloc(sizeof(format_fields));
fields->ptr[fields->used]->type = FIELD_STRING;
fields->ptr[fields->used]->string = buffer_init();
-
+
buffer_copy_string_len(fields->ptr[fields->used]->string, format->ptr + start, i - start);
-
+
fields->used++;
}
-
+
return 0;
}
FREE_FUNC(mod_accesslog_free) {
plugin_data *p = p_d;
size_t i;
-
+
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
-
+
if (s->access_logbuffer->used) {
if (s->use_syslog) {
# ifdef HAVE_SYSLOG_H
- if (s->access_logbuffer->used > 2) {
- syslog(LOG_INFO, "%*s", (int) s->access_logbuffer->used - 2, s->access_logbuffer->ptr);
- }
+ syslog(LOG_INFO, "%*s", s->access_logbuffer->used - 1, s->access_logbuffer->ptr);
# endif
} else if (s->log_access_fd != -1) {
write(s->log_access_fd, s->access_logbuffer->ptr, s->access_logbuffer->used - 1);
}
}
-
+
if (s->log_access_fd != -1) close(s->log_access_fd);
-
+
buffer_free(s->ts_accesslog_str);
- buffer_free(s->ts_accesslog_fmt_str);
buffer_free(s->access_logbuffer);
buffer_free(s->format);
buffer_free(s->access_logfile);
-
+
if (s->parsed_format) {
size_t j;
for (j = 0; j < s->parsed_format->used; j++) {
@@ -441,108 +357,82 @@ FREE_FUNC(mod_accesslog_free) {
free(s->parsed_format->ptr);
free(s->parsed_format);
}
-
+
free(s);
}
-
+
free(p->config_storage);
}
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
SETDEFAULTS_FUNC(log_access_open) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "accesslog.filename", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
{ "accesslog.use-syslog", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
{ "accesslog.format", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->access_logfile = buffer_init();
s->format = buffer_init();
s->access_logbuffer = buffer_init();
s->ts_accesslog_str = buffer_init();
- s->ts_accesslog_fmt_str = buffer_init();
s->log_access_fd = -1;
s->last_generated_accesslog_ts = 0;
s->last_generated_accesslog_ts_ptr = &(s->last_generated_accesslog_ts);
-
-
+
+
cv[0].destination = s->access_logfile;
cv[1].destination = &(s->use_syslog);
cv[2].destination = s->format;
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
-
+
if (i == 0 && buffer_is_empty(s->format)) {
/* set a default logfile string */
-
- buffer_copy_string_len(s->format, CONST_STR_LEN("%h %V %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""));
+
+ buffer_copy_string(s->format, "%h %V %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"");
}
-
+
/* parse */
-
+
if (s->format->used) {
- size_t j, count;
-
s->parsed_format = calloc(1, sizeof(*(s->parsed_format)));
-
+
if (-1 == accesslog_parse_format(srv, s->parsed_format, s->format)) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"parsing accesslog-definition failed:", s->format);
return HANDLER_ERROR;
}
-
- /* make sure they didn't try to send the timestamp in twice...
- * also, save the format string in a different variable (this
- * will save a few conditionals later)
- */
- count = 0;
- for (j = 0; j < s->parsed_format->used; j++) {
- if (FIELD_FORMAT == s->parsed_format->ptr[j]->type) {
- if (FORMAT_TIMESTAMP == s->parsed_format->ptr[j]->field) {
- if (!buffer_is_empty(s->parsed_format->ptr[j]->string)) {
- buffer_copy_string(s->ts_accesslog_fmt_str, s->parsed_format->ptr[j]->string->ptr);
- }
-
- if (++count > 1) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "you may not use the timestamp twice in the same access log:", s->format);
-
- return HANDLER_ERROR;
- }
- }
- }
- }
-
#if 0
- /* debugging */
+ /* debugging */
for (j = 0; j < s->parsed_format->used; j++) {
switch (s->parsed_format->ptr[j]->type) {
case FIELD_FORMAT:
- log_error_write(srv, __FILE__, __LINE__, "ssds",
+ log_error_write(srv, __FILE__, __LINE__, "ssds",
"config:", "format", s->parsed_format->ptr[j]->field,
- s->parsed_format->ptr[j]->string ?
+ s->parsed_format->ptr[j]->string ?
s->parsed_format->ptr[j]->string->ptr : "" );
break;
case FIELD_STRING:
@@ -554,29 +444,81 @@ SETDEFAULTS_FUNC(log_access_open) {
}
#endif
}
-
- s->append_tz_offset = 0;
- if (buffer_is_empty(s->ts_accesslog_fmt_str)) {
-#if defined(HAVE_STRUCT_TM_GMTOFF)
- BUFFER_COPY_STRING_CONST(s->ts_accesslog_fmt_str, "[%d/%b/%Y:%H:%M:%S ");
- s->append_tz_offset = 1;
-#else
- BUFFER_COPY_STRING_CONST(s->ts_accesslog_fmt_str, "[%d/%b/%Y:%H:%M:%S +0000]");
-#endif
- }
-
+
if (s->use_syslog) {
/* ignore the next checks */
continue;
}
+
+ if (buffer_is_empty(s->access_logfile)) continue;
+
+ if (s->access_logfile->ptr[0] == '|') {
+#ifdef HAVE_FORK
+ /* create write pipe and spawn process */
+
+ int to_log_fds[2];
+ pid_t pid;
+
+ if (pipe(to_log_fds)) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
+ return HANDLER_ERROR;
+ }
+
+ /* fork, execve */
+ switch (pid = fork()) {
+ case 0:
+ /* child */
+
+ close(STDIN_FILENO);
+ dup2(to_log_fds[0], STDIN_FILENO);
+ close(to_log_fds[0]);
+ /* not needed */
+ close(to_log_fds[1]);
+
+ /* we don't need the client socket */
+ for (i = 3; i < 256; i++) {
+ close(i);
+ }
+
+ /* exec the log-process (skip the | )
+ *
+ */
+
+ execl("/bin/sh", "sh", "-c", s->access_logfile->ptr + 1, NULL);
- if (s->access_logfile->used < 2) continue;
-
- if (-1 == (s->log_access_fd = open_logfile_or_pipe(srv, s->access_logfile->ptr)))
+ log_error_write(srv, __FILE__, __LINE__, "sss",
+ "spawning log-process failed: ", strerror(errno),
+ s->access_logfile->ptr + 1);
+
+ exit(-1);
+ break;
+ case -1:
+ /* error */
+ log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed: ", strerror(errno));
+ break;
+ default:
+ close(to_log_fds[0]);
+
+ s->log_access_fd = to_log_fds[1];
+
+ break;
+ }
+#else
+ return -1;
+#endif
+ } else if (-1 == (s->log_access_fd =
+ open(s->access_logfile->ptr, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
+
+ log_error_write(srv, __FILE__, __LINE__, "ssb",
+ "opening access-log failed:",
+ strerror(errno), s->access_logfile);
+
return HANDLER_ERROR;
-
+ }
+ fcntl(s->log_access_fd, F_SETFD, FD_CLOEXEC);
+
}
-
+
return HANDLER_GO_ON;
}
@@ -585,44 +527,38 @@ SIGHUP_FUNC(log_access_cycle) {
size_t i;
if (!p->config_storage) return HANDLER_GO_ON;
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (s->access_logbuffer->used) {
if (s->use_syslog) {
#ifdef HAVE_SYSLOG_H
- if (s->access_logbuffer->used > 2) {
- /* syslog appends a \n on its own */
- syslog(LOG_INFO, "%*s", (int) s->access_logbuffer->used - 2, s->access_logbuffer->ptr);
- }
+ syslog(LOG_INFO, "%*s", s->access_logbuffer->used - 1, s->access_logbuffer->ptr);
#endif
} else if (s->log_access_fd != -1) {
write(s->log_access_fd, s->access_logbuffer->ptr, s->access_logbuffer->used - 1);
}
-
+
buffer_reset(s->access_logbuffer);
}
-
+
if (s->use_syslog == 0 &&
- s->access_logfile->used > 1 &&
+ !buffer_is_empty(s->access_logfile) &&
s->access_logfile->ptr[0] != '|') {
-
+
close(s->log_access_fd);
-
- if (-1 == (s->log_access_fd =
+
+ if (-1 == (s->log_access_fd =
open(s->access_logfile->ptr, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
-
+
log_error_write(srv, __FILE__, __LINE__, "ss", "cycling access-log failed:", strerror(errno));
-
+
return HANDLER_ERROR;
}
-#ifdef FD_CLOEXEC
- fcntl(s->log_access_fd, F_SETFD, FD_CLOEXEC);
-#endif
}
}
-
+
return HANDLER_GO_ON;
}
@@ -631,48 +567,43 @@ SIGHUP_FUNC(log_access_cycle) {
static int mod_accesslog_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(access_logfile);
PATCH(format);
PATCH(log_access_fd);
PATCH(last_generated_accesslog_ts_ptr);
PATCH(access_logbuffer);
PATCH(ts_accesslog_str);
- PATCH(ts_accesslog_fmt_str);
- PATCH(append_tz_offset);
PATCH(parsed_format);
PATCH(use_syslog);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("accesslog.filename"))) {
PATCH(access_logfile);
PATCH(log_access_fd);
+ PATCH(last_generated_accesslog_ts_ptr);
PATCH(access_logbuffer);
+ PATCH(ts_accesslog_str);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("accesslog.format"))) {
PATCH(format);
PATCH(parsed_format);
- PATCH(last_generated_accesslog_ts_ptr);
- PATCH(ts_accesslog_str);
- PATCH(ts_accesslog_fmt_str);
- PATCH(append_tz_offset);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("accesslog.use-syslog"))) {
PATCH(use_syslog);
- PATCH(access_logbuffer);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -681,20 +612,17 @@ REQUESTDONE_FUNC(log_access_write) {
plugin_data *p = p_d;
buffer *b;
size_t j;
-
+
int newts = 0;
data_string *ds;
-
+
mod_accesslog_patch_connection(srv, con, p);
-
- /* No output device, nothing to do */
- if (!p->conf.use_syslog && p->conf.log_access_fd == -1) return HANDLER_GO_ON;
-
+
b = p->conf.access_logbuffer;
if (b->used == 0) {
- buffer_copy_string_len(b, CONST_STR_LEN(""));
+ buffer_copy_string(b, "");
}
-
+
for (j = 0; j < p->conf.parsed_format->used; j++) {
switch(p->conf.parsed_format->ptr[j]->type) {
case FIELD_STRING:
@@ -703,131 +631,122 @@ REQUESTDONE_FUNC(log_access_write) {
case FIELD_FORMAT:
switch(p->conf.parsed_format->ptr[j]->field) {
case FORMAT_TIMESTAMP:
-
+
/* cache the generated timestamp */
if (srv->cur_ts != *(p->conf.last_generated_accesslog_ts_ptr)) {
struct tm tm;
#if defined(HAVE_STRUCT_TM_GMTOFF)
long scd, hrs, min;
#endif
-
+
buffer_prepare_copy(p->conf.ts_accesslog_str, 255);
#if defined(HAVE_STRUCT_TM_GMTOFF)
# ifdef HAVE_LOCALTIME_R
localtime_r(&(srv->cur_ts), &tm);
- strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, p->conf.ts_accesslog_fmt_str->ptr, &tm);
-# else /* HAVE_LOCALTIME_R */
- strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, p->conf.ts_accesslog_fmt_str->ptr, localtime_r(&(srv->cur_ts)));
-# endif /* HAVE_LOCALTIME_R */
+ strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, "[%d/%b/%Y:%H:%M:%S ", &tm);
+# else
+ strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, "[%d/%b/%Y:%H:%M:%S ", localtime_r(&(srv->cur_ts)));
+# endif
p->conf.ts_accesslog_str->used = strlen(p->conf.ts_accesslog_str->ptr) + 1;
-
- if (p->conf.append_tz_offset) {
- buffer_append_string_len(p->conf.ts_accesslog_str, tm.tm_gmtoff >= 0 ? "+" : "-", 1);
-
- scd = abs(tm.tm_gmtoff);
- hrs = scd / 3600;
- min = (scd % 3600) / 60;
-
- /* hours */
- if (hrs < 10) buffer_append_string_len(p->conf.ts_accesslog_str, CONST_STR_LEN("0"));
- buffer_append_long(p->conf.ts_accesslog_str, hrs);
-
- if (min < 10) buffer_append_string_len(p->conf.ts_accesslog_str, CONST_STR_LEN("0"));
- buffer_append_long(p->conf.ts_accesslog_str, min);
- buffer_append_string_len(p->conf.ts_accesslog_str, CONST_STR_LEN("]"));
- }
-#else /* HAVE_STRUCT_TM_GMTOFF */
-# ifdef HAVE_GMTIME_R
+
+ buffer_append_string(p->conf.ts_accesslog_str, tm.tm_gmtoff >= 0 ? "+" : "-");
+
+ scd = abs(tm.tm_gmtoff);
+ hrs = scd / 3600;
+ min = (scd % 3600) / 60;
+
+ /* hours */
+ if (hrs < 10) buffer_append_string(p->conf.ts_accesslog_str, "0");
+ buffer_append_long(p->conf.ts_accesslog_str, hrs);
+
+ if (min < 10) buffer_append_string(p->conf.ts_accesslog_str, "0");
+ buffer_append_long(p->conf.ts_accesslog_str, min);
+ BUFFER_APPEND_STRING_CONST(p->conf.ts_accesslog_str, "]");
+#else
+#ifdef HAVE_GMTIME_R
gmtime_r(&(srv->cur_ts), &tm);
- strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, p->conf.ts_accesslog_fmt_str->ptr, &tm);
-# else /* HAVE_GMTIME_R */
- strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, p->conf.ts_accesslog_fmt_str->ptr, gmtime(&(srv->cur_ts)));
-# endif /* HAVE_GMTIME_R */
+ strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, "[%d/%b/%Y:%H:%M:%S +0000]", &tm);
+#else
+ strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, "[%d/%b/%Y:%H:%M:%S +0000]", gmtime(&(srv->cur_ts)));
+#endif
p->conf.ts_accesslog_str->used = strlen(p->conf.ts_accesslog_str->ptr) + 1;
-#endif /* HAVE_STRUCT_TM_GMTOFF */
-
+#endif
+
*(p->conf.last_generated_accesslog_ts_ptr) = srv->cur_ts;
newts = 1;
}
-
+
buffer_append_string_buffer(b, p->conf.ts_accesslog_str);
-
+
break;
case FORMAT_REMOTE_HOST:
-
+
/* handle inet_ntop cache */
-
+
buffer_append_string(b, inet_ntop_cache_get_ip(srv, &(con->dst_addr)));
-
+
break;
case FORMAT_REMOTE_IDENT:
/* ident */
- buffer_append_string_len(b, CONST_STR_LEN("-"));
+ BUFFER_APPEND_STRING_CONST(b, "-");
break;
case FORMAT_REMOTE_USER:
if (con->authed_user->used > 1) {
buffer_append_string_buffer(b, con->authed_user);
} else {
- buffer_append_string_len(b, CONST_STR_LEN("-"));
+ BUFFER_APPEND_STRING_CONST(b, "-");
}
break;
case FORMAT_REQUEST_LINE:
if (con->request.request_line->used) {
- accesslog_append_escaped(b, con->request.request_line);
+ buffer_append_string_buffer(b, con->request.request_line);
}
break;
case FORMAT_STATUS:
buffer_append_long(b, con->http_status);
break;
-
+
case FORMAT_BYTES_OUT_NO_HEADER:
if (con->bytes_written > 0) {
- buffer_append_off_t(b,
+ buffer_append_off_t(b,
con->bytes_written - con->bytes_header <= 0 ? 0 : con->bytes_written - con->bytes_header);
} else {
- buffer_append_string_len(b, CONST_STR_LEN("-"));
+ BUFFER_APPEND_STRING_CONST(b, "-");
}
break;
case FORMAT_HEADER:
if (NULL != (ds = (data_string *)array_get_element(con->request.headers, p->conf.parsed_format->ptr[j]->string->ptr))) {
- accesslog_append_escaped(b, ds->value);
+ buffer_append_string_buffer(b, ds->value);
} else {
- buffer_append_string_len(b, CONST_STR_LEN("-"));
+ BUFFER_APPEND_STRING_CONST(b, "-");
}
break;
case FORMAT_RESPONSE_HEADER:
if (NULL != (ds = (data_string *)array_get_element(con->response.headers, p->conf.parsed_format->ptr[j]->string->ptr))) {
- accesslog_append_escaped(b, ds->value);
+ buffer_append_string_buffer(b, ds->value);
} else {
- buffer_append_string_len(b, CONST_STR_LEN("-"));
- }
- break;
- case FORMAT_ENV:
- if (NULL != (ds = (data_string *)array_get_element(con->environment, p->conf.parsed_format->ptr[j]->string->ptr))) {
- accesslog_append_escaped(b, ds->value);
- } else {
- buffer_append_string_len(b, CONST_STR_LEN("-"));
+ BUFFER_APPEND_STRING_CONST(b, "-");
}
break;
case FORMAT_FILENAME:
if (con->physical.path->used > 1) {
buffer_append_string_buffer(b, con->physical.path);
} else {
- buffer_append_string_len(b, CONST_STR_LEN("-"));
+ BUFFER_APPEND_STRING_CONST(b, "-");
}
break;
case FORMAT_BYTES_OUT:
if (con->bytes_written > 0) {
buffer_append_off_t(b, con->bytes_written);
} else {
- buffer_append_string_len(b, CONST_STR_LEN("-"));
+ BUFFER_APPEND_STRING_CONST(b, "-");
}
break;
case FORMAT_BYTES_IN:
if (con->bytes_read > 0) {
buffer_append_off_t(b, con->bytes_read);
} else {
- buffer_append_string_len(b, CONST_STR_LEN("-"));
+ BUFFER_APPEND_STRING_CONST(b, "-");
}
break;
case FORMAT_TIME_USED:
@@ -837,52 +756,36 @@ REQUESTDONE_FUNC(log_access_write) {
if (con->server_name->used > 1) {
buffer_append_string_buffer(b, con->server_name);
} else {
- buffer_append_string_len(b, CONST_STR_LEN("-"));
+ BUFFER_APPEND_STRING_CONST(b, "-");
}
break;
case FORMAT_HTTP_HOST:
if (con->uri.authority->used > 1) {
- accesslog_append_escaped(b, con->uri.authority);
+ buffer_append_string_buffer(b, con->uri.authority);
} else {
- buffer_append_string_len(b, CONST_STR_LEN("-"));
+ BUFFER_APPEND_STRING_CONST(b, "-");
}
break;
case FORMAT_REQUEST_PROTOCOL:
- buffer_append_string_len(b,
- con->request.http_version == HTTP_VERSION_1_1 ? "HTTP/1.1" : "HTTP/1.0", 8);
+ buffer_append_string(b,
+ con->request.http_version == HTTP_VERSION_1_1 ? "HTTP/1.1" : "HTTP/1.0");
break;
case FORMAT_REQUEST_METHOD:
buffer_append_string(b, get_http_method_name(con->request.http_method));
break;
- case FORMAT_PERCENT:
- buffer_append_string_len(b, CONST_STR_LEN("%"));
- break;
case FORMAT_SERVER_PORT:
- {
- const char *colon;
- buffer *srvtoken = ((server_socket*)(con->srv_socket))->srv_token;
- if (srvtoken->ptr[0] == '[') {
- colon = strstr(srvtoken->ptr, "]:");
- } else {
- colon = strchr(srvtoken->ptr, ':');
- }
- if (colon) {
- buffer_append_string(b, colon+1);
- } else {
- buffer_append_long(b, srv->srvconf.port);
- }
- }
+ buffer_append_long(b, srv->srvconf.port);
break;
case FORMAT_QUERY_STRING:
- accesslog_append_escaped(b, con->uri.query);
+ buffer_append_string_buffer(b, con->uri.query);
break;
case FORMAT_URL:
- accesslog_append_escaped(b, con->uri.path_raw);
+ buffer_append_string_buffer(b, con->uri.path_raw);
break;
case FORMAT_CONNECTION_STATUS:
switch(con->keep_alive) {
- case 0: buffer_append_string_len(b, CONST_STR_LEN("-")); break;
- default: buffer_append_string_len(b, CONST_STR_LEN("+")); break;
+ case 0: buffer_append_string(b, "-"); break;
+ default: buffer_append_string(b, "+"); break;
}
break;
default:
@@ -891,8 +794,9 @@ REQUESTDONE_FUNC(log_access_write) {
{ 'A', FORMAT_LOCAL_ADDR },
{ 'C', FORMAT_COOKIE },
{ 'D', FORMAT_TIME_USED_MS },
+ { 'e', FORMAT_ENV },
*/
-
+
break;
}
break;
@@ -900,43 +804,39 @@ REQUESTDONE_FUNC(log_access_write) {
break;
}
}
-
- buffer_append_string_len(b, CONST_STR_LEN("\n"));
+
+ BUFFER_APPEND_STRING_CONST(b, "\n");
if (p->conf.use_syslog || /* syslog doesn't cache */
- (p->conf.access_logfile->used && p->conf.access_logfile->ptr[0] == '|') || /* pipes don't cache */
+ (p->conf.access_logfile->used && p->conf.access_logfile->ptr[0] != '|') || /* pipes don't cache */
newts ||
b->used > BUFFER_MAX_REUSE_SIZE) {
if (p->conf.use_syslog) {
#ifdef HAVE_SYSLOG_H
- if (b->used > 2) {
- /* syslog appends a \n on its own */
- syslog(LOG_INFO, "%*s", (int) b->used - 2, b->ptr);
- }
+ syslog(LOG_INFO, "%*s", b->used - 1, b->ptr);
#endif
} else if (p->conf.log_access_fd != -1) {
write(p->conf.log_access_fd, b->ptr, b->used - 1);
}
buffer_reset(b);
}
-
+
return HANDLER_GO_ON;
}
-int mod_accesslog_plugin_init(plugin *p);
int mod_accesslog_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("accesslog");
-
+
p->init = mod_accesslog_init;
p->set_defaults= log_access_open;
p->cleanup = mod_accesslog_free;
-
+
p->handle_request_done = log_access_write;
p->handle_sighup = log_access_cycle;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_alias.c b/src/mod_alias.c
index 5b7b510..23570e4 100644
--- a/src/mod_alias.c
+++ b/src/mod_alias.c
@@ -1,14 +1,14 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
#include "plugin.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
/* plugin config for all request/connections */
typedef struct {
array *alias;
@@ -16,46 +16,44 @@ typedef struct {
typedef struct {
PLUGIN_DATA;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
/* init the plugin data */
INIT_FUNC(mod_alias_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
-
-
+
+
+
return p;
}
/* detroy the plugin data */
FREE_FUNC(mod_alias_free) {
plugin_data *p = p_d;
-
+
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
- if(!s) continue;
-
+
array_free(s->alias);
-
+
free(s);
}
free(p->config_storage);
}
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -64,25 +62,25 @@ FREE_FUNC(mod_alias_free) {
SETDEFAULTS_FUNC(mod_alias_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "alias.url", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
- s->alias = array_init();
+ s->alias = array_init();
cv[0].destination = s->alias;
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
@@ -103,15 +101,16 @@ SETDEFAULTS_FUNC(mod_alias_set_defaults) {
}
/* ok, they have same prefix. check position */
if (a->sorted[j] < a->sorted[k]) {
- log_error_write(srv, __FILE__, __LINE__, "SBSBS",
- "url.alias: `", key, "' will never match as `", prefix, "' matched first");
+ fprintf(stderr, "url.alias: `%s' will never match as `%s' matched first\n",
+ key->ptr,
+ prefix->ptr);
return HANDLER_ERROR;
}
}
}
}
}
-
+
return HANDLER_GO_ON;
}
@@ -120,27 +119,27 @@ SETDEFAULTS_FUNC(mod_alias_set_defaults) {
static int mod_alias_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(alias);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("alias.url"))) {
PATCH(alias);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -150,54 +149,51 @@ PHYSICALPATH_FUNC(mod_alias_physical_handler) {
int uri_len, basedir_len;
char *uri_ptr;
size_t k;
-
+
if (con->physical.path->used == 0) return HANDLER_GO_ON;
-
+
mod_alias_patch_connection(srv, con, p);
-
+
/* not to include the tailing slash */
basedir_len = (con->physical.basedir->used - 1) - 1;
uri_len = con->physical.path->used - 1 - basedir_len;
uri_ptr = con->physical.path->ptr + basedir_len;
-
+
for (k = 0; k < p->conf.alias->used; k++) {
data_string *ds = (data_string *)p->conf.alias->data[k];
int alias_len = ds->key->used - 1;
-
+
if (alias_len > uri_len) continue;
if (ds->key->used == 0) continue;
-
- if (0 == (con->conf.force_lowercase_filenames ?
- strncasecmp(uri_ptr, ds->key->ptr, alias_len) :
- strncmp(uri_ptr, ds->key->ptr, alias_len))) {
+
+ if (0 == strncmp(uri_ptr, ds->key->ptr, alias_len)) {
/* matched */
-
+
buffer_copy_string_buffer(con->physical.basedir, ds->value);
buffer_copy_string_buffer(srv->tmp_buf, ds->value);
buffer_append_string(srv->tmp_buf, uri_ptr + alias_len);
buffer_copy_string_buffer(con->physical.path, srv->tmp_buf);
-
+
return HANDLER_GO_ON;
}
}
-
+
/* not found */
return HANDLER_GO_ON;
}
/* this function is called at dlopen() time and inits the callbacks */
-int mod_alias_plugin_init(plugin *p);
int mod_alias_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("alias");
-
+
p->init = mod_alias_init;
p->handle_physical= mod_alias_physical_handler;
p->set_defaults = mod_alias_set_defaults;
p->cleanup = mod_alias_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_auth.c b/src/mod_auth.c
index d981892..703107c 100644
--- a/src/mod_auth.c
+++ b/src/mod_auth.c
@@ -1,8 +1,3 @@
-#include "plugin.h"
-#include "http_auth.h"
-#include "log.h"
-#include "response.h"
-
#include <sys/types.h>
#include <sys/stat.h>
@@ -12,84 +7,89 @@
#include <fcntl.h>
#include <unistd.h>
+#include "plugin.h"
+#include "http_auth.h"
+#include "log.h"
+#include "response.h"
+
handler_t auth_ldap_init(server *srv, mod_auth_plugin_config *s);
/**
* the basic and digest auth framework
- *
+ *
* - config handling
* - protocol handling
- *
- * http_auth.c
- * http_auth_digest.c
- *
+ *
+ * http_auth.c
+ * http_auth_digest.c
+ *
* do the real work
*/
INIT_FUNC(mod_auth_init) {
mod_auth_plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->tmp_buf = buffer_init();
-
+
p->auth_user = buffer_init();
#ifdef USE_LDAP
p->ldap_filter = buffer_init();
#endif
-
+
return p;
}
FREE_FUNC(mod_auth_free) {
mod_auth_plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
buffer_free(p->tmp_buf);
buffer_free(p->auth_user);
#ifdef USE_LDAP
buffer_free(p->ldap_filter);
#endif
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
mod_auth_plugin_config *s = p->config_storage[i];
-
+
if (!s) continue;
-
+
array_free(s->auth_require);
buffer_free(s->auth_plain_groupfile);
buffer_free(s->auth_plain_userfile);
buffer_free(s->auth_htdigest_userfile);
buffer_free(s->auth_htpasswd_userfile);
buffer_free(s->auth_backend_conf);
-
+
buffer_free(s->auth_ldap_hostname);
buffer_free(s->auth_ldap_basedn);
buffer_free(s->auth_ldap_binddn);
buffer_free(s->auth_ldap_bindpw);
buffer_free(s->auth_ldap_filter);
buffer_free(s->auth_ldap_cafile);
-
+
#ifdef USE_LDAP
buffer_free(s->ldap_filter_pre);
buffer_free(s->ldap_filter_post);
-
+
if (s->ldap) ldap_unbind_s(s->ldap);
#endif
-
+
free(s);
}
free(p->config_storage);
}
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -113,25 +113,24 @@ static int mod_auth_patch_connection(server *srv, connection *con, mod_auth_plug
PATCH(auth_ldap_filter);
PATCH(auth_ldap_cafile);
PATCH(auth_ldap_starttls);
- PATCH(auth_ldap_allow_empty_pw);
#ifdef USE_LDAP
- p->anon_conf = s;
+ PATCH(ldap);
PATCH(ldap_filter_pre);
PATCH(ldap_filter_post);
#endif
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend"))) {
PATCH(auth_backend);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.plain.groupfile"))) {
@@ -149,30 +148,22 @@ static int mod_auth_patch_connection(server *srv, connection *con, mod_auth_plug
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.hostname"))) {
PATCH(auth_ldap_hostname);
#ifdef USE_LDAP
- p->anon_conf = s;
+ PATCH(ldap);
+ PATCH(ldap_filter_pre);
+ PATCH(ldap_filter_post);
#endif
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.base-dn"))) {
PATCH(auth_ldap_basedn);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.filter"))) {
PATCH(auth_ldap_filter);
-#ifdef USE_LDAP
- PATCH(ldap_filter_pre);
- PATCH(ldap_filter_post);
-#endif
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.ca-file"))) {
PATCH(auth_ldap_cafile);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.starttls"))) {
PATCH(auth_ldap_starttls);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.bind-dn"))) {
- PATCH(auth_ldap_binddn);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.bind-pw"))) {
- PATCH(auth_ldap_bindpw);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.allow-empty-pw"))) {
- PATCH(auth_ldap_allow_empty_pw);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -181,121 +172,104 @@ static handler_t mod_auth_uri_handler(server *srv, connection *con, void *p_d) {
size_t k;
int auth_required = 0, auth_satisfied = 0;
char *http_authorization = NULL;
- const char *auth_type = NULL;
data_string *ds;
mod_auth_plugin_data *p = p_d;
array *req;
-
+
/* select the right config */
mod_auth_patch_connection(srv, con, p);
-
+
if (p->conf.auth_require == NULL) return HANDLER_GO_ON;
-
+
/*
* AUTH
- *
+ *
*/
-
+
/* do we have to ask for auth ? */
-
+
auth_required = 0;
auth_satisfied = 0;
-
+
/* search auth-directives for path */
for (k = 0; k < p->conf.auth_require->used; k++) {
- buffer *require = p->conf.auth_require->data[k]->key;
-
- if (require->used == 0) continue;
- if (con->uri.path->used < require->used) continue;
-
- /* if we have a case-insensitive FS we have to lower-case the URI here too */
-
- if (con->conf.force_lowercase_filenames) {
- if (0 == strncasecmp(con->uri.path->ptr, require->ptr, require->used - 1)) {
- auth_required = 1;
- break;
- }
- } else {
- if (0 == strncmp(con->uri.path->ptr, require->ptr, require->used - 1)) {
- auth_required = 1;
- break;
- }
+ if (p->conf.auth_require->data[k]->key->used == 0) continue;
+
+ if (0 == strncmp(con->uri.path->ptr, p->conf.auth_require->data[k]->key->ptr, p->conf.auth_require->data[k]->key->used - 1)) {
+ auth_required = 1;
+ break;
}
}
-
+
/* nothing to do for us */
if (auth_required == 0) return HANDLER_GO_ON;
-
+
req = ((data_array *)(p->conf.auth_require->data[k]))->value;
-
+
/* try to get Authorization-header */
-
+
if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Authorization"))) {
http_authorization = ds->value->ptr;
}
-
+
if (ds && ds->value && ds->value->used) {
char *auth_realm;
data_string *method;
-
+
method = (data_string *)array_get_element(req, "method");
-
+
/* parse auth-header */
if (NULL != (auth_realm = strchr(http_authorization, ' '))) {
int auth_type_len = auth_realm - http_authorization;
-
+
if ((auth_type_len == 5) &&
- (0 == strncasecmp(http_authorization, "Basic", auth_type_len))) {
- auth_type = "Basic";
-
+ (0 == strncmp(http_authorization, "Basic", auth_type_len))) {
+
if (0 == strcmp(method->value->ptr, "basic")) {
auth_satisfied = http_auth_basic_check(srv, con, p, req, con->uri.path, auth_realm+1);
}
} else if ((auth_type_len == 6) &&
- (0 == strncasecmp(http_authorization, "Digest", auth_type_len))) {
- auth_type = "Digest";
+ (0 == strncmp(http_authorization, "Digest", auth_type_len))) {
if (0 == strcmp(method->value->ptr, "digest")) {
if (-1 == (auth_satisfied = http_auth_digest_check(srv, con, p, req, con->uri.path, auth_realm+1))) {
con->http_status = 400;
- con->mode = DIRECT;
-
+
/* a field was missing */
-
+
return HANDLER_FINISHED;
}
}
} else {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"unknown authentification type:",
http_authorization);
}
}
}
-
+
if (!auth_satisfied) {
data_string *method, *realm;
method = (data_string *)array_get_element(req, "method");
realm = (data_string *)array_get_element(req, "realm");
-
+
con->http_status = 401;
- con->mode = DIRECT;
-
+
if (0 == strcmp(method->value->ptr, "basic")) {
- buffer_copy_string_len(p->tmp_buf, CONST_STR_LEN("Basic realm=\""));
+ buffer_copy_string(p->tmp_buf, "Basic realm=\"");
buffer_append_string_buffer(p->tmp_buf, realm->value);
- buffer_append_string_len(p->tmp_buf, CONST_STR_LEN("\""));
-
+ buffer_append_string(p->tmp_buf, "\"");
+
response_header_insert(srv, con, CONST_STR_LEN("WWW-Authenticate"), CONST_BUF_LEN(p->tmp_buf));
} else if (0 == strcmp(method->value->ptr, "digest")) {
char hh[33];
http_auth_digest_generate_nonce(srv, p, srv->tmp_buf, hh);
-
- buffer_copy_string_len(p->tmp_buf, CONST_STR_LEN("Digest realm=\""));
+
+ buffer_copy_string(p->tmp_buf, "Digest realm=\"");
buffer_append_string_buffer(p->tmp_buf, realm->value);
- buffer_append_string_len(p->tmp_buf, CONST_STR_LEN("\", nonce=\""));
+ buffer_append_string(p->tmp_buf, "\", nonce=\"");
buffer_append_string(p->tmp_buf, hh);
- buffer_append_string_len(p->tmp_buf, CONST_STR_LEN("\", qop=\"auth\""));
-
+ buffer_append_string(p->tmp_buf, "\", qop=\"auth\"");
+
response_header_insert(srv, con, CONST_STR_LEN("WWW-Authenticate"), CONST_BUF_LEN(p->tmp_buf));
} else {
/* evil */
@@ -303,47 +277,35 @@ static handler_t mod_auth_uri_handler(server *srv, connection *con, void *p_d) {
return HANDLER_FINISHED;
} else {
/* the REMOTE_USER header */
-
+
buffer_copy_string_buffer(con->authed_user, p->auth_user);
-
- /* AUTH_TYPE environment */
-
- if (NULL == (ds = (data_string *)array_get_unused_element(con->environment, TYPE_STRING))) {
- ds = data_string_init();
- }
-
- buffer_copy_string(ds->key, "AUTH_TYPE");
- buffer_copy_string(ds->value, auth_type);
-
- array_insert_unique(con->environment, (data_unset *)ds);
}
-
+
return HANDLER_GO_ON;
}
SETDEFAULTS_FUNC(mod_auth_set_defaults) {
mod_auth_plugin_data *p = p_d;
size_t i;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "auth.backend", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { "auth.backend.plain.groupfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
- { "auth.backend.plain.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
- { "auth.require", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
- { "auth.backend.ldap.hostname", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 4 */
- { "auth.backend.ldap.base-dn", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
- { "auth.backend.ldap.filter", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 6 */
- { "auth.backend.ldap.ca-file", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
- { "auth.backend.ldap.starttls", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
- { "auth.backend.ldap.bind-dn", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
+ { "auth.backend.plain.groupfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
+ { "auth.backend.plain.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
+ { "auth.require", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION },
+ { "auth.backend.ldap.hostname", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
+ { "auth.backend.ldap.base-dn", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
+ { "auth.backend.ldap.filter", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
+ { "auth.backend.ldap.ca-file", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
+ { "auth.backend.ldap.starttls", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
+ { "auth.backend.ldap.bind-dn", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
{ "auth.backend.ldap.bind-pw", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
- { "auth.backend.ldap.allow-empty-pw", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
- { "auth.backend.htdigest.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
- { "auth.backend.htpasswd.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
- { "auth.debug", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 14 */
+ { "auth.backend.htdigest.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
+ { "auth.backend.htpasswd.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
+ { "auth.debug", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
@@ -351,14 +313,14 @@ SETDEFAULTS_FUNC(mod_auth_set_defaults) {
size_t n;
data_array *da;
array *ca;
-
+
s = calloc(1, sizeof(mod_auth_plugin_config));
s->auth_plain_groupfile = buffer_init();
s->auth_plain_userfile = buffer_init();
s->auth_htdigest_userfile = buffer_init();
s->auth_htpasswd_userfile = buffer_init();
s->auth_backend_conf = buffer_init();
-
+
s->auth_ldap_hostname = buffer_init();
s->auth_ldap_basedn = buffer_init();
s->auth_ldap_binddn = buffer_init();
@@ -367,15 +329,15 @@ SETDEFAULTS_FUNC(mod_auth_set_defaults) {
s->auth_ldap_cafile = buffer_init();
s->auth_ldap_starttls = 0;
s->auth_debug = 0;
-
+
s->auth_require = array_init();
-
+
#ifdef USE_LDAP
s->ldap_filter_pre = buffer_init();
s->ldap_filter_post = buffer_init();
s->ldap = NULL;
#endif
-
+
cv[0].destination = s->auth_backend_conf;
cv[1].destination = s->auth_plain_groupfile;
cv[2].destination = s->auth_plain_userfile;
@@ -385,20 +347,19 @@ SETDEFAULTS_FUNC(mod_auth_set_defaults) {
cv[6].destination = s->auth_ldap_filter;
cv[7].destination = s->auth_ldap_cafile;
cv[8].destination = &(s->auth_ldap_starttls);
- cv[9].destination = s->auth_ldap_binddn;
- cv[10].destination = s->auth_ldap_bindpw;
- cv[11].destination = &(s->auth_ldap_allow_empty_pw);
- cv[12].destination = s->auth_htdigest_userfile;
- cv[13].destination = s->auth_htpasswd_userfile;
- cv[14].destination = &(s->auth_debug);
-
+ cv[9].destination = s->auth_ldap_binddn;
+ cv[10].destination = s->auth_ldap_bindpw;
+ cv[11].destination = s->auth_htdigest_userfile;
+ cv[12].destination = s->auth_htpasswd_userfile;
+ cv[13].destination = &(s->auth_debug);
+
p->config_storage[i] = s;
ca = ((data_config *)srv->config_context->data[i])->value;
-
+
if (0 != config_insert_values_global(srv, ca, cv)) {
return HANDLER_ERROR;
}
-
+
if (s->auth_backend_conf->used) {
if (0 == strcmp(s->auth_backend_conf->ptr, "htpasswd")) {
s->auth_backend = AUTH_BACKEND_HTPASSWD;
@@ -410,48 +371,30 @@ SETDEFAULTS_FUNC(mod_auth_set_defaults) {
s->auth_backend = AUTH_BACKEND_LDAP;
} else {
log_error_write(srv, __FILE__, __LINE__, "sb", "auth.backend not supported:", s->auth_backend_conf);
-
- return HANDLER_ERROR;
- }
- }
-
-#ifdef USE_LDAP
- if (s->auth_ldap_filter->used) {
- char *dollar;
-
- /* parse filter */
-
- if (NULL == (dollar = strchr(s->auth_ldap_filter->ptr, '$'))) {
- log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.filter is missing a replace-operator '$'");
-
+
return HANDLER_ERROR;
}
-
- buffer_copy_string_len(s->ldap_filter_pre, s->auth_ldap_filter->ptr, dollar - s->auth_ldap_filter->ptr);
- buffer_copy_string(s->ldap_filter_post, dollar+1);
}
-#endif
/* no auth.require for this section */
if (NULL == (da = (data_array *)array_get_element(ca, "auth.require"))) continue;
-
+
if (da->type != TYPE_ARRAY) continue;
-
+
for (n = 0; n < da->value->used; n++) {
size_t m;
data_array *da_file = (data_array *)da->value->data[n];
const char *method, *realm, *require;
-
+
if (da->value->data[n]->type != TYPE_ARRAY) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "auth.require should contain an array as in:",
- "auth.require = ( \"...\" => ( ..., ...) )");
-
+ log_error_write(srv, __FILE__, __LINE__, "sssbs",
+ "unexpected type for key: ", "auth.require", "[", da->value->data[n]->key, "](string)");
+
return HANDLER_ERROR;
}
-
+
method = realm = require = NULL;
-
+
for (m = 0; m < da_file->value->used; m++) {
if (da_file->value->data[m]->type == TYPE_STRING) {
if (0 == strcmp(da_file->value->data[m]->key->ptr, "method")) {
@@ -461,174 +404,206 @@ SETDEFAULTS_FUNC(mod_auth_set_defaults) {
} else if (0 == strcmp(da_file->value->data[m]->key->ptr, "require")) {
require = ((data_string *)(da_file->value->data[m]))->value->ptr;
} else {
- log_error_write(srv, __FILE__, __LINE__, "ssbs",
- "the field is unknown in:",
- "auth.require = ( \"...\" => ( ..., -> \"",
- da_file->value->data[m]->key,
- "\" <- => \"...\" ) )");
-
+ log_error_write(srv, __FILE__, __LINE__, "sssbs", "unexpected type for key: ", "auth.require", "[", da_file->value->data[m]->key, "](string)");
return HANDLER_ERROR;
}
} else {
- log_error_write(srv, __FILE__, __LINE__, "ssbs",
- "a string was expected for:",
- "auth.require = ( \"...\" => ( ..., -> \"",
- da_file->value->data[m]->key,
- "\" <- => \"...\" ) )");
-
+ log_error_write(srv, __FILE__, __LINE__, "sssbs", "unexpected type for key: ", "auth.require", "[", da_file->value->data[m]->key, "](string)");
+
return HANDLER_ERROR;
}
}
-
+
if (method == NULL) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "the method field is missing in:",
- "auth.require = ( \"...\" => ( ..., \"method\" => \"...\" ) )");
+ log_error_write(srv, __FILE__, __LINE__, "sssss", "missing entry for key: ", "auth.require", "[", "method", "](string)");
return HANDLER_ERROR;
} else {
if (0 != strcmp(method, "basic") &&
0 != strcmp(method, "digest")) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "method has to be either \"basic\" or \"digest\" in",
- "auth.require = ( \"...\" => ( ..., \"method\" => \"...\") )");
+ log_error_write(srv, __FILE__, __LINE__, "s", "auth.require->method has to be either 'basic' or 'digest'");
return HANDLER_ERROR;
}
}
-
+
if (realm == NULL) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "the realm field is missing in:",
- "auth.require = ( \"...\" => ( ..., \"realm\" => \"...\" ) )");
+ log_error_write(srv, __FILE__, __LINE__, "sssss", "missing entry for key: ", "auth.require", "[", "realm", "](string)");
return HANDLER_ERROR;
}
-
+
if (require == NULL) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "the require field is missing in:",
- "auth.require = ( \"...\" => ( ..., \"require\" => \"...\" ) )");
+ log_error_write(srv, __FILE__, __LINE__, "sssss", "missing entry for key: ", "auth.require", "[", "require", "](string)");
return HANDLER_ERROR;
}
-
+
if (method && realm && require) {
data_string *ds;
data_array *a;
-
+
a = data_array_init();
buffer_copy_string_buffer(a->key, da_file->key);
-
+
ds = data_string_init();
-
- buffer_copy_string_len(ds->key, CONST_STR_LEN("method"));
+
+ buffer_copy_string(ds->key, "method");
buffer_copy_string(ds->value, method);
-
+
array_insert_unique(a->value, (data_unset *)ds);
-
+
ds = data_string_init();
-
- buffer_copy_string_len(ds->key, CONST_STR_LEN("realm"));
+
+ buffer_copy_string(ds->key, "realm");
buffer_copy_string(ds->value, realm);
-
+
array_insert_unique(a->value, (data_unset *)ds);
-
+
ds = data_string_init();
-
- buffer_copy_string_len(ds->key, CONST_STR_LEN("require"));
+
+ buffer_copy_string(ds->key, "require");
buffer_copy_string(ds->value, require);
-
+
array_insert_unique(a->value, (data_unset *)ds);
-
+
array_insert_unique(s->auth_require, (data_unset *)a);
}
}
-
- switch(s->auth_ldap_hostname->used) {
+
+ switch(s->auth_backend) {
+ case AUTH_BACKEND_PLAIN:
+ if (s->auth_plain_userfile->used) {
+ int fd;
+ /* try to read */
+ if (-1 == (fd = open(s->auth_plain_userfile->ptr, O_RDONLY))) {
+ log_error_write(srv, __FILE__, __LINE__, "sbss",
+ "opening auth.backend.plain.userfile:", s->auth_plain_userfile,
+ "failed:", strerror(errno));
+ return HANDLER_ERROR;
+ }
+ close(fd);
+ }
+ break;
+ case AUTH_BACKEND_HTPASSWD:
+ if (s->auth_htpasswd_userfile->used) {
+ int fd;
+ /* try to read */
+ if (-1 == (fd = open(s->auth_htpasswd_userfile->ptr, O_RDONLY))) {
+ log_error_write(srv, __FILE__, __LINE__, "sbss",
+ "opening auth.backend.htpasswd.userfile:", s->auth_htpasswd_userfile,
+ "failed:", strerror(errno));
+ return HANDLER_ERROR;
+ }
+ close(fd);
+ }
+ break;
+ case AUTH_BACKEND_HTDIGEST:
+ if (s->auth_htdigest_userfile->used) {
+ int fd;
+ /* try to read */
+ if (-1 == (fd = open(s->auth_htdigest_userfile->ptr, O_RDONLY))) {
+ log_error_write(srv, __FILE__, __LINE__, "sbss",
+ "opening auth.backend.htdigest.userfile:", s->auth_htdigest_userfile,
+ "failed:", strerror(errno));
+ return HANDLER_ERROR;
+ }
+ close(fd);
+ }
+ break;
case AUTH_BACKEND_LDAP: {
handler_t ret = auth_ldap_init(srv, s);
if (ret == HANDLER_ERROR)
return (ret);
- break;
+ break;
}
- default:
- break;
- }
- }
+ default:
+ break;
+ }
+ }
- return HANDLER_GO_ON;
+ return HANDLER_GO_ON;
}
handler_t auth_ldap_init(server *srv, mod_auth_plugin_config *s) {
#ifdef USE_LDAP
- int ret;
-#if 0
- if (s->auth_ldap_basedn->used == 0) {
- log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.base-dn has to be set");
-
- return HANDLER_ERROR;
- }
+ int ret;
+#if 0
+ if (s->auth_ldap_basedn->used == 0) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.base-dn has to be set");
+
+ return HANDLER_ERROR;
+ }
#endif
-
- if (s->auth_ldap_hostname->used) {
- /* free old context */
- if (NULL != s->ldap) ldap_unbind_s(s->ldap);
-
- if (NULL == (s->ldap = ldap_init(s->auth_ldap_hostname->ptr, LDAP_PORT))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "ldap ...", strerror(errno));
-
- return HANDLER_ERROR;
- }
-
- ret = LDAP_VERSION3;
- if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(s->ldap, LDAP_OPT_PROTOCOL_VERSION, &ret))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
-
- return HANDLER_ERROR;
- }
-
- if (s->auth_ldap_starttls) {
- /* if no CA file is given, it is ok, as we will use encryption
- * if the server requires a CAfile it will tell us */
- if (!buffer_is_empty(s->auth_ldap_cafile)) {
- if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTFILE,
- s->auth_ldap_cafile->ptr))) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "Loading CA certificate failed:", ldap_err2string(ret));
-
+
+ if (s->auth_ldap_filter->used) {
+ char *dollar;
+
+ /* parse filter */
+
+ if (NULL == (dollar = strchr(s->auth_ldap_filter->ptr, '$'))) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.filter is missing a replace-operator '$'");
+
return HANDLER_ERROR;
}
+
+ buffer_copy_string_len(s->ldap_filter_pre, s->auth_ldap_filter->ptr, dollar - s->auth_ldap_filter->ptr);
+ buffer_copy_string(s->ldap_filter_post, dollar+1);
}
+
+ if (s->auth_ldap_hostname->used) {
+ if (NULL == (s->ldap = ldap_init(s->auth_ldap_hostname->ptr, LDAP_PORT))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "ldap ...", strerror(errno));
+
+ return HANDLER_ERROR;
+ }
+
+ ret = LDAP_VERSION3;
+ if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(s->ldap, LDAP_OPT_PROTOCOL_VERSION, &ret))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
+
+ return HANDLER_ERROR;
+ }
- if (LDAP_OPT_SUCCESS != (ret = ldap_start_tls_s(s->ldap, NULL, NULL))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "ldap startTLS failed:", ldap_err2string(ret));
-
- return HANDLER_ERROR;
- }
- }
-
-
- /* 1. */
- if (s->auth_ldap_binddn->used) {
- if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(s->ldap, s->auth_ldap_binddn->ptr, s->auth_ldap_bindpw->ptr))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
-
- return HANDLER_ERROR;
- }
- } else {
- if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(s->ldap, NULL, NULL))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
-
- return HANDLER_ERROR;
+ if (s->auth_ldap_starttls) {
+ /* if no CA file is given, it is ok, as we will use encryption
+ * if the server requires a CAfile it will tell us */
+ if (!buffer_is_empty(s->auth_ldap_cafile)) {
+ if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTFILE,
+ s->auth_ldap_cafile->ptr))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "Loading CA certificate failed:", ldap_err2string(ret));
+
+ return HANDLER_ERROR;
+ }
+ }
+
+ if (LDAP_OPT_SUCCESS != (ret = ldap_start_tls_s(s->ldap, NULL, NULL))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "ldap startTLS failed:", ldap_err2string(ret));
+
+ return HANDLER_ERROR;
+ }
+ }
+
+
+ /* 1. */
+ if (s->auth_ldap_binddn->used) {
+ if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(s->ldap, s->auth_ldap_binddn->ptr, s->auth_ldap_bindpw->ptr))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
+
+ return HANDLER_ERROR;
+ }
+ } else {
+ if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(s->ldap, NULL, NULL))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret));
+
+ return HANDLER_ERROR;
+ }
+ }
}
- }
- }
- return HANDLER_GO_ON;
#else
- UNUSED(s);
- log_error_write(srv, __FILE__, __LINE__, "s", "no ldap support available");
- return HANDLER_ERROR;
+ log_error_write(srv, __FILE__, __LINE__, "s", "no ldap support available");
+ return HANDLER_ERROR;
#endif
+ return HANDLER_GO_ON;
}
-int mod_auth_plugin_init(plugin *p);
int mod_auth_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("auth");
@@ -636,8 +611,8 @@ int mod_auth_plugin_init(plugin *p) {
p->set_defaults = mod_auth_set_defaults;
p->handle_uri_clean = mod_auth_uri_handler;
p->cleanup = mod_auth_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_cgi.c b/src/mod_cgi.c
index c50bfd1..d747ccf 100644
--- a/src/mod_cgi.c
+++ b/src/mod_cgi.c
@@ -1,23 +1,15 @@
-#include "server.h"
-#include "stat_cache.h"
-#include "keyvalue.h"
-#include "log.h"
-#include "connections.h"
-#include "joblist.h"
-#include "http_chunk.h"
-
-#include "plugin.h"
-
#include <sys/types.h>
-
#ifdef __WIN32
-# include <winsock2.h>
+#include <winsock2.h>
#else
-# include <sys/socket.h>
-# include <sys/wait.h>
-# include <sys/mman.h>
-# include <netinet/in.h>
-# include <arpa/inet.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <sys/mman.h>
+#include <sys/fcntl.h>
+
+#include <netinet/in.h>
+
+#include <arpa/inet.h>
#endif
#include <unistd.h>
@@ -30,19 +22,25 @@
#include <assert.h>
#include <stdio.h>
-#include <fcntl.h>
+
+#include "server.h"
+#include "keyvalue.h"
+#include "log.h"
+#include "connections.h"
+#include "joblist.h"
+#include "http_chunk.h"
+
+#include "plugin.h"
#ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h>
#endif
-#include "version.h"
-
enum {EOL_UNSET, EOL_N, EOL_RN};
typedef struct {
char **ptr;
-
+
size_t size;
size_t used;
} char_array;
@@ -55,29 +53,28 @@ typedef struct {
typedef struct {
array *cgi;
- unsigned short execute_x_only;
} plugin_config;
typedef struct {
PLUGIN_DATA;
buffer_pid_t cgi_pid;
-
+
buffer *tmp_buf;
buffer *parse_response;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
typedef struct {
pid_t pid;
int fd;
int fde_ndx; /* index into the fd-event buffer */
-
+
connection *remote_conn; /* dumb pointer */
plugin_data *plugin_data; /* dumb pointer */
-
+
buffer *response;
buffer *response_header;
} handler_ctx;
@@ -86,17 +83,17 @@ static handler_ctx * cgi_handler_ctx_init() {
handler_ctx *hctx = calloc(1, sizeof(*hctx));
assert(hctx);
-
+
hctx->response = buffer_init();
hctx->response_header = buffer_init();
-
+
return hctx;
}
static void cgi_handler_ctx_free(handler_ctx *hctx) {
buffer_free(hctx->response);
buffer_free(hctx->response_header);
-
+
free(hctx);
}
@@ -104,14 +101,14 @@ enum {FDEVENT_HANDLED_UNSET, FDEVENT_HANDLED_FINISHED, FDEVENT_HANDLED_NOT_FINIS
INIT_FUNC(mod_cgi_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
assert(p);
-
+
p->tmp_buf = buffer_init();
p->parse_response = buffer_init();
-
+
return p;
}
@@ -119,65 +116,62 @@ INIT_FUNC(mod_cgi_init) {
FREE_FUNC(mod_cgi_free) {
plugin_data *p = p_d;
buffer_pid_t *r = &(p->cgi_pid);
-
+
UNUSED(srv);
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
array_free(s->cgi);
-
+
free(s);
}
free(p->config_storage);
}
-
+
if (r->ptr) free(r->ptr);
-
+
buffer_free(p->tmp_buf);
buffer_free(p->parse_response);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "cgi.assign", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { "cgi.execute-x-only", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET}
};
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
assert(s);
-
+
s->cgi = array_init();
- s->execute_x_only = 0;
-
+
cv[0].destination = s->cgi;
- cv[1].destination = &(s->execute_x_only);
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
}
-
+
return HANDLER_GO_ON;
}
@@ -186,13 +180,13 @@ static int cgi_pid_add(server *srv, plugin_data *p, pid_t pid) {
int m = -1;
size_t i;
buffer_pid_t *r = &(p->cgi_pid);
-
+
UNUSED(srv);
for (i = 0; i < r->used; i++) {
if (r->ptr[i] > m) m = r->ptr[i];
}
-
+
if (r->size == 0) {
r->size = 16;
r->ptr = malloc(sizeof(*r->ptr) * r->size);
@@ -200,96 +194,93 @@ static int cgi_pid_add(server *srv, plugin_data *p, pid_t pid) {
r->size += 16;
r->ptr = realloc(r->ptr, sizeof(*r->ptr) * r->size);
}
-
+
r->ptr[r->used++] = pid;
-
+
return m;
}
static int cgi_pid_del(server *srv, plugin_data *p, pid_t pid) {
size_t i;
buffer_pid_t *r = &(p->cgi_pid);
-
+
UNUSED(srv);
for (i = 0; i < r->used; i++) {
if (r->ptr[i] == pid) break;
}
-
+
if (i != r->used) {
/* found */
-
+
if (i != r->used - 1) {
r->ptr[i] = r->ptr[r->used - 1];
}
r->used--;
}
-
+
return 0;
}
-static int cgi_response_parse(server *srv, connection *con, plugin_data *p, buffer *in) {
+static int cgi_response_parse(server *srv, connection *con, plugin_data *p, buffer *in, int eol) {
char *ns;
const char *s;
int line = 0;
-
+
UNUSED(srv);
-
+
buffer_copy_string_buffer(p->parse_response, in);
-
- for (s = p->parse_response->ptr;
- NULL != (ns = strchr(s, '\n'));
- s = ns + 1, line++) {
+
+ for (s = p->parse_response->ptr;
+ NULL != (ns = (eol == EOL_RN ? strstr(s, "\r\n") : strchr(s, '\n')));
+ s = ns + (eol == EOL_RN ? 2 : 1), line++) {
const char *key, *value;
int key_len;
data_string *ds;
-
- /* strip the \n */
+
ns[0] = '\0';
-
- if (ns > s && ns[-1] == '\r') ns[-1] = '\0';
-
- if (line == 0 &&
+
+ if (line == 0 &&
0 == strncmp(s, "HTTP/1.", 7)) {
/* non-parsed header ... we parse them anyway */
-
+
if ((s[7] == '1' ||
s[7] == '0') &&
s[8] == ' ') {
int status;
/* after the space should be a status code for us */
-
+
status = strtol(s+9, NULL, 10);
-
- if (status >= 100 &&
- status < 1000) {
+
+ if (con->http_status >= 100 &&
+ con->http_status < 1000) {
/* we expected 3 digits and didn't got them */
con->parsed_response |= HTTP_STATUS;
con->http_status = status;
}
}
} else {
- /* parse the headers */
+
key = s;
if (NULL == (value = strchr(s, ':'))) {
/* we expect: "<key>: <value>\r\n" */
continue;
}
-
+
key_len = value - key;
value += 1;
-
+
/* skip LWS */
while (*value == ' ' || *value == '\t') value++;
-
+
if (NULL == (ds = (data_string *)array_get_unused_element(con->response.headers, TYPE_STRING))) {
ds = data_response_init();
}
buffer_copy_string_len(ds->key, key, key_len);
buffer_copy_string(ds->value, value);
-
+
array_insert_unique(con->response.headers, (data_unset *)ds);
-
+
switch(key_len) {
case 4:
if (0 == strncasecmp(key, "Date", key_len)) {
@@ -324,13 +315,13 @@ static int cgi_response_parse(server *srv, connection *con, plugin_data *p, buff
}
}
}
-
+
/* CGI/1.1 rev 03 - 7.2.1.2 */
if ((con->parsed_response & HTTP_LOCATION) &&
!(con->parsed_response & HTTP_STATUS)) {
con->http_status = 302;
}
-
+
return 0;
}
@@ -338,22 +329,11 @@ static int cgi_response_parse(server *srv, connection *con, plugin_data *p, buff
static int cgi_demux_response(server *srv, handler_ctx *hctx) {
plugin_data *p = hctx->plugin_data;
connection *con = hctx->remote_conn;
-
+
while(1) {
int n;
- int toread;
-
-#if defined(__WIN32)
- buffer_prepare_copy(hctx->response, 4 * 1024);
-#else
- if (ioctl(con->fd, FIONREAD, &toread) || toread == 0 || toread <= 4*1024) {
- buffer_prepare_copy(hctx->response, 4 * 1024);
- } else {
- if (toread > MAX_READ_LIMIT) toread = MAX_READ_LIMIT;
- buffer_prepare_copy(hctx->response, toread + 1);
- }
-#endif
-
+
+ buffer_prepare_copy(hctx->response, 1024);
if (-1 == (n = read(hctx->fd, hctx->response->ptr, hctx->response->size - 1))) {
if (errno == EAGAIN || errno == EINTR) {
/* would block, wait for signal */
@@ -363,153 +343,125 @@ static int cgi_demux_response(server *srv, handler_ctx *hctx) {
log_error_write(srv, __FILE__, __LINE__, "sdd", strerror(errno), con->fd, hctx->fd);
return FDEVENT_HANDLED_ERROR;
}
-
+
if (n == 0) {
/* read finished */
-
+
con->file_finished = 1;
-
+
/* send final chunk */
http_chunk_append_mem(srv, con, NULL, 0);
joblist_append(srv, con);
-
+
return FDEVENT_HANDLED_FINISHED;
}
-
+
hctx->response->ptr[n] = '\0';
hctx->response->used = n+1;
-
+
/* split header from body */
-
+
if (con->file_started == 0) {
- int is_header = 0;
- int is_header_end = 0;
- size_t last_eol = 0;
- size_t i;
-
+ char *c;
+ int in_header = 0;
+ int header_end = 0;
+ int cp, eol = EOL_UNSET;
+ size_t used = 0;
+
buffer_append_string_buffer(hctx->response_header, hctx->response);
-
- /**
- * we have to handle a few cases:
- *
- * nph:
- *
- * HTTP/1.0 200 Ok\n
- * Header: Value\n
- * \n
- *
- * CGI:
- * Header: Value\n
- * Status: 200\n
- * \n
- *
- * and different mixes of \n and \r\n combinations
- *
- * Some users also forget about CGI and just send a response and hope
- * we handle it. No headers, no header-content seperator
- *
- */
/* nph (non-parsed headers) */
- if (0 == strncmp(hctx->response_header->ptr, "HTTP/1.", 7)) is_header = 1;
-
- for (i = 0; !is_header_end && i < hctx->response_header->used - 1; i++) {
- char c = hctx->response_header->ptr[i];
-
- switch (c) {
- case ':':
- /* we found a colon
- *
- * looks like we have a normal header
- */
- is_header = 1;
- break;
- case '\n':
- /* EOL */
- if (is_header == 0) {
- /* we got a EOL but we don't seem to got a HTTP header */
-
- is_header_end = 1;
-
+ if (0 == strncmp(hctx->response_header->ptr, "HTTP/1.", 7)) in_header = 1;
+
+ /* search for the \r\n\r\n or \n\n in the string */
+ for (c = hctx->response_header->ptr, cp = 0, used = hctx->response_header->used - 1; used; c++, cp++, used--) {
+ if (*c == ':') in_header = 1;
+ else if (*c == '\n') {
+ if (in_header == 0) {
+ /* got a response without a response header */
+
+ c = NULL;
+ header_end = 1;
break;
}
-
- /**
- * check if we saw a \n(\r)?\n sequence
- */
- if (last_eol > 0 &&
- ((i - last_eol == 1) ||
- (i - last_eol == 2 && hctx->response_header->ptr[i - 1] == '\r'))) {
- is_header_end = 1;
+
+ if (eol == EOL_UNSET) eol = EOL_N;
+
+ if (*(c+1) == '\n') {
+ header_end = 1;
break;
}
-
- last_eol = i;
-
- break;
+
+ } else if (used > 1 && *c == '\r' && *(c+1) == '\n') {
+ if (in_header == 0) {
+ /* got a response without a response header */
+
+ c = NULL;
+ header_end = 1;
+ break;
+ }
+
+ if (eol == EOL_UNSET) eol = EOL_RN;
+
+ if (used > 3 &&
+ *(c+2) == '\r' &&
+ *(c+3) == '\n') {
+ header_end = 1;
+ break;
+ }
+
+ /* skip the \n */
+ c++;
+ cp++;
+ used--;
}
}
-
- if (is_header_end) {
- if (!is_header) {
+
+ if (header_end) {
+ if (c == NULL) {
/* no header, but a body */
-
+
if (con->request.http_version == HTTP_VERSION_1_1) {
con->response.transfer_encoding = HTTP_TRANSFER_ENCODING_CHUNKED;
}
-
+
http_chunk_append_mem(srv, con, hctx->response_header->ptr, hctx->response_header->used);
joblist_append(srv, con);
} else {
- const char *bstart;
- size_t blen;
-
- /**
- * i still points to the char after the terminating EOL EOL
- *
- * put it on the last \n again
- */
- i--;
-
- /* the body starts after the EOL */
- bstart = hctx->response_header->ptr + (i + 1);
- blen = (hctx->response_header->used - 1) - (i + 1);
-
- /* string the last \r?\n */
- if (i > 0 && (hctx->response_header->ptr[i - 1] == '\r')) {
- i--;
- }
-
- hctx->response_header->ptr[i] = '\0';
- hctx->response_header->used = i + 1; /* the string + \0 */
-
+ size_t hlen = c - hctx->response_header->ptr + (eol == EOL_RN ? 4 : 2);
+ size_t blen = hctx->response_header->used - hlen - 1;
+
+ /* a small hack: terminate after at the second \r */
+ hctx->response_header->used = hlen + 1 - (eol == EOL_RN ? 2 : 1);
+ hctx->response_header->ptr[hlen - (eol == EOL_RN ? 2 : 1)] = '\0';
+
/* parse the response header */
- cgi_response_parse(srv, con, p, hctx->response_header);
-
+ cgi_response_parse(srv, con, p, hctx->response_header, eol);
+
/* enable chunked-transfer-encoding */
if (con->request.http_version == HTTP_VERSION_1_1 &&
!(con->parsed_response & HTTP_CONTENT_LENGTH)) {
con->response.transfer_encoding = HTTP_TRANSFER_ENCODING_CHUNKED;
}
-
- if (blen > 0) {
- http_chunk_append_mem(srv, con, bstart, blen + 1);
+
+ if ((hctx->response->used != hlen) && blen > 0) {
+ http_chunk_append_mem(srv, con, c + (eol == EOL_RN ? 4: 2), blen + 1);
joblist_append(srv, con);
}
}
-
+
con->file_started = 1;
}
} else {
http_chunk_append_mem(srv, con, hctx->response->ptr, hctx->response->used);
joblist_append(srv, con);
}
-
-#if 0
+
+#if 0
log_error_write(srv, __FILE__, __LINE__, "ddss", con->fd, hctx->fd, connection_get_state(con->state), b->ptr);
#endif
}
-
+
return FDEVENT_HANDLED_NOT_FINISHED;
}
@@ -518,42 +470,42 @@ static handler_t cgi_connection_close(server *srv, handler_ctx *hctx) {
pid_t pid;
plugin_data *p;
connection *con;
-
+
if (NULL == hctx) return HANDLER_GO_ON;
-
+
p = hctx->plugin_data;
con = hctx->remote_conn;
-
+
if (con->mode != p->id) return HANDLER_GO_ON;
#ifndef __WIN32
-
+
/* the connection to the browser went away, but we still have a connection
- * to the CGI script
+ * to the CGI script
*
* close cgi-connection
*/
-
+
if (hctx->fd != -1) {
/* close connection to the cgi-script */
fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
fdevent_unregister(srv->ev, hctx->fd);
-
+
if (close(hctx->fd)) {
log_error_write(srv, __FILE__, __LINE__, "sds", "cgi close failed ", hctx->fd, strerror(errno));
}
-
+
hctx->fd = -1;
hctx->fde_ndx = -1;
}
-
+
pid = hctx->pid;
-
+
con->plugin_ctx[p->id] = NULL;
-
+
/* is this a good idea ? */
cgi_handler_ctx_free(hctx);
-
+
/* if waitpid hasn't been called by response.c yet, do it here */
if (pid) {
/* check if the CGI-script is already gone */
@@ -567,19 +519,19 @@ static handler_t cgi_connection_close(server *srv, handler_ctx *hctx) {
case -1:
/* */
if (errno == EINTR) break;
-
- /*
- * errno == ECHILD happens if _subrequest catches the process-status before
+
+ /*
+ * errno == ECHILD happens if _subrequest catches the process-status before
* we have read the response of the cgi process
- *
+ *
* -> catch status
* -> WAIT_FOR_EVENT
* -> read response
* -> we get here with waitpid == ECHILD
- *
+ *
*/
- if (errno == ECHILD) return HANDLER_GO_ON;
-
+ if (errno == ECHILD) return HANDLER_FINISHED;
+
log_error_write(srv, __FILE__, __LINE__, "ss", "waitpid failed: ", strerror(errno));
return HANDLER_ERROR;
default:
@@ -588,83 +540,80 @@ static handler_t cgi_connection_close(server *srv, handler_ctx *hctx) {
connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
con->http_status = 500;
con->mode = DIRECT;
- } else {
- con->file_finished = 1;
}
-
+
if (WIFEXITED(status)) {
#if 0
log_error_write(srv, __FILE__, __LINE__, "sd", "(debug) cgi exited fine, pid:", pid);
#endif
- return HANDLER_GO_ON;
+ pid = 0;
+
+ return HANDLER_FINISHED;
} else {
log_error_write(srv, __FILE__, __LINE__, "sd", "cgi died, pid:", pid);
- return HANDLER_GO_ON;
+ pid = 0;
+ return HANDLER_FINISHED;
}
}
-
-
+
+
kill(pid, SIGTERM);
-
+
/* cgi-script is still alive, queue the PID for removal */
cgi_pid_add(srv, p, pid);
}
-#endif
- return HANDLER_GO_ON;
+#endif
+ return HANDLER_FINISHED;
}
static handler_t cgi_connection_close_callback(server *srv, connection *con, void *p_d) {
plugin_data *p = p_d;
-
+
return cgi_connection_close(srv, con->plugin_ctx[p->id]);
}
-static handler_t cgi_handle_fdevent(server *srv, void *ctx, int revents) {
+static handler_t cgi_handle_fdevent(void *s, void *ctx, int revents) {
+ server *srv = (server *)s;
handler_ctx *hctx = ctx;
connection *con = hctx->remote_conn;
-
+
joblist_append(srv, con);
-
+
if (hctx->fd == -1) {
log_error_write(srv, __FILE__, __LINE__, "ddss", con->fd, hctx->fd, connection_get_state(con->state), "invalid cgi-fd");
-
+
return HANDLER_ERROR;
}
-
+
if (revents & FDEVENT_IN) {
switch (cgi_demux_response(srv, hctx)) {
case FDEVENT_HANDLED_NOT_FINISHED:
break;
case FDEVENT_HANDLED_FINISHED:
/* we are done */
-
+
#if 0
log_error_write(srv, __FILE__, __LINE__, "ddss", con->fd, hctx->fd, connection_get_state(con->state), "finished");
#endif
cgi_connection_close(srv, hctx);
-
- /* if we get a IN|HUP and have read everything don't exec the close twice */
+
+ /* if we get a IN|HUP and have read everything don't exec the close twice */
return HANDLER_FINISHED;
case FDEVENT_HANDLED_ERROR:
- /* Send an error if we haven't sent any data yet */
- if (0 == con->file_started) {
- connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
- con->http_status = 500;
- con->mode = DIRECT;
- } else {
- con->file_finished = 1;
- }
-
+ connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
+ con->http_status = 500;
+ con->mode = DIRECT;
+
log_error_write(srv, __FILE__, __LINE__, "s", "demuxer failed: ");
break;
}
}
-
+
if (revents & FDEVENT_OUT) {
/* nothing to do */
}
-
+
/* perhaps this issue is already handled */
if (revents & FDEVENT_HUP) {
/* check if we still have a unfinished header package which is a body in reality */
@@ -674,54 +623,57 @@ static handler_t cgi_handle_fdevent(server *srv, void *ctx, int revents) {
http_chunk_append_mem(srv, con, hctx->response_header->ptr, hctx->response_header->used);
joblist_append(srv, con);
}
-
+
if (con->file_finished == 0) {
http_chunk_append_mem(srv, con, NULL, 0);
joblist_append(srv, con);
}
-
+
con->file_finished = 1;
-
+
if (chunkqueue_is_empty(con->write_queue)) {
/* there is nothing left to write */
connection_set_state(srv, con, CON_STATE_RESPONSE_END);
} else {
/* used the write-handler to finish the request on demand */
-
+
}
-
+
# if 0
log_error_write(srv, __FILE__, __LINE__, "sddd", "got HUP from cgi", con->fd, hctx->fd, revents);
# endif
-
+
/* rtsigs didn't liked the close */
cgi_connection_close(srv, hctx);
} else if (revents & FDEVENT_ERR) {
con->file_finished = 1;
-
+
/* kill all connections to the cgi process */
cgi_connection_close(srv, hctx);
#if 1
log_error_write(srv, __FILE__, __LINE__, "s", "cgi-FDEVENT_ERR");
-#endif
+#endif
return HANDLER_ERROR;
}
-
+
return HANDLER_FINISHED;
}
-static int cgi_env_add(char_array *env, const char *key, size_t key_len, const char *val, size_t val_len) {
+static int cgi_env_add(char_array *env, const char *key, size_t key_len, const char *val) {
+ int val_len;
char *dst;
-
+
if (!key || !val) return -1;
-
- dst = malloc(key_len + val_len + 2);
+
+ val_len = strlen(val);
+
+ dst = malloc(key_len + val_len + 3);
memcpy(dst, key, key_len);
dst[key_len] = '=';
- memcpy(dst + key_len + 1, val, val_len);
- dst[key_len + 1 + val_len] = '\0';
-
+ /* add the \0 from the value */
+ memcpy(dst + key_len + 1, val, val_len + 1);
+
if (env->size == 0) {
env->size = 16;
env->ptr = malloc(env->size * sizeof(*env->ptr));
@@ -729,47 +681,45 @@ static int cgi_env_add(char_array *env, const char *key, size_t key_len, const c
env->size += 16;
env->ptr = realloc(env->ptr, env->size * sizeof(*env->ptr));
}
-
+
env->ptr[env->used++] = dst;
-
+
return 0;
}
static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *cgi_handler) {
pid_t pid;
-
+
#ifdef HAVE_IPV6
char b2[INET6_ADDRSTRLEN + 1];
#endif
-
+
int to_cgi_fds[2];
int from_cgi_fds[2];
struct stat st;
-
-#ifndef __WIN32
-
+
+#ifndef __WIN32
+
if (cgi_handler->used > 1) {
/* stat the exec file */
if (-1 == (stat(cgi_handler->ptr, &st))) {
- log_error_write(srv, __FILE__, __LINE__, "sbss",
+ log_error_write(srv, __FILE__, __LINE__, "sbss",
"stat for cgi-handler", cgi_handler,
"failed:", strerror(errno));
return -1;
}
}
-
+
if (pipe(to_cgi_fds)) {
log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed:", strerror(errno));
return -1;
}
-
+
if (pipe(from_cgi_fds)) {
- close(to_cgi_fds[0]);
- close(to_cgi_fds[1]);
log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed:", strerror(errno));
return -1;
}
-
+
/* fork, execve */
switch (pid = fork()) {
case 0: {
@@ -781,193 +731,142 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
size_t n;
char_array env;
char *c;
- const char *s;
server_socket *srv_sock = con->srv_socket;
-
+
/* move stdout to from_cgi_fd[1] */
close(STDOUT_FILENO);
dup2(from_cgi_fds[1], STDOUT_FILENO);
close(from_cgi_fds[1]);
/* not needed */
close(from_cgi_fds[0]);
-
+
/* move the stdin to to_cgi_fd[0] */
close(STDIN_FILENO);
dup2(to_cgi_fds[0], STDIN_FILENO);
close(to_cgi_fds[0]);
/* not needed */
close(to_cgi_fds[1]);
-
+
+ /* HACK:
+ * this is not nice, but it works
+ *
+ * we feed the stderr of the CGI to our errorlog, if possible
+ */
+ if (srv->errorlog_mode == ERRORLOG_FILE) {
+ close(STDERR_FILENO);
+ dup2(srv->errorlog_fd, STDERR_FILENO);
+ }
+
/* create environment */
env.ptr = NULL;
env.size = 0;
env.used = 0;
-
- if (buffer_is_empty(con->conf.server_tag)) {
- cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC));
- } else {
- cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag));
- }
-
- if (!buffer_is_empty(con->server_name)) {
- size_t len = con->server_name->used - 1;
-
- if (con->server_name->ptr[0] == '[') {
- const char *colon = strstr(con->server_name->ptr, "]:");
- if (colon) len = (colon + 1) - con->server_name->ptr;
- } else {
- const char *colon = strchr(con->server_name->ptr, ':');
- if (colon) len = colon - con->server_name->ptr;
- }
-
- cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
- } else {
+
+ cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), PACKAGE_NAME"/"PACKAGE_VERSION);
+ cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"),
+ con->server_name->used ?
+ con->server_name->ptr :
#ifdef HAVE_IPV6
- s = inet_ntop(srv_sock->addr.plain.sa_family,
- srv_sock->addr.plain.sa_family == AF_INET6 ?
+ inet_ntop(srv_sock->addr.plain.sa_family,
+ srv_sock->addr.plain.sa_family == AF_INET6 ?
(const void *) &(srv_sock->addr.ipv6.sin6_addr) :
(const void *) &(srv_sock->addr.ipv4.sin_addr),
- b2, sizeof(b2)-1);
+ b2, sizeof(b2)-1)
#else
- s = inet_ntoa(srv_sock->addr.ipv4.sin_addr);
+ inet_ntoa(srv_sock->addr.ipv4.sin_addr)
#endif
- cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), s, strlen(s));
- }
- cgi_env_add(&env, CONST_STR_LEN("GATEWAY_INTERFACE"), CONST_STR_LEN("CGI/1.1"));
-
- s = get_http_version_name(con->request.http_version);
-
- cgi_env_add(&env, CONST_STR_LEN("SERVER_PROTOCOL"), s, strlen(s));
-
- LI_ltostr(buf,
+ );
+ cgi_env_add(&env, CONST_STR_LEN("GATEWAY_INTERFACE"), "CGI/1.1");
+
+ cgi_env_add(&env, CONST_STR_LEN("SERVER_PROTOCOL"), get_http_version_name(con->request.http_version));
+
+ ltostr(buf,
#ifdef HAVE_IPV6
ntohs(srv_sock->addr.plain.sa_family == AF_INET6 ? srv_sock->addr.ipv6.sin6_port : srv_sock->addr.ipv4.sin_port)
#else
ntohs(srv_sock->addr.ipv4.sin_port)
#endif
);
- cgi_env_add(&env, CONST_STR_LEN("SERVER_PORT"), buf, strlen(buf));
-
- switch (srv_sock->addr.plain.sa_family) {
+ cgi_env_add(&env, CONST_STR_LEN("SERVER_PORT"), buf);
+
+ cgi_env_add(&env, CONST_STR_LEN("SERVER_ADDR"),
#ifdef HAVE_IPV6
- case AF_INET6:
- s = inet_ntop(srv_sock->addr.plain.sa_family,
- (const void *) &(srv_sock->addr.ipv6.sin6_addr),
- b2, sizeof(b2)-1);
- break;
- case AF_INET:
- s = inet_ntop(srv_sock->addr.plain.sa_family,
- (const void *) &(srv_sock->addr.ipv4.sin_addr),
- b2, sizeof(b2)-1);
- break;
+ inet_ntop(srv_sock->addr.plain.sa_family,
+ srv_sock->addr.plain.sa_family == AF_INET6 ?
+ (const void *) &(srv_sock->addr.ipv6.sin6_addr) :
+ (const void *) &(srv_sock->addr.ipv4.sin_addr),
+ b2, sizeof(b2)-1)
#else
- case AF_INET:
- s = inet_ntoa(srv_sock->addr.ipv4.sin_addr);
- break;
+ inet_ntoa(srv_sock->addr.ipv4.sin_addr)
#endif
- default:
- s = "";
- break;
+ );
+
+ cgi_env_add(&env, CONST_STR_LEN("REQUEST_METHOD"), get_http_method_name(con->request.http_method));
+ if (con->request.pathinfo->used) {
+ cgi_env_add(&env, CONST_STR_LEN("PATH_INFO"), con->request.pathinfo->ptr);
}
- cgi_env_add(&env, CONST_STR_LEN("SERVER_ADDR"), s, strlen(s));
-
- s = get_http_method_name(con->request.http_method);
- cgi_env_add(&env, CONST_STR_LEN("REQUEST_METHOD"), s, strlen(s));
-
- if (!buffer_is_empty(con->request.pathinfo)) {
- cgi_env_add(&env, CONST_STR_LEN("PATH_INFO"), CONST_BUF_LEN(con->request.pathinfo));
- }
- cgi_env_add(&env, CONST_STR_LEN("REDIRECT_STATUS"), CONST_STR_LEN("200"));
- if (!buffer_is_empty(con->uri.query)) {
- cgi_env_add(&env, CONST_STR_LEN("QUERY_STRING"), CONST_BUF_LEN(con->uri.query));
- }
- if (!buffer_is_empty(con->request.orig_uri)) {
- cgi_env_add(&env, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri));
- }
-
-
- switch (con->dst_addr.plain.sa_family) {
+ cgi_env_add(&env, CONST_STR_LEN("REDIRECT_STATUS"), "200");
+ cgi_env_add(&env, CONST_STR_LEN("QUERY_STRING"), con->uri.query->used ? con->uri.query->ptr : "");
+ cgi_env_add(&env, CONST_STR_LEN("REQUEST_URI"), con->request.orig_uri->used ? con->request.orig_uri->ptr : "");
+
+
+ cgi_env_add(&env, CONST_STR_LEN("REMOTE_ADDR"),
#ifdef HAVE_IPV6
- case AF_INET6:
- s = inet_ntop(con->dst_addr.plain.sa_family,
- (const void *) &(con->dst_addr.ipv6.sin6_addr),
- b2, sizeof(b2)-1);
- break;
- case AF_INET:
- s = inet_ntop(con->dst_addr.plain.sa_family,
- (const void *) &(con->dst_addr.ipv4.sin_addr),
- b2, sizeof(b2)-1);
- break;
+ inet_ntop(con->dst_addr.plain.sa_family,
+ con->dst_addr.plain.sa_family == AF_INET6 ?
+ (const void *) &(con->dst_addr.ipv6.sin6_addr) :
+ (const void *) &(con->dst_addr.ipv4.sin_addr),
+ b2, sizeof(b2)-1)
#else
- case AF_INET:
- s = inet_ntoa(con->dst_addr.ipv4.sin_addr);
- break;
+ inet_ntoa(con->dst_addr.ipv4.sin_addr)
#endif
- default:
- s = "";
- break;
- }
- cgi_env_add(&env, CONST_STR_LEN("REMOTE_ADDR"), s, strlen(s));
+ );
- LI_ltostr(buf,
+ ltostr(buf,
#ifdef HAVE_IPV6
ntohs(con->dst_addr.plain.sa_family == AF_INET6 ? con->dst_addr.ipv6.sin6_port : con->dst_addr.ipv4.sin_port)
#else
ntohs(con->dst_addr.ipv4.sin_port)
#endif
);
- cgi_env_add(&env, CONST_STR_LEN("REMOTE_PORT"), buf, strlen(buf));
-
- if (!buffer_is_empty(con->authed_user)) {
+ cgi_env_add(&env, CONST_STR_LEN("REMOTE_PORT"), buf);
+
+ if (con->authed_user->used) {
cgi_env_add(&env, CONST_STR_LEN("REMOTE_USER"),
- CONST_BUF_LEN(con->authed_user));
+ con->authed_user->ptr);
}
-
-#ifdef USE_OPENSSL
- if (srv_sock->is_ssl) {
- cgi_env_add(&env, CONST_STR_LEN("HTTPS"), CONST_STR_LEN("on"));
- }
-#endif
-
+
/* request.content_length < SSIZE_MAX, see request.c */
- LI_ltostr(buf, con->request.content_length);
- cgi_env_add(&env, CONST_STR_LEN("CONTENT_LENGTH"), buf, strlen(buf));
- cgi_env_add(&env, CONST_STR_LEN("SCRIPT_FILENAME"), CONST_BUF_LEN(con->physical.path));
- cgi_env_add(&env, CONST_STR_LEN("SCRIPT_NAME"), CONST_BUF_LEN(con->uri.path));
- cgi_env_add(&env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.basedir));
-
+ ltostr(buf, con->request.content_length);
+ cgi_env_add(&env, CONST_STR_LEN("CONTENT_LENGTH"), buf);
+ cgi_env_add(&env, CONST_STR_LEN("SCRIPT_FILENAME"), con->physical.path->ptr);
+ cgi_env_add(&env, CONST_STR_LEN("SCRIPT_NAME"), con->uri.path->ptr);
+
/* for valgrind */
- if (NULL != (s = getenv("LD_PRELOAD"))) {
- cgi_env_add(&env, CONST_STR_LEN("LD_PRELOAD"), s, strlen(s));
- }
-
- if (NULL != (s = getenv("LD_LIBRARY_PATH"))) {
- cgi_env_add(&env, CONST_STR_LEN("LD_LIBRARY_PATH"), s, strlen(s));
- }
+ cgi_env_add(&env, CONST_STR_LEN("LD_PRELOAD"), getenv("LD_PRELOAD"));
+ cgi_env_add(&env, CONST_STR_LEN("LD_LIBRARY_PATH"), getenv("LD_LIBRARY_PATH"));
#ifdef __CYGWIN__
/* CYGWIN needs SYSTEMROOT */
- if (NULL != (s = getenv("SYSTEMROOT"))) {
- cgi_env_add(&env, CONST_STR_LEN("SYSTEMROOT"), s, strlen(s));
- }
+ cgi_env_add(&env, CONST_STR_LEN("SYSTEMROOT"), getenv("SYSTEMROOT"));
#endif
-
+
for (n = 0; n < con->request.headers->used; n++) {
data_string *ds;
-
+
ds = (data_string *)con->request.headers->data[n];
-
+
if (ds->value->used && ds->key->used) {
size_t j;
-
+
buffer_reset(p->tmp_buf);
-
+
if (0 != strcasecmp(ds->key->ptr, "CONTENT-TYPE")) {
- buffer_copy_string_len(p->tmp_buf, CONST_STR_LEN("HTTP_"));
+ buffer_copy_string(p->tmp_buf, "HTTP_");
p->tmp_buf->used--; /* strip \0 after HTTP_ */
}
-
+
buffer_prepare_append(p->tmp_buf, ds->key->used + 2);
-
+
for (j = 0; j < ds->key->used - 1; j++) {
char cr = '_';
if (light_isalpha(ds->key->ptr[j])) {
@@ -980,62 +879,56 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
p->tmp_buf->ptr[p->tmp_buf->used++] = cr;
}
p->tmp_buf->ptr[p->tmp_buf->used++] = '\0';
-
- cgi_env_add(&env, CONST_BUF_LEN(p->tmp_buf), CONST_BUF_LEN(ds->value));
+
+ cgi_env_add(&env, CONST_BUF_LEN(p->tmp_buf), ds->value->ptr);
}
}
-
+
for (n = 0; n < con->environment->used; n++) {
data_string *ds;
-
+
ds = (data_string *)con->environment->data[n];
-
+
if (ds->value->used && ds->key->used) {
size_t j;
-
+
buffer_reset(p->tmp_buf);
-
+
buffer_prepare_append(p->tmp_buf, ds->key->used + 2);
-
+
for (j = 0; j < ds->key->used - 1; j++) {
- char cr = '_';
- if (light_isalpha(ds->key->ptr[j])) {
- /* upper-case */
- cr = ds->key->ptr[j] & ~32;
- } else if (light_isdigit(ds->key->ptr[j])) {
- /* copy */
- cr = ds->key->ptr[j];
- }
- p->tmp_buf->ptr[p->tmp_buf->used++] = cr;
+ p->tmp_buf->ptr[p->tmp_buf->used++] =
+ isalpha((unsigned char)ds->key->ptr[j]) ?
+ toupper((unsigned char)ds->key->ptr[j]) : '_';
}
p->tmp_buf->ptr[p->tmp_buf->used++] = '\0';
-
- cgi_env_add(&env, CONST_BUF_LEN(p->tmp_buf), CONST_BUF_LEN(ds->value));
+
+ cgi_env_add(&env, CONST_BUF_LEN(p->tmp_buf), ds->value->ptr);
}
}
-
+
if (env.size == env.used) {
env.size += 16;
env.ptr = realloc(env.ptr, env.size * sizeof(*env.ptr));
}
-
+
env.ptr[env.used] = NULL;
-
+
/* set up args */
argc = 3;
args = malloc(sizeof(*args) * argc);
i = 0;
-
+
if (cgi_handler->used > 1) {
args[i++] = cgi_handler->ptr;
}
args[i++] = con->physical.path->ptr;
- args[i ] = NULL;
+ args[i++] = NULL;
/* search for the last / */
if (NULL != (c = strrchr(con->physical.path->ptr, '/'))) {
*c = '\0';
-
+
/* change to the physical directory */
if (-1 == chdir(con->physical.path->ptr)) {
log_error_write(srv, __FILE__, __LINE__, "ssb", "chdir failed:", strerror(errno), con->physical.path);
@@ -1047,12 +940,12 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
for (i = 3; i < 256; i++) {
if (i != srv->errorlog_fd) close(i);
}
-
+
/* exec the cgi */
execve(args[0], args, env.ptr);
-
- /* log_error_write(srv, __FILE__, __LINE__, "sss", "CGI failed:", strerror(errno), args[0]); */
-
+
+ log_error_write(srv, __FILE__, __LINE__, "sss", "CGI failed:", strerror(errno), args[0]);
+
/* */
SEGFAULT();
break;
@@ -1060,23 +953,15 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
case -1:
/* error */
log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed:", strerror(errno));
- close(from_cgi_fds[0]);
- close(from_cgi_fds[1]);
- close(to_cgi_fds[0]);
- close(to_cgi_fds[1]);
- return -1;
break;
default: {
handler_ctx *hctx;
/* father */
-
- close(from_cgi_fds[1]);
- close(to_cgi_fds[0]);
-
+
if (con->request.content_length) {
chunkqueue *cq = con->request_content_queue;
chunk *c;
-
+
assert(chunkqueue_length(cq) == (off_t)con->request.content_length);
/* there is content to send */
@@ -1091,26 +976,22 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
if (-1 == c->file.fd && /* open the file if not already open */
-1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno));
-
- close(from_cgi_fds[0]);
- close(to_cgi_fds[1]);
+
return -1;
}
c->file.mmap.length = c->file.length;
-
+
if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.mmap.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
- log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
+ log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
strerror(errno), c->file.name, c->file.fd);
- close(from_cgi_fds[0]);
- close(to_cgi_fds[1]);
return -1;
}
close(c->file.fd);
c->file.fd = -1;
-
+
/* chunk_reset() or chunk_free() will cleanup for us */
}
@@ -1118,9 +999,8 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
switch(errno) {
case ENOSPC:
con->http_status = 507;
+
break;
- case EINTR:
- continue;
default:
con->http_status = 403;
break;
@@ -1132,9 +1012,8 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
switch(errno) {
case ENOSPC:
con->http_status = 507;
+
break;
- case EINTR:
- continue;
default:
con->http_status = 403;
break;
@@ -1149,54 +1028,55 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
c->offset += r;
cq->bytes_out += r;
} else {
- log_error_write(srv, __FILE__, __LINE__, "ss", "write() failed due to: ", strerror(errno));
- con->http_status = 500;
break;
}
chunkqueue_remove_finished_chunks(cq);
}
}
-
+
+ close(from_cgi_fds[1]);
+
+ close(to_cgi_fds[0]);
close(to_cgi_fds[1]);
-
+
/* register PID and wait for them asyncronously */
con->mode = p->id;
buffer_reset(con->physical.path);
-
+
hctx = cgi_handler_ctx_init();
-
+
hctx->remote_conn = con;
hctx->plugin_data = p;
hctx->pid = pid;
hctx->fd = from_cgi_fds[0];
hctx->fde_ndx = -1;
-
+
con->plugin_ctx[p->id] = hctx;
-
+
fdevent_register(srv->ev, hctx->fd, cgi_handle_fdevent, hctx);
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
-
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+
if (-1 == fdevent_fcntl_set(srv->ev, hctx->fd)) {
log_error_write(srv, __FILE__, __LINE__, "ss", "fcntl failed: ", strerror(errno));
-
+
fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
fdevent_unregister(srv->ev, hctx->fd);
-
+
log_error_write(srv, __FILE__, __LINE__, "sd", "cgi close:", hctx->fd);
-
+
close(hctx->fd);
-
+
cgi_handler_ctx_free(hctx);
-
+
con->plugin_ctx[p->id] = NULL;
-
+
return -1;
}
-
+
break;
}
}
-
+
return 0;
#else
return -1;
@@ -1208,30 +1088,27 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
static int mod_cgi_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(cgi);
- PATCH(execute_x_only);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.assign"))) {
PATCH(cgi);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.execute-x-only"))) {
- PATCH(execute_x_only);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -1240,32 +1117,24 @@ URIHANDLER_FUNC(cgi_is_handled) {
size_t k, s_len;
plugin_data *p = p_d;
buffer *fn = con->physical.path;
- stat_cache_entry *sce = NULL;
-
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
- if (fn->used == 0) return HANDLER_GO_ON;
-
+
+ if (fn->used == 0) return HANDLER_ERROR;
+
mod_cgi_patch_connection(srv, con, p);
-
- if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) return HANDLER_GO_ON;
- if (!S_ISREG(sce->st.st_mode)) return HANDLER_GO_ON;
- if (p->conf.execute_x_only == 1 && (sce->st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0) return HANDLER_GO_ON;
-
+
s_len = fn->used - 1;
-
+
for (k = 0; k < p->conf.cgi->used; k++) {
data_string *ds = (data_string *)p->conf.cgi->data[k];
size_t ct_len = ds->key->used - 1;
-
+
if (ds->key->used == 0) continue;
if (s_len < ct_len) continue;
-
+
if (0 == strncmp(fn->ptr + s_len - ct_len, ds->key->ptr, ct_len)) {
if (cgi_create_env(srv, con, p, ds->value)) {
- con->mode = DIRECT;
con->http_status = 500;
-
+
buffer_reset(con->physical.path);
return HANDLER_FINISHED;
}
@@ -1273,7 +1142,7 @@ URIHANDLER_FUNC(cgi_is_handled) {
break;
}
}
-
+
return HANDLER_GO_ON;
}
@@ -1285,7 +1154,7 @@ TRIGGER_FUNC(cgi_trigger) {
for (ndx = 0; ndx < p->cgi_pid.used; ndx++) {
int status;
-
+
switch(waitpid(p->cgi_pid.ptr[ndx], &status, WNOHANG)) {
case 0:
/* not finished yet */
@@ -1294,17 +1163,8 @@ TRIGGER_FUNC(cgi_trigger) {
#endif
break;
case -1:
- if (errno == ECHILD) {
- /* someone else called waitpid... remove the pid to stop looping the error each time */
- log_error_write(srv, __FILE__, __LINE__, "s", "cgi child vanished, probably someone else called waitpid");
-
- cgi_pid_del(srv, p, p->cgi_pid.ptr[ndx]);
- ndx--;
- continue;
- }
-
log_error_write(srv, __FILE__, __LINE__, "ss", "waitpid failed: ", strerror(errno));
-
+
return HANDLER_ERROR;
default:
@@ -1312,52 +1172,35 @@ TRIGGER_FUNC(cgi_trigger) {
#if 0
log_error_write(srv, __FILE__, __LINE__, "sd", "(debug) cgi exited fine, pid:", p->cgi_pid.ptr[ndx]);
#endif
- } else if (WIFSIGNALED(status)) {
- /* FIXME: what if we killed the CGI script with a kill(..., SIGTERM) ?
- */
- if (WTERMSIG(status) != SIGTERM) {
- log_error_write(srv, __FILE__, __LINE__, "sd", "cleaning up CGI: process died with signal", WTERMSIG(status));
- }
} else {
- log_error_write(srv, __FILE__, __LINE__, "s", "cleaning up CGI: ended unexpectedly");
+ log_error_write(srv, __FILE__, __LINE__, "s", "cgi died ?");
}
-
+
cgi_pid_del(srv, p, p->cgi_pid.ptr[ndx]);
- /* del modified the buffer structure
+ /* del modified the buffer structure
* and copies the last entry to the current one
* -> recheck the current index
*/
ndx--;
}
}
-#endif
+#endif
return HANDLER_GO_ON;
}
-/*
- * - HANDLER_GO_ON : not our job
- * - HANDLER_FINISHED: got response header
- * - HANDLER_WAIT_FOR_EVENT: waiting for response header
- */
SUBREQUEST_FUNC(mod_cgi_handle_subrequest) {
int status;
plugin_data *p = p_d;
handler_ctx *hctx = con->plugin_ctx[p->id];
-
+
if (con->mode != p->id) return HANDLER_GO_ON;
if (NULL == hctx) return HANDLER_GO_ON;
-
+
#if 0
log_error_write(srv, __FILE__, __LINE__, "sdd", "subrequest, pid =", hctx, hctx->pid);
-#endif
-
- if (hctx->pid == 0) {
- /* cgi already dead */
- if (!con->file_started) return HANDLER_WAIT_FOR_EVENT;
- return HANDLER_FINISHED;
- }
-
-#ifndef __WIN32
+#endif
+ if (hctx->pid == 0) return HANDLER_FINISHED;
+#ifndef __WIN32
switch(waitpid(hctx->pid, &status, WNOHANG)) {
case 0:
/* we only have for events here if we don't have the header yet,
@@ -1367,61 +1210,61 @@ SUBREQUEST_FUNC(mod_cgi_handle_subrequest) {
return HANDLER_WAIT_FOR_EVENT;
case -1:
if (errno == EINTR) return HANDLER_WAIT_FOR_EVENT;
-
+
if (errno == ECHILD && con->file_started == 0) {
/*
- * second round but still not response
+ * second round but still not response
*/
- return HANDLER_WAIT_FOR_EVENT;
+ return HANDLER_WAIT_FOR_EVENT;
}
-
+
log_error_write(srv, __FILE__, __LINE__, "ss", "waitpid failed: ", strerror(errno));
con->mode = DIRECT;
con->http_status = 500;
-
+
hctx->pid = 0;
-
+
fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
fdevent_unregister(srv->ev, hctx->fd);
-
+
if (close(hctx->fd)) {
log_error_write(srv, __FILE__, __LINE__, "sds", "cgi close failed ", hctx->fd, strerror(errno));
}
-
+
cgi_handler_ctx_free(hctx);
-
+
con->plugin_ctx[p->id] = NULL;
-
+
return HANDLER_FINISHED;
default:
- /* cgi process exited
+ /* cgi process exited cleanly
+ *
+ * check if we already got the response
*/
-
- hctx->pid = 0;
-
- /* we already have response headers? just continue */
- if (con->file_started) return HANDLER_FINISHED;
-
+
+ if (!con->file_started) return HANDLER_WAIT_FOR_EVENT;
+
if (WIFEXITED(status)) {
- /* clean exit - just continue */
- return HANDLER_WAIT_FOR_EVENT;
+ /* nothing */
+ } else {
+ log_error_write(srv, __FILE__, __LINE__, "s", "cgi died ?");
+
+ con->mode = DIRECT;
+ con->http_status = 500;
+
}
-
- /* cgi proc died, and we didn't get any data yet - send error message and close cgi con */
- log_error_write(srv, __FILE__, __LINE__, "s", "cgi died ?");
-
- con->http_status = 500;
- con->mode = DIRECT;
-
+
+ hctx->pid = 0;
+
fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
fdevent_unregister(srv->ev, hctx->fd);
-
+
if (close(hctx->fd)) {
log_error_write(srv, __FILE__, __LINE__, "sds", "cgi close failed ", hctx->fd, strerror(errno));
}
-
+
cgi_handler_ctx_free(hctx);
-
+
con->plugin_ctx[p->id] = NULL;
return HANDLER_FINISHED;
}
@@ -1431,12 +1274,11 @@ SUBREQUEST_FUNC(mod_cgi_handle_subrequest) {
}
-int mod_cgi_plugin_init(plugin *p);
int mod_cgi_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("cgi");
- p->connection_reset = cgi_connection_close_callback;
+ p->handle_connection_close = cgi_connection_close_callback;
p->handle_subrequest_start = cgi_is_handled;
p->handle_subrequest = mod_cgi_handle_subrequest;
#if 0
@@ -1446,8 +1288,8 @@ int mod_cgi_plugin_init(plugin *p) {
p->init = mod_cgi_init;
p->cleanup = mod_cgi_free;
p->set_defaults = mod_fastcgi_set_defaults;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_cml.c b/src/mod_cml.c
index f83eb80..def16c7 100644
--- a/src/mod_cml.c
+++ b/src/mod_cml.c
@@ -1,3 +1,12 @@
+#include <sys/stat.h>
+#include <time.h>
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+
#include "buffer.h"
#include "server.h"
#include "log.h"
@@ -8,62 +17,54 @@
#include "mod_cml.h"
-#include <sys/stat.h>
-#include <time.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdio.h>
-
/* init the plugin data */
INIT_FUNC(mod_cml_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->basedir = buffer_init();
p->baseurl = buffer_init();
+ p->session_id = buffer_init();
p->trigger_handler = buffer_init();
-
+
return p;
}
/* detroy the plugin data */
FREE_FUNC(mod_cml_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
buffer_free(s->ext);
-
+
buffer_free(s->mc_namespace);
- buffer_free(s->power_magnet);
array_free(s->mc_hosts);
-
+
#if defined(HAVE_MEMCACHE_H)
if (s->mc) mc_free(s->mc);
#endif
-
+
free(s);
}
free(p->config_storage);
}
-
+
buffer_free(p->trigger_handler);
+ buffer_free(p->session_id);
buffer_free(p->basedir);
buffer_free(p->baseurl);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -72,66 +73,63 @@ FREE_FUNC(mod_cml_free) {
SETDEFAULTS_FUNC(mod_cml_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "cml.extension", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "cml.memcache-hosts", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ "cml.memcache-namespace", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
- { "cml.power-magnet", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = malloc(sizeof(plugin_config));
s->ext = buffer_init();
s->mc_hosts = array_init();
s->mc_namespace = buffer_init();
- s->power_magnet = buffer_init();
#if defined(HAVE_MEMCACHE_H)
s->mc = NULL;
#endif
-
+
cv[0].destination = s->ext;
cv[1].destination = s->mc_hosts;
cv[2].destination = s->mc_namespace;
- cv[3].destination = s->power_magnet;
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
-
+
if (s->mc_hosts->used) {
#if defined(HAVE_MEMCACHE_H)
size_t k;
s->mc = mc_new();
-
+
for (k = 0; k < s->mc_hosts->used; k++) {
data_string *ds = (data_string *)s->mc_hosts->data[k];
-
+
if (0 != mc_server_add4(s->mc, ds->value->ptr)) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "connection to host failed:",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "connection to host failed:",
ds->value);
-
+
return HANDLER_ERROR;
}
}
#else
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"memcache support is not compiled in but cml.memcache-hosts is set, aborting");
return HANDLER_ERROR;
#endif
}
}
-
+
return HANDLER_GO_ON;
}
@@ -140,26 +138,25 @@ SETDEFAULTS_FUNC(mod_cml_set_defaults) {
static int mod_cml_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(ext);
#if defined(HAVE_MEMCACHE_H)
PATCH(mc);
#endif
PATCH(mc_namespace);
- PATCH(power_magnet);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("cml.extension"))) {
PATCH(ext);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cml.memcache-hosts"))) {
@@ -168,117 +165,190 @@ static int mod_cml_patch_connection(server *srv, connection *con, plugin_data *p
#endif
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cml.memcache-namespace"))) {
PATCH(mc_namespace);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cml.power-magnet"))) {
- PATCH(power_magnet);
}
}
}
-
+
return 0;
}
#undef PATCH
-static int cache_call_lua(server *srv, connection *con, plugin_data *p, buffer *cml_file) {
+
+int cache_get_cookie_session_id(server *srv, connection *con, plugin_data *p) {
+ data_unset *d;
+
+ UNUSED(srv);
+
+ if (NULL != (d = array_get_element(con->request.headers, "Cookie"))) {
+ data_string *ds = (data_string *)d;
+ size_t key = 0, value = 0;
+ size_t is_key = 1, is_sid = 0;
+ size_t i;
+
+ /* found COOKIE */
+ if (!DATA_IS_STRING(d)) return -1;
+ if (ds->value->used == 0) return -1;
+
+ if (ds->value->ptr[0] == '\0' ||
+ ds->value->ptr[0] == '=' ||
+ ds->value->ptr[0] == ';') return -1;
+
+ buffer_reset(p->session_id);
+ for (i = 0; i < ds->value->used; i++) {
+ switch(ds->value->ptr[i]) {
+ case '=':
+ if (is_key) {
+ if (0 == strncmp(ds->value->ptr + key, "PHPSESSID", i - key)) {
+ /* found PHP-session-id-key */
+ is_sid = 1;
+ }
+ value = i + 1;
+
+ is_key = 0;
+ }
+
+ break;
+ case ';':
+ if (is_sid) {
+ buffer_copy_string_len(p->session_id, ds->value->ptr + value, i - value);
+ }
+
+ is_sid = 0;
+ key = i + 1;
+ value = 0;
+ is_key = 1;
+ break;
+ case ' ':
+ if (is_key == 1 && key == i) key = i + 1;
+ if (is_key == 0 && value == i) value = i + 1;
+ break;
+ case '\0':
+ if (is_sid) {
+ buffer_copy_string_len(p->session_id, ds->value->ptr + value, i - value);
+ }
+ /* fin */
+ break;
+ }
+ }
+ }
+
+ return !buffer_is_empty(p->session_id);
+}
+
+int cache_get_url_session_id(server *srv, connection *con, plugin_data *p) {
+ size_t key = 0, value = 0;
+ size_t is_key = 1, is_sid = 0;
+ size_t i;
+
+ UNUSED(srv);
+ buffer_reset(p->session_id);
+ for (i = 0; i < con->uri.query->used; i++) {
+ switch(con->uri.query->ptr[i]) {
+ case '=':
+ if (is_key) {
+ if (0 == strncmp(con->uri.query->ptr + key, "PHPSESSID", i - key)) {
+ /* found PHP-session-id-key */
+ is_sid = 1;
+ }
+ value = i + 1;
+
+ is_key = 0;
+ }
+
+ break;
+ case '&':
+ if (is_sid) {
+ buffer_copy_string_len(p->session_id, con->uri.query->ptr + value, i - value);
+ }
+
+ is_sid = 0;
+ key = i + 1;
+ value = 0;
+ is_key = 1;
+ break;
+ case ' ':
+ if (is_key == 1 && key == i) key = i + 1;
+ if (is_key == 0 && value == i) value = i + 1;
+ break;
+ case '\0':
+ if (is_sid) {
+ buffer_copy_string_len(p->session_id, con->uri.query->ptr + value, i - value);
+ }
+ /* fin */
+ break;
+ }
+ }
+
+ return !buffer_is_empty(p->session_id);
+}
+
+int cache_get_session_id(server *srv, connection *con, plugin_data *p) {
+
+ return cache_get_cookie_session_id(srv, con, p) ||
+ cache_get_url_session_id(srv, con, p);
+
+}
+
+
+URIHANDLER_FUNC(mod_cml_is_handled) {
+ int ct_len, s_len;
buffer *b;
char *c;
-
+ buffer *fn = con->physical.path;
+ plugin_data *p = p_d;
+ int ret;
+
+ if (fn->used == 0) return HANDLER_ERROR;
+
+ mod_cml_patch_connection(srv, con, p);
+
+ buffer_reset(p->basedir);
+ buffer_reset(p->baseurl);
+ buffer_reset(p->session_id);
+ buffer_reset(p->trigger_handler);
+
+ if (buffer_is_empty(p->conf.ext)) return HANDLER_GO_ON;
+
+ ct_len = p->conf.ext->used - 1;
+ s_len = fn->used - 1;
+
+ if (s_len < ct_len) return HANDLER_GO_ON;
+
+ if (0 != strncmp(fn->ptr + s_len - ct_len, p->conf.ext->ptr, ct_len)) {
+ /* not my job */
+ return HANDLER_GO_ON;
+ }
+
/* cleanup basedir */
b = p->baseurl;
buffer_copy_string_buffer(b, con->uri.path);
for (c = b->ptr + b->used - 1; c > b->ptr && *c != '/'; c--);
-
+
if (*c == '/') {
b->used = c - b->ptr + 2;
*(c+1) = '\0';
}
-
+
b = p->basedir;
- buffer_copy_string_buffer(b, con->physical.path);
+ buffer_copy_string_buffer(b, fn);
for (c = b->ptr + b->used - 1; c > b->ptr && *c != '/'; c--);
-
+
if (*c == '/') {
b->used = c - b->ptr + 2;
*(c+1) = '\0';
}
-
-
+
/* prepare variables
+ * - session-id
* - cookie-based
* - get-param-based
*/
- return cache_parse_lua(srv, con, p, cml_file);
-}
-
-URIHANDLER_FUNC(mod_cml_power_magnet) {
- plugin_data *p = p_d;
-
- mod_cml_patch_connection(srv, con, p);
-
- buffer_reset(p->basedir);
- buffer_reset(p->baseurl);
- buffer_reset(p->trigger_handler);
-
- if (buffer_is_empty(p->conf.power_magnet)) return HANDLER_GO_ON;
-
- /*
- * power-magnet:
- * cml.power-magnet = server.docroot + "/rewrite.cml"
- *
- * is called on EACH request, take the original REQUEST_URI and modifies the
- * request header as neccesary.
- *
- * First use:
- * if file_exists("/maintainance.html") {
- * output_include = ( "/maintainance.html" )
- * return CACHE_HIT
- * }
- *
- * as we only want to rewrite HTML like requests we should cover it in a conditional
- *
- * */
-
- switch(cache_call_lua(srv, con, p, p->conf.power_magnet)) {
- case -1:
- /* error */
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s", "cache-error");
- }
- con->http_status = 500;
- return HANDLER_COMEBACK;
- case 0:
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s", "cache-hit");
- }
- /* cache-hit */
- buffer_reset(con->physical.path);
- return HANDLER_FINISHED;
- case 1:
- /* cache miss */
- return HANDLER_GO_ON;
- default:
- con->http_status = 500;
- return HANDLER_COMEBACK;
- }
-}
-
-URIHANDLER_FUNC(mod_cml_is_handled) {
- plugin_data *p = p_d;
-
- if (buffer_is_empty(con->physical.path)) return HANDLER_ERROR;
-
- mod_cml_patch_connection(srv, con, p);
-
- buffer_reset(p->basedir);
- buffer_reset(p->baseurl);
- buffer_reset(p->trigger_handler);
-
- if (buffer_is_empty(p->conf.ext)) return HANDLER_GO_ON;
-
- if (!buffer_is_equal_right_len(con->physical.path, p->conf.ext, p->conf.ext->used - 1)) {
- return HANDLER_GO_ON;
- }
-
- switch(cache_call_lua(srv, con, p, con->physical.path)) {
+
+ cache_get_session_id(srv, con, p);
+
+ ret = cache_parse_lua(srv, con, p, fn);
+
+ switch(ret) {
case -1:
/* error */
if (con->conf.log_request_handling) {
@@ -299,25 +369,22 @@ URIHANDLER_FUNC(mod_cml_is_handled) {
}
/* cache miss */
return HANDLER_COMEBACK;
- default:
- con->http_status = 500;
- return HANDLER_COMEBACK;
}
+
+ return 0;
}
-int mod_cml_plugin_init(plugin *p);
int mod_cml_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("cache");
-
+
p->init = mod_cml_init;
p->cleanup = mod_cml_free;
p->set_defaults = mod_cml_set_defaults;
-
+
p->handle_subrequest_start = mod_cml_is_handled;
- p->handle_physical = mod_cml_power_magnet;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_cml.h b/src/mod_cml.h
index 1afd708..9b09877 100644
--- a/src/mod_cml.h
+++ b/src/mod_cml.h
@@ -16,26 +16,27 @@
typedef struct {
buffer *ext;
-
+
array *mc_hosts;
buffer *mc_namespace;
-#if defined(HAVE_MEMCACHE_H)
+#if defined(HAVE_MEMCACHE_H)
struct memcache *mc;
#endif
- buffer *power_magnet;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
buffer *basedir;
buffer *baseurl;
-
+
buffer *trigger_handler;
-
+
+ buffer *session_id;
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
int cache_parse_lua(server *srv, connection *con, plugin_data *p, buffer *fn);
diff --git a/src/mod_cml_funcs.c b/src/mod_cml_funcs.c
index 9d859c7..46a1f16 100644
--- a/src/mod_cml_funcs.c
+++ b/src/mod_cml_funcs.c
@@ -1,12 +1,3 @@
-#include "buffer.h"
-#include "server.h"
-#include "log.h"
-#include "plugin.h"
-#include "response.h"
-
-#include "mod_cml.h"
-#include "mod_cml_funcs.h"
-
#include <sys/stat.h>
#include <time.h>
@@ -17,7 +8,20 @@
#include <dirent.h>
#include <stdio.h>
-#include "md5.h"
+#include "buffer.h"
+#include "server.h"
+#include "log.h"
+#include "plugin.h"
+#include "response.h"
+
+#include "mod_cml.h"
+#include "mod_cml_funcs.h"
+
+#ifdef USE_OPENSSL
+# include <openssl/md5.h>
+#else
+# include "md5.h"
+#endif
#define HASHLEN 16
typedef unsigned char HASH[HASHLEN];
@@ -26,41 +30,41 @@ typedef char HASHHEX[HASHHEXLEN+1];
#ifdef USE_OPENSSL
#define IN const
#else
-#define IN
+#define IN
#endif
#define OUT
#ifdef HAVE_LUA_H
int f_crypto_md5(lua_State *L) {
- li_MD5_CTX Md5Ctx;
+ MD5_CTX Md5Ctx;
HASH HA1;
buffer b;
char hex[33];
int n = lua_gettop(L);
-
+
b.ptr = hex;
b.used = 0;
b.size = sizeof(hex);
-
+
if (n != 1) {
lua_pushstring(L, "md5: expected one argument");
lua_error(L);
}
-
+
if (!lua_isstring(L, 1)) {
lua_pushstring(L, "md5: argument has to be a string");
lua_error(L);
}
-
- li_MD5_Init(&Md5Ctx);
- li_MD5_Update(&Md5Ctx, (unsigned char *)lua_tostring(L, 1), lua_strlen(L, 1));
- li_MD5_Final(HA1, &Md5Ctx);
-
+
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)lua_tostring(L, 1), lua_strlen(L, 1));
+ MD5_Final(HA1, &Md5Ctx);
+
buffer_copy_string_hex(&b, (char *)HA1, 16);
-
+
lua_pushstring(L, b.ptr);
-
+
return 1;
}
@@ -68,37 +72,37 @@ int f_crypto_md5(lua_State *L) {
int f_file_mtime(lua_State *L) {
struct stat st;
int n = lua_gettop(L);
-
+
if (n != 1) {
lua_pushstring(L, "file_mtime: expected one argument");
lua_error(L);
}
-
+
if (!lua_isstring(L, 1)) {
lua_pushstring(L, "file_mtime: argument has to be a string");
lua_error(L);
}
-
+
if (-1 == stat(lua_tostring(L, 1), &st)) {
lua_pushnil(L);
return 1;
}
-
+
lua_pushnumber(L, st.st_mtime);
-
+
return 1;
}
-static int f_dir_files_iter(lua_State *L) {
+int f_dir_files_iter(lua_State *L) {
DIR *d;
struct dirent *de;
-
+
d = lua_touserdata(L, lua_upvalueindex(1));
-
+
if (NULL == (de = readdir(d))) {
/* EOF */
closedir(d);
-
+
return 0;
} else {
lua_pushstring(L, de->d_name);
@@ -109,75 +113,75 @@ static int f_dir_files_iter(lua_State *L) {
int f_dir_files(lua_State *L) {
DIR *d;
int n = lua_gettop(L);
-
+
if (n != 1) {
lua_pushstring(L, "dir_files: expected one argument");
lua_error(L);
}
-
+
if (!lua_isstring(L, 1)) {
lua_pushstring(L, "dir_files: argument has to be a string");
lua_error(L);
}
-
- /* check if there is a valid DIR handle on the stack */
+
+ /* check if there is a valid DIR handle on the stack */
if (NULL == (d = opendir(lua_tostring(L, 1)))) {
lua_pushnil(L);
return 1;
}
-
+
/* push d into registry */
lua_pushlightuserdata(L, d);
lua_pushcclosure(L, f_dir_files_iter, 1);
-
+
return 1;
}
int f_file_isreg(lua_State *L) {
struct stat st;
int n = lua_gettop(L);
-
+
if (n != 1) {
lua_pushstring(L, "file_isreg: expected one argument");
lua_error(L);
}
-
+
if (!lua_isstring(L, 1)) {
lua_pushstring(L, "file_isreg: argument has to be a string");
lua_error(L);
}
-
+
if (-1 == stat(lua_tostring(L, 1), &st)) {
lua_pushnil(L);
return 1;
}
-
+
lua_pushnumber(L, S_ISREG(st.st_mode));
-
+
return 1;
}
int f_file_isdir(lua_State *L) {
struct stat st;
int n = lua_gettop(L);
-
+
if (n != 1) {
lua_pushstring(L, "file_isreg: expected one argument");
lua_error(L);
}
-
+
if (!lua_isstring(L, 1)) {
lua_pushstring(L, "file_isreg: argument has to be a string");
lua_error(L);
}
-
+
if (-1 == stat(lua_tostring(L, 1), &st)) {
lua_pushnil(L);
return 1;
}
-
+
lua_pushnumber(L, S_ISDIR(st.st_mode));
-
+
return 1;
}
@@ -188,33 +192,33 @@ int f_memcache_exists(lua_State *L) {
char *r;
int n = lua_gettop(L);
struct memcache *mc;
-
+
if (!lua_islightuserdata(L, lua_upvalueindex(1))) {
lua_pushstring(L, "where is my userdata ?");
lua_error(L);
}
-
+
mc = lua_touserdata(L, lua_upvalueindex(1));
-
+
if (n != 1) {
lua_pushstring(L, "expected one argument");
lua_error(L);
}
-
+
if (!lua_isstring(L, 1)) {
lua_pushstring(L, "argument has to be a string");
lua_error(L);
}
-
- if (NULL == (r = mc_aget(mc,
- (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
-
+
+ if (NULL == (r = mc_aget(mc,
+ lua_tostring(L, 1), lua_strlen(L, 1)))) {
+
lua_pushboolean(L, 0);
return 1;
}
-
+
free(r);
-
+
lua_pushboolean(L, 1);
return 1;
}
@@ -222,74 +226,74 @@ int f_memcache_exists(lua_State *L) {
int f_memcache_get_string(lua_State *L) {
char *r;
int n = lua_gettop(L);
-
+
struct memcache *mc;
-
+
if (!lua_islightuserdata(L, lua_upvalueindex(1))) {
lua_pushstring(L, "where is my userdata ?");
lua_error(L);
}
-
+
mc = lua_touserdata(L, lua_upvalueindex(1));
-
-
+
+
if (n != 1) {
lua_pushstring(L, "expected one argument");
lua_error(L);
}
-
+
if (!lua_isstring(L, 1)) {
lua_pushstring(L, "argument has to be a string");
lua_error(L);
}
-
- if (NULL == (r = mc_aget(mc,
- (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
+
+ if (NULL == (r = mc_aget(mc,
+ lua_tostring(L, 1), lua_strlen(L, 1)))) {
lua_pushnil(L);
return 1;
}
-
+
lua_pushstring(L, r);
-
+
free(r);
-
+
return 1;
}
int f_memcache_get_long(lua_State *L) {
char *r;
int n = lua_gettop(L);
-
+
struct memcache *mc;
-
+
if (!lua_islightuserdata(L, lua_upvalueindex(1))) {
lua_pushstring(L, "where is my userdata ?");
lua_error(L);
}
-
+
mc = lua_touserdata(L, lua_upvalueindex(1));
-
-
+
+
if (n != 1) {
lua_pushstring(L, "expected one argument");
lua_error(L);
}
-
+
if (!lua_isstring(L, 1)) {
lua_pushstring(L, "argument has to be a string");
lua_error(L);
}
-
- if (NULL == (r = mc_aget(mc,
- (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
+
+ if (NULL == (r = mc_aget(mc,
+ lua_tostring(L, 1), lua_strlen(L, 1)))) {
lua_pushnil(L);
return 1;
}
-
+
lua_pushnumber(L, strtol(r, NULL, 10));
-
+
free(r);
-
+
return 1;
}
#endif
diff --git a/src/mod_cml_funcs.h b/src/mod_cml_funcs.h
index f0695d7..42e067c 100644
--- a/src/mod_cml_funcs.h
+++ b/src/mod_cml_funcs.h
@@ -2,7 +2,7 @@
#define _MOD_CML_FUNCS_H_
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
#endif
#ifdef HAVE_LUA_H
diff --git a/src/mod_cml_lua.c b/src/mod_cml_lua.c
index 9f4e27a..5023b43 100644
--- a/src/mod_cml_lua.c
+++ b/src/mod_cml_lua.c
@@ -1,3 +1,8 @@
+#include <assert.h>
+#include <stdio.h>
+#include <errno.h>
+#include <time.h>
+
#include "mod_cml.h"
#include "mod_cml_funcs.h"
#include "log.h"
@@ -5,11 +10,11 @@
#include "stat_cache.h"
-#include <assert.h>
-#include <stdio.h>
-#include <errno.h>
-#include <time.h>
-#include <string.h>
+#ifdef USE_OPENSSL
+# include <openssl/md5.h>
+#else
+# include "md5.h"
+#endif
#define HASHLEN 16
typedef unsigned char HASH[HASHLEN];
@@ -18,7 +23,7 @@ typedef char HASHHEX[HASHHEXLEN+1];
#ifdef USE_OPENSSL
#define IN const
#else
-#define IN
+#define IN
#endif
#define OUT
@@ -26,7 +31,6 @@ typedef char HASHHEX[HASHHEXLEN+1];
#include <lua.h>
#include <lualib.h>
-#include <lauxlib.h>
typedef struct {
stream st;
@@ -35,11 +39,11 @@ typedef struct {
static const char * load_file(lua_State *L, void *data, size_t *size) {
readme *rm = data;
-
+
UNUSED(L);
-
+
if (rm->done) return 0;
-
+
*size = rm->st.size;
rm->done = 1;
return rm->st.start;
@@ -47,47 +51,47 @@ static const char * load_file(lua_State *L, void *data, size_t *size) {
static int lua_to_c_get_string(lua_State *L, const char *varname, buffer *b) {
int curelem;
-
+
lua_pushstring(L, varname);
-
+
curelem = lua_gettop(L);
lua_gettable(L, LUA_GLOBALSINDEX);
-
+
/* it should be a table */
if (!lua_isstring(L, curelem)) {
lua_settop(L, curelem - 1);
-
+
return -1;
}
-
+
buffer_copy_string(b, lua_tostring(L, curelem));
-
+
lua_pop(L, 1);
-
+
assert(curelem - 1 == lua_gettop(L));
-
+
return 0;
}
static int lua_to_c_is_table(lua_State *L, const char *varname) {
int curelem;
-
+
lua_pushstring(L, varname);
-
+
curelem = lua_gettop(L);
lua_gettable(L, LUA_GLOBALSINDEX);
-
+
/* it should be a table */
if (!lua_istable(L, curelem)) {
lua_settop(L, curelem - 1);
-
+
return 0;
}
-
+
lua_settop(L, curelem - 1);
-
+
assert(curelem - 1 == lua_gettop(L));
-
+
return 1;
}
@@ -95,148 +99,88 @@ static int c_to_lua_push(lua_State *L, int tbl, const char *key, size_t key_len,
lua_pushlstring(L, key, key_len);
lua_pushlstring(L, val, val_len);
lua_settable(L, tbl);
-
+
return 0;
}
-static int cache_export_get_params(lua_State *L, int tbl, buffer *qrystr) {
+int split_query_string(lua_State *L, int tbl, buffer *qrystr) {
size_t is_key = 1;
size_t i;
char *key = NULL, *val = NULL;
-
+
key = qrystr->ptr;
-
+
/* we need the \0 */
for (i = 0; i < qrystr->used; i++) {
switch(qrystr->ptr[i]) {
case '=':
if (is_key) {
val = qrystr->ptr + i + 1;
-
+
qrystr->ptr[i] = '\0';
-
+
is_key = 0;
}
-
+
break;
case '&':
case '\0': /* fin symbol */
if (!is_key) {
/* we need at least a = since the last & */
-
- /* terminate the value */
- qrystr->ptr[i] = '\0';
-
- c_to_lua_push(L, tbl,
+
+ c_to_lua_push(L, tbl,
key, strlen(key),
val, strlen(val));
}
-
+
key = qrystr->ptr + i + 1;
val = NULL;
is_key = 1;
break;
}
}
-
+
return 0;
}
-#if 0
-int cache_export_cookie_params(server *srv, connection *con, plugin_data *p) {
- data_unset *d;
-
- UNUSED(srv);
-
- if (NULL != (d = array_get_element(con->request.headers, "Cookie"))) {
- data_string *ds = (data_string *)d;
- size_t key = 0, value = 0;
- size_t is_key = 1, is_sid = 0;
- size_t i;
-
- /* found COOKIE */
- if (!DATA_IS_STRING(d)) return -1;
- if (ds->value->used == 0) return -1;
-
- if (ds->value->ptr[0] == '\0' ||
- ds->value->ptr[0] == '=' ||
- ds->value->ptr[0] == ';') return -1;
-
- buffer_reset(p->session_id);
- for (i = 0; i < ds->value->used; i++) {
- switch(ds->value->ptr[i]) {
- case '=':
- if (is_key) {
- if (0 == strncmp(ds->value->ptr + key, "PHPSESSID", i - key)) {
- /* found PHP-session-id-key */
- is_sid = 1;
- }
- value = i + 1;
-
- is_key = 0;
- }
-
- break;
- case ';':
- if (is_sid) {
- buffer_copy_string_len(p->session_id, ds->value->ptr + value, i - value);
- }
-
- is_sid = 0;
- key = i + 1;
- value = 0;
- is_key = 1;
- break;
- case ' ':
- if (is_key == 1 && key == i) key = i + 1;
- if (is_key == 0 && value == i) value = i + 1;
- break;
- case '\0':
- if (is_sid) {
- buffer_copy_string_len(p->session_id, ds->value->ptr + value, i - value);
- }
- /* fin */
- break;
- }
- }
- }
-
- return 0;
-}
-#endif
int cache_parse_lua(server *srv, connection *con, plugin_data *p, buffer *fn) {
- lua_State *L;
+ lua_State *L;
readme rm;
int ret = -1;
buffer *b = buffer_init();
int header_tbl = 0;
-
+
rm.done = 0;
stream_open(&rm.st, fn);
-
+
/* push the lua file to the interpreter and see what happends */
- L = luaL_newstate();
- luaL_openlibs(L);
-
+ L = lua_open();
+
+ luaopen_base(L);
+ luaopen_table(L);
+ luaopen_string(L);
+ luaopen_math(L);
+ luaopen_io(L);
+
/* register functions */
lua_register(L, "md5", f_crypto_md5);
lua_register(L, "file_mtime", f_file_mtime);
lua_register(L, "file_isreg", f_file_isreg);
lua_register(L, "file_isdir", f_file_isreg);
lua_register(L, "dir_files", f_dir_files);
-
+
#ifdef HAVE_MEMCACHE_H
lua_pushliteral(L, "memcache_get_long");
lua_pushlightuserdata(L, p->conf.mc);
lua_pushcclosure(L, f_memcache_get_long, 1);
lua_settable(L, LUA_GLOBALSINDEX);
-
+
lua_pushliteral(L, "memcache_get_string");
lua_pushlightuserdata(L, p->conf.mc);
lua_pushcclosure(L, f_memcache_get_string, 1);
lua_settable(L, LUA_GLOBALSINDEX);
-
+
lua_pushliteral(L, "memcache_exists");
lua_pushlightuserdata(L, p->conf.mc);
lua_pushcclosure(L, f_memcache_exists, 1);
@@ -246,11 +190,11 @@ int cache_parse_lua(server *srv, connection *con, plugin_data *p, buffer *fn) {
lua_pushliteral(L, "request");
lua_newtable(L);
lua_settable(L, LUA_GLOBALSINDEX);
-
+
lua_pushliteral(L, "request");
header_tbl = lua_gettop(L);
lua_gettable(L, LUA_GLOBALSINDEX);
-
+
c_to_lua_push(L, header_tbl, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri));
c_to_lua_push(L, header_tbl, CONST_STR_LEN("SCRIPT_NAME"), CONST_BUF_LEN(con->uri.path));
c_to_lua_push(L, header_tbl, CONST_STR_LEN("SCRIPT_FILENAME"), CONST_BUF_LEN(con->physical.path));
@@ -258,84 +202,84 @@ int cache_parse_lua(server *srv, connection *con, plugin_data *p, buffer *fn) {
if (!buffer_is_empty(con->request.pathinfo)) {
c_to_lua_push(L, header_tbl, CONST_STR_LEN("PATH_INFO"), CONST_BUF_LEN(con->request.pathinfo));
}
-
+
c_to_lua_push(L, header_tbl, CONST_STR_LEN("CWD"), CONST_BUF_LEN(p->basedir));
c_to_lua_push(L, header_tbl, CONST_STR_LEN("BASEURL"), CONST_BUF_LEN(p->baseurl));
-
+
/* register GET parameter */
lua_pushliteral(L, "get");
lua_newtable(L);
lua_settable(L, LUA_GLOBALSINDEX);
-
+
lua_pushliteral(L, "get");
header_tbl = lua_gettop(L);
lua_gettable(L, LUA_GLOBALSINDEX);
-
+
+
buffer_copy_string_buffer(b, con->uri.query);
- cache_export_get_params(L, header_tbl, b);
+ split_query_string(L, header_tbl, b);
buffer_reset(b);
-
- /* 2 default constants */
+
lua_pushliteral(L, "CACHE_HIT");
lua_pushnumber(L, 0);
lua_settable(L, LUA_GLOBALSINDEX);
-
+
lua_pushliteral(L, "CACHE_MISS");
lua_pushnumber(L, 1);
lua_settable(L, LUA_GLOBALSINDEX);
-
+
/* load lua program */
if (lua_load(L, load_file, &rm, fn->ptr) || lua_pcall(L,0,1,0)) {
log_error_write(srv, __FILE__, __LINE__, "s",
lua_tostring(L,-1));
-
+
goto error;
}
-
+
/* get return value */
ret = (int)lua_tonumber(L, -1);
lua_pop(L, 1);
-
- /* fetch the data from lua */
+
+ /* fetch the data from lua */
lua_to_c_get_string(L, "trigger_handler", p->trigger_handler);
-
+
if (0 == lua_to_c_get_string(L, "output_contenttype", b)) {
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(b));
}
-
+
+ if (!lua_to_c_is_table(L, "output_include")) {
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "output_include is missing or not a table");
+ ret = -1;
+
+ goto error;
+ }
+
if (ret == 0) {
/* up to now it is a cache-hit, check if all files exist */
-
+
int curelem;
time_t mtime = 0;
-
- if (!lua_to_c_is_table(L, "output_include")) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "output_include is missing or not a table");
- ret = -1;
-
- goto error;
- }
-
+
lua_pushstring(L, "output_include");
-
+
curelem = lua_gettop(L);
lua_gettable(L, LUA_GLOBALSINDEX);
/* HOW-TO build a etag ?
- * as we don't just have one file we have to take the stat()
+ * as we don't just have one file we have to take the stat()
* from all base files, merge them and build the etag from
* it later.
- *
+ *
* The mtime of the content is the mtime of the freshest base file
- *
+ *
* */
-
+
lua_pushnil(L); /* first key */
while (lua_next(L, curelem) != 0) {
stat_cache_entry *sce = NULL;
/* key' is at index -2 and value' at index -1 */
-
+
if (lua_isstring(L, -1)) {
const char *s = lua_tostring(L, -1);
@@ -355,18 +299,18 @@ int cache_parse_lua(server *srv, connection *con, plugin_data *p, buffer *fn) {
/* a file is missing, call the handler to generate it */
if (!buffer_is_empty(p->trigger_handler)) {
ret = 1; /* cache-miss */
-
+
log_error_write(srv, __FILE__, __LINE__, "s",
"a file is missing, calling handler");
-
+
break;
} else {
/* handler not set -> 500 */
ret = -1;
-
+
log_error_write(srv, __FILE__, __LINE__, "s",
"a file missing and no handler set");
-
+
break;
}
break;
@@ -384,12 +328,12 @@ int cache_parse_lua(server *srv, connection *con, plugin_data *p, buffer *fn) {
"not a string");
break;
}
-
+
lua_pop(L, 1); /* removes value'; keeps key' for next iteration */
}
-
+
lua_settop(L, curelem - 1);
-
+
if (ret == 0) {
data_string *ds;
char timebuf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")];
@@ -401,9 +345,9 @@ int cache_parse_lua(server *srv, connection *con, plugin_data *p, buffer *fn) {
/* no Last-Modified specified */
if ((mtime) && (NULL == ds)) {
-
+
strftime(timebuf, sizeof(timebuf), "%a, %d %b %Y %H:%M:%S GMT", gmtime(&mtime));
-
+
response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), timebuf, sizeof(timebuf) - 1);
@@ -419,9 +363,9 @@ int cache_parse_lua(server *srv, connection *con, plugin_data *p, buffer *fn) {
tbuf.used = 0;
tbuf.ptr = NULL;
}
-
+
if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, &tbuf)) {
- /* ok, the client already has our content,
+ /* ok, the client already has our content,
* no need to send it again */
chunkqueue_reset(con->write_queue);
@@ -431,32 +375,34 @@ int cache_parse_lua(server *srv, connection *con, plugin_data *p, buffer *fn) {
chunkqueue_reset(con->write_queue);
}
}
-
- if (ret == 1 && !buffer_is_empty(p->trigger_handler)) {
+
+ if (ret == 1 && buffer_is_empty(p->trigger_handler)) {
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "cache-miss, but not trigger_handler set");
+ ret = -1;
+ }
+
+ if (ret == 1) {
/* cache-miss */
buffer_copy_string_buffer(con->uri.path, p->baseurl);
buffer_append_string_buffer(con->uri.path, p->trigger_handler);
-
+
buffer_copy_string_buffer(con->physical.path, p->basedir);
buffer_append_string_buffer(con->physical.path, p->trigger_handler);
-
+
chunkqueue_reset(con->write_queue);
}
-
+
error:
lua_close(L);
-
+
stream_close(&rm.st);
buffer_free(b);
-
+
return ret /* cache-error */;
}
#else
int cache_parse_lua(server *srv, connection *con, plugin_data *p, buffer *fn) {
- UNUSED(srv);
- UNUSED(con);
- UNUSED(p);
- UNUSED(fn);
/* error */
return -1;
}
diff --git a/src/mod_compress.c b/src/mod_compress.c
index 455e97e..fc78220 100644
--- a/src/mod_compress.c
+++ b/src/mod_compress.c
@@ -1,14 +1,3 @@
-#include "base.h"
-#include "log.h"
-#include "buffer.h"
-#include "response.h"
-#include "stat_cache.h"
-
-#include "plugin.h"
-
-#include "crc32.h"
-#include "etag.h"
-
#include <sys/types.h>
#include <sys/stat.h>
@@ -20,6 +9,17 @@
#include <errno.h>
#include <time.h>
+#include "base.h"
+#include "log.h"
+#include "buffer.h"
+#include "response.h"
+#include "stat_cache.h"
+
+#include "plugin.h"
+
+#include "crc32.h"
+#include "etag.h"
+
#if defined HAVE_ZLIB_H && defined HAVE_LIBZ
# define USE_ZLIB
# include <zlib.h>
@@ -42,194 +42,110 @@
#define HTTP_ACCEPT_ENCODING_BZIP2 BV(4)
#ifdef __WIN32
-# define mkdir(x,y) mkdir(x)
+#define mkdir(x,y) mkdir(x)
#endif
typedef struct {
buffer *compress_cache_dir;
array *compress;
off_t compress_max_filesize; /** max filesize in kb */
- int allowed_encodings;
} plugin_config;
typedef struct {
PLUGIN_DATA;
buffer *ofn;
buffer *b;
-
+
plugin_config **config_storage;
- plugin_config conf;
+ plugin_config conf;
} plugin_data;
INIT_FUNC(mod_compress_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->ofn = buffer_init();
p->b = buffer_init();
-
+
return p;
}
FREE_FUNC(mod_compress_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
buffer_free(p->ofn);
buffer_free(p->b);
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
-
+
array_free(s->compress);
buffer_free(s->compress_cache_dir);
-
+
free(s);
}
free(p->config_storage);
}
-
-
+
+
free(p);
-
+
return HANDLER_GO_ON;
}
-/* 0 on success, -1 for error */
-static int mkdir_recursive(char *dir) {
- char *p = dir;
-
- if (!dir || !dir[0])
- return 0;
-
- while ((p = strchr(p + 1, '/')) != NULL) {
-
- *p = '\0';
- if ((mkdir(dir, 0700) != 0) && (errno != EEXIST)) {
- *p = '/';
- return -1;
- }
-
- *p++ = '/';
- if (!*p) return 0; /* Ignore trailing slash */
- }
-
- return (mkdir(dir, 0700) != 0) && (errno != EEXIST) ? -1 : 0;
-}
-
-/* 0 on success, -1 for error */
-static int mkdir_for_file(char *filename) {
- char *p = filename;
-
- if (!filename || !filename[0])
- return -1;
-
- while ((p = strchr(p + 1, '/')) != NULL) {
-
- *p = '\0';
- if ((mkdir(filename, 0700) != 0) && (errno != EEXIST)) {
- *p = '/';
- return -1;
- }
-
- *p++ = '/';
- if (!*p) return -1; /* Unexpected trailing slash in filename */
- }
-
- return 0;
-}
-
SETDEFAULTS_FUNC(mod_compress_setdefaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "compress.cache-dir", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
{ "compress.filetype", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },
{ "compress.max-filesize", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },
- { "compress.allowed-encodings", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
- array *encodings_arr = array_init();
-
+
s = calloc(1, sizeof(plugin_config));
s->compress_cache_dir = buffer_init();
s->compress = array_init();
s->compress_max_filesize = 0;
- s->allowed_encodings = 0;
-
+
cv[0].destination = s->compress_cache_dir;
cv[1].destination = s->compress;
cv[2].destination = &(s->compress_max_filesize);
- cv[3].destination = encodings_arr; /* temp array for allowed encodings list */
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
-
- if (encodings_arr->used) {
- size_t j = 0;
- for (j = 0; j < encodings_arr->used; j++) {
- data_string *ds = (data_string *)encodings_arr->data[j];
-#ifdef USE_ZLIB
- if (NULL != strstr(ds->value->ptr, "gzip"))
- s->allowed_encodings |= HTTP_ACCEPT_ENCODING_GZIP;
- if (NULL != strstr(ds->value->ptr, "deflate"))
- s->allowed_encodings |= HTTP_ACCEPT_ENCODING_DEFLATE;
- /*
- if (NULL != strstr(ds->value->ptr, "compress"))
- s->allowed_encodings |= HTTP_ACCEPT_ENCODING_COMPRESS;
- */
-#endif
-#ifdef USE_BZ2LIB
- if (NULL != strstr(ds->value->ptr, "bzip2"))
- s->allowed_encodings |= HTTP_ACCEPT_ENCODING_BZIP2;
-#endif
- }
- } else {
- /* default encodings */
- s->allowed_encodings = 0
-#ifdef USE_ZLIB
- | HTTP_ACCEPT_ENCODING_GZIP | HTTP_ACCEPT_ENCODING_DEFLATE
-#endif
-#ifdef USE_BZ2LIB
- | HTTP_ACCEPT_ENCODING_BZIP2
-#endif
- ;
- }
-
- array_free(encodings_arr);
-
+
if (!buffer_is_empty(s->compress_cache_dir)) {
struct stat st;
- mkdir_recursive(s->compress_cache_dir->ptr);
-
if (0 != stat(s->compress_cache_dir->ptr, &st)) {
- log_error_write(srv, __FILE__, __LINE__, "sbs", "can't stat compress.cache-dir",
+ log_error_write(srv, __FILE__, __LINE__, "sbs", "can't stat compress.cache-dir",
s->compress_cache_dir, strerror(errno));
-
+
return HANDLER_ERROR;
}
}
}
-
+
return HANDLER_GO_ON;
-
+
}
#ifdef USE_ZLIB
@@ -237,32 +153,32 @@ static int deflate_file_to_buffer_gzip(server *srv, connection *con, plugin_data
unsigned char *c;
unsigned long crc;
z_stream z;
-
+
UNUSED(srv);
UNUSED(con);
z.zalloc = Z_NULL;
z.zfree = Z_NULL;
z.opaque = Z_NULL;
-
- if (Z_OK != deflateInit2(&z,
+
+ if (Z_OK != deflateInit2(&z,
Z_DEFAULT_COMPRESSION,
- Z_DEFLATED,
+ Z_DEFLATED,
-MAX_WBITS, /* supress zlib-header */
8,
Z_DEFAULT_STRATEGY)) {
return -1;
}
-
+
z.next_in = (unsigned char *)start;
z.avail_in = st_size;
z.total_in = 0;
-
-
+
+
buffer_prepare_copy(p->b, (z.avail_in * 1.1) + 12 + 18);
-
+
/* write gzip header */
-
+
c = (unsigned char *)p->b->ptr;
c[0] = 0x1f;
c[1] = 0x8b;
@@ -274,24 +190,24 @@ static int deflate_file_to_buffer_gzip(server *srv, connection *con, plugin_data
c[7] = (mtime >> 24) & 0xff;
c[8] = 0x00; /* extra flags */
c[9] = 0x03; /* UNIX */
-
+
p->b->used = 10;
z.next_out = (unsigned char *)p->b->ptr + p->b->used;
z.avail_out = p->b->size - p->b->used - 8;
z.total_out = 0;
-
+
if (Z_STREAM_END != deflate(&z, Z_FINISH)) {
deflateEnd(&z);
return -1;
}
-
+
/* trailer */
p->b->used += z.total_out;
-
+
crc = generate_crc32c(start, st_size);
-
+
c = (unsigned char *)p->b->ptr + p->b->used;
-
+
c[0] = (crc >> 0) & 0xff;
c[1] = (crc >> 8) & 0xff;
c[2] = (crc >> 16) & 0xff;
@@ -305,51 +221,51 @@ static int deflate_file_to_buffer_gzip(server *srv, connection *con, plugin_data
if (Z_OK != deflateEnd(&z)) {
return -1;
}
-
+
return 0;
}
static int deflate_file_to_buffer_deflate(server *srv, connection *con, plugin_data *p, unsigned char *start, off_t st_size) {
z_stream z;
-
+
UNUSED(srv);
UNUSED(con);
z.zalloc = Z_NULL;
z.zfree = Z_NULL;
z.opaque = Z_NULL;
-
- if (Z_OK != deflateInit2(&z,
+
+ if (Z_OK != deflateInit2(&z,
Z_DEFAULT_COMPRESSION,
- Z_DEFLATED,
+ Z_DEFLATED,
-MAX_WBITS, /* supress zlib-header */
8,
Z_DEFAULT_STRATEGY)) {
return -1;
}
-
+
z.next_in = start;
z.avail_in = st_size;
z.total_in = 0;
-
+
buffer_prepare_copy(p->b, (z.avail_in * 1.1) + 12);
-
+
z.next_out = (unsigned char *)p->b->ptr;
z.avail_out = p->b->size;
z.total_out = 0;
-
+
if (Z_STREAM_END != deflate(&z, Z_FINISH)) {
deflateEnd(&z);
return -1;
}
-
+
/* trailer */
p->b->used += z.total_out;
-
+
if (Z_OK != deflateEnd(&z)) {
return -1;
}
-
+
return 0;
}
@@ -358,48 +274,48 @@ static int deflate_file_to_buffer_deflate(server *srv, connection *con, plugin_d
#ifdef USE_BZ2LIB
static int deflate_file_to_buffer_bzip2(server *srv, connection *con, plugin_data *p, unsigned char *start, off_t st_size) {
bz_stream bz;
-
+
UNUSED(srv);
UNUSED(con);
bz.bzalloc = NULL;
bz.bzfree = NULL;
bz.opaque = NULL;
-
- if (BZ_OK != BZ2_bzCompressInit(&bz,
+
+ if (BZ_OK != BZ2_bzCompressInit(&bz,
9, /* blocksize = 900k */
0, /* no output */
0)) { /* workFactor: default */
return -1;
}
-
+
bz.next_in = (char *)start;
bz.avail_in = st_size;
bz.total_in_lo32 = 0;
bz.total_in_hi32 = 0;
-
+
buffer_prepare_copy(p->b, (bz.avail_in * 1.1) + 12);
-
+
bz.next_out = p->b->ptr;
bz.avail_out = p->b->size;
bz.total_out_lo32 = 0;
bz.total_out_hi32 = 0;
-
+
if (BZ_STREAM_END != BZ2_bzCompress(&bz, BZ_FINISH)) {
BZ2_bzCompressEnd(&bz);
return -1;
}
-
+
/* file is too large for now */
if (bz.total_out_hi32) return -1;
-
+
/* trailer */
p->b->used = bz.total_out_lo32;
-
+
if (BZ_OK != BZ2_bzCompressEnd(&bz)) {
return -1;
}
-
+
return 0;
}
#endif
@@ -410,50 +326,64 @@ static int deflate_file_to_file(server *srv, connection *con, plugin_data *p, bu
void *start;
const char *filename = fn->ptr;
ssize_t r;
-
+
/* overflow */
if ((off_t)(sce->st.st_size * 1.1) < sce->st.st_size) return -1;
-
- /* don't mmap files > 128Mb
- *
+
+ /* don't mmap files > 128Mb
+ *
* we could use a sliding window, but currently there is no need for it
*/
-
+
if (sce->st.st_size > 128 * 1024 * 1024) return -1;
-
+
buffer_reset(p->ofn);
buffer_copy_string_buffer(p->ofn, p->conf.compress_cache_dir);
BUFFER_APPEND_SLASH(p->ofn);
-
+
if (0 == strncmp(con->physical.path->ptr, con->physical.doc_root->ptr, con->physical.doc_root->used-1)) {
+ size_t offset = p->ofn->used - 1;
+ char *dir, *nextdir;
+
buffer_append_string(p->ofn, con->physical.path->ptr + con->physical.doc_root->used - 1);
+
buffer_copy_string_buffer(p->b, p->ofn);
+
+ /* mkdir -p ... */
+ for (dir = p->b->ptr + offset; NULL != (nextdir = strchr(dir, '/')); dir = nextdir + 1) {
+ *nextdir = '\0';
+
+ if (-1 == mkdir(p->b->ptr, 0700)) {
+ if (errno != EEXIST) {
+ log_error_write(srv, __FILE__, __LINE__, "sbss", "creating cache-directory", p->b, "failed", strerror(errno));
+
+ return -1;
+ }
+ }
+
+ *nextdir = '/';
+ }
} else {
buffer_append_string_buffer(p->ofn, con->uri.path);
}
-
+
switch(type) {
case HTTP_ACCEPT_ENCODING_GZIP:
- buffer_append_string_len(p->ofn, CONST_STR_LEN("-gzip-"));
+ buffer_append_string(p->ofn, "-gzip-");
break;
case HTTP_ACCEPT_ENCODING_DEFLATE:
- buffer_append_string_len(p->ofn, CONST_STR_LEN("-deflate-"));
+ buffer_append_string(p->ofn, "-deflate-");
break;
case HTTP_ACCEPT_ENCODING_BZIP2:
- buffer_append_string_len(p->ofn, CONST_STR_LEN("-bzip2-"));
+ buffer_append_string(p->ofn, "-bzip2-");
break;
default:
log_error_write(srv, __FILE__, __LINE__, "sd", "unknown compression type", type);
return -1;
}
-
+
buffer_append_string_buffer(p->ofn, sce->etag);
-
- if (-1 == mkdir_for_file(p->ofn->ptr)) {
- log_error_write(srv, __FILE__, __LINE__, "sb", "couldn't create directory for file", p->ofn);
- return -1;
- }
-
+
if (-1 == (ofd = open(p->ofn->ptr, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0600))) {
if (errno == EEXIST) {
/* cache-entry exists */
@@ -461,73 +391,45 @@ static int deflate_file_to_file(server *srv, connection *con, plugin_data *p, bu
log_error_write(srv, __FILE__, __LINE__, "bs", p->ofn, "compress-cache hit");
#endif
buffer_copy_string_buffer(con->physical.path, p->ofn);
-
+
return 0;
}
-
+
log_error_write(srv, __FILE__, __LINE__, "sbss", "creating cachefile", p->ofn, "failed", strerror(errno));
-
+
return -1;
}
#if 0
log_error_write(srv, __FILE__, __LINE__, "bs", p->ofn, "compress-cache miss");
-#endif
+#endif
if (-1 == (ifd = open(filename, O_RDONLY | O_BINARY))) {
log_error_write(srv, __FILE__, __LINE__, "sbss", "opening plain-file", fn, "failed", strerror(errno));
-
+
close(ofd);
-
- /* Remove the incomplete cache file, so that later hits aren't served from it */
- if (-1 == unlink(p->ofn->ptr)) {
- log_error_write(srv, __FILE__, __LINE__, "sbss", "unlinking incomplete cachefile", p->ofn, "failed:", strerror(errno));
- }
-
+
return -1;
}
-
-#ifdef USE_MMAP
+
+
if (MAP_FAILED == (start = mmap(NULL, sce->st.st_size, PROT_READ, MAP_SHARED, ifd, 0))) {
log_error_write(srv, __FILE__, __LINE__, "sbss", "mmaping", fn, "failed", strerror(errno));
-
+
close(ofd);
close(ifd);
-
- /* Remove the incomplete cache file, so that later hits aren't served from it */
- if (-1 == unlink(p->ofn->ptr)) {
- log_error_write(srv, __FILE__, __LINE__, "sbss", "unlinking incomplete cachefile", p->ofn, "failed:", strerror(errno));
- }
-
return -1;
}
-#else
- start = malloc(sce->st.st_size);
- if (NULL == start || sce->st.st_size != read(ifd, start, sce->st.st_size)) {
- log_error_write(srv, __FILE__, __LINE__, "sbss", "reading", fn, "failed", strerror(errno));
-
- close(ofd);
- close(ifd);
- free(start);
-
- /* Remove the incomplete cache file, so that later hits aren't served from it */
- if (-1 == unlink(p->ofn->ptr)) {
- log_error_write(srv, __FILE__, __LINE__, "sbss", "unlinking incomplete cachefile", p->ofn, "failed:", strerror(errno));
- }
-
- return -1;
- }
-#endif
-
+
switch(type) {
#ifdef USE_ZLIB
- case HTTP_ACCEPT_ENCODING_GZIP:
+ case HTTP_ACCEPT_ENCODING_GZIP:
ret = deflate_file_to_buffer_gzip(srv, con, p, start, sce->st.st_size, sce->st.st_mtime);
break;
- case HTTP_ACCEPT_ENCODING_DEFLATE:
+ case HTTP_ACCEPT_ENCODING_DEFLATE:
ret = deflate_file_to_buffer_deflate(srv, con, p, start, sce->st.st_size);
break;
#endif
#ifdef USE_BZ2LIB
- case HTTP_ACCEPT_ENCODING_BZIP2:
+ case HTTP_ACCEPT_ENCODING_BZIP2:
ret = deflate_file_to_buffer_bzip2(srv, con, p, start, sce->st.st_size);
break;
#endif
@@ -535,38 +437,26 @@ static int deflate_file_to_file(server *srv, connection *con, plugin_data *p, bu
ret = -1;
break;
}
-
- if (ret == 0) {
- r = write(ofd, p->b->ptr, p->b->used);
- if (-1 == r) {
- log_error_write(srv, __FILE__, __LINE__, "sbss", "writing cachefile", p->ofn, "failed:", strerror(errno));
- ret = -1;
- } else if ((size_t)r != p->b->used) {
- log_error_write(srv, __FILE__, __LINE__, "sbs", "writing cachefile", p->ofn, "failed: not enough bytes written");
- ret = -1;
- }
+
+ if (-1 == (r = write(ofd, p->b->ptr, p->b->used))) {
+ munmap(start, sce->st.st_size);
+ close(ofd);
+ close(ifd);
+ return -1;
}
-
-#ifdef USE_MMAP
+
+ if ((size_t)r != p->b->used) {
+
+ }
+
munmap(start, sce->st.st_size);
-#else
- free(start);
-#endif
-
close(ofd);
close(ifd);
-
- if (ret != 0) {
- /* Remove the incomplete cache file, so that later hits aren't served from it */
- if (-1 == unlink(p->ofn->ptr)) {
- log_error_write(srv, __FILE__, __LINE__, "sbss", "unlinking incomplete cachefile", p->ofn, "failed:", strerror(errno));
- }
-
- return -1;
- }
-
+
+ if (ret != 0) return -1;
+
buffer_copy_string_buffer(con->physical.path, p->ofn);
-
+
return 0;
}
@@ -575,53 +465,43 @@ static int deflate_file_to_buffer(server *srv, connection *con, plugin_data *p,
int ret = -1;
void *start;
buffer *b;
-
+
/* overflow */
if ((off_t)(sce->st.st_size * 1.1) < sce->st.st_size) return -1;
-
+
/* don't mmap files > 128M
- *
+ *
* we could use a sliding window, but currently there is no need for it
*/
-
+
if (sce->st.st_size > 128 * 1024 * 1024) return -1;
-
-
+
+
if (-1 == (ifd = open(fn->ptr, O_RDONLY | O_BINARY))) {
log_error_write(srv, __FILE__, __LINE__, "sbss", "opening plain-file", fn, "failed", strerror(errno));
-
+
return -1;
}
-
-#ifdef USE_MMAP
+
+
if (MAP_FAILED == (start = mmap(NULL, sce->st.st_size, PROT_READ, MAP_SHARED, ifd, 0))) {
log_error_write(srv, __FILE__, __LINE__, "sbss", "mmaping", fn, "failed", strerror(errno));
-
- close(ifd);
- return -1;
- }
-#else
- start = malloc(sce->st.st_size);
- if (NULL == start || sce->st.st_size != read(ifd, start, sce->st.st_size)) {
- log_error_write(srv, __FILE__, __LINE__, "sbss", "reading", fn, "failed", strerror(errno));
-
+
close(ifd);
- free(start);
return -1;
}
-#endif
-
+
switch(type) {
#ifdef USE_ZLIB
- case HTTP_ACCEPT_ENCODING_GZIP:
+ case HTTP_ACCEPT_ENCODING_GZIP:
ret = deflate_file_to_buffer_gzip(srv, con, p, start, sce->st.st_size, sce->st.st_mtime);
break;
- case HTTP_ACCEPT_ENCODING_DEFLATE:
+ case HTTP_ACCEPT_ENCODING_DEFLATE:
ret = deflate_file_to_buffer_deflate(srv, con, p, start, sce->st.st_size);
break;
#endif
#ifdef USE_BZ2LIB
- case HTTP_ACCEPT_ENCODING_BZIP2:
+ case HTTP_ACCEPT_ENCODING_BZIP2:
ret = deflate_file_to_buffer_bzip2(srv, con, p, start, sce->st.st_size);
break;
#endif
@@ -629,25 +509,21 @@ static int deflate_file_to_buffer(server *srv, connection *con, plugin_data *p,
ret = -1;
break;
}
-
-#ifdef USE_MMAP
+
munmap(start, sce->st.st_size);
-#else
- free(start);
-#endif
close(ifd);
-
+
if (ret != 0) return -1;
-
+
chunkqueue_reset(con->write_queue);
b = chunkqueue_get_append_buffer(con->write_queue);
buffer_copy_memory(b, p->b->ptr, p->b->used + 1);
-
+
buffer_reset(con->physical.path);
-
+
con->file_finished = 1;
con->file_started = 1;
-
+
return 0;
}
@@ -661,32 +537,29 @@ static int mod_compress_patch_connection(server *srv, connection *con, plugin_da
PATCH(compress_cache_dir);
PATCH(compress);
PATCH(compress_max_filesize);
- PATCH(allowed_encodings);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.cache-dir"))) {
PATCH(compress_cache_dir);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.filetype"))) {
PATCH(compress);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.max-filesize"))) {
PATCH(compress_max_filesize);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.allowed-encodings"))) {
- PATCH(allowed_encodings);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -696,13 +569,9 @@ PHYSICALPATH_FUNC(mod_compress_physical) {
size_t m;
off_t max_fsize;
stat_cache_entry *sce = NULL;
- buffer *mtime = NULL;
- buffer *content_type;
-
- if (con->mode != DIRECT || con->http_status) return HANDLER_GO_ON;
-
+
/* only GET and POST can get compressed */
- if (con->request.http_method != HTTP_METHOD_GET &&
+ if (con->request.http_method != HTTP_METHOD_GET &&
con->request.http_method != HTTP_METHOD_POST) {
return HANDLER_GO_ON;
}
@@ -710,113 +579,66 @@ PHYSICALPATH_FUNC(mod_compress_physical) {
if (buffer_is_empty(con->physical.path)) {
return HANDLER_GO_ON;
}
-
+
mod_compress_patch_connection(srv, con, p);
-
+
max_fsize = p->conf.compress_max_filesize;
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s", "-- handling file as static file");
- }
-
- if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
- con->http_status = 403;
-
- log_error_write(srv, __FILE__, __LINE__, "sbsb",
- "not a regular file:", con->uri.path,
- "->", con->physical.path);
-
- return HANDLER_FINISHED;
- }
-
- /* we only handle regular files */
-#ifdef HAVE_LSTAT
- if ((sce->is_symlink == 1) && !con->conf.follow_symlink) {
- return HANDLER_GO_ON;
- }
-#endif
- if (!S_ISREG(sce->st.st_mode)) {
- return HANDLER_GO_ON;
- }
+ stat_cache_get_entry(srv, con, con->physical.path, &sce);
/* don't compress files that are too large as we need to much time to handle them */
if (max_fsize && (sce->st.st_size >> 10) > max_fsize) return HANDLER_GO_ON;
-
- /* don't try to compress files less than 128 bytes
- *
- * - extra overhead for compression
- * - mmap() fails for st_size = 0 :)
- */
- if (sce->st.st_size < 128) return HANDLER_GO_ON;
-
+
/* check if mimetype is in compress-config */
- content_type = 0;
- if (sce->content_type->ptr) {
- char *c;
- if ( (c = strchr(sce->content_type->ptr, ';')) != 0) {
- content_type = srv->tmp_buf;
- buffer_copy_string_len(content_type, sce->content_type->ptr, c - sce->content_type->ptr);
- }
- }
-
for (m = 0; m < p->conf.compress->used; m++) {
data_string *compress_ds = (data_string *)p->conf.compress->data[m];
-
+
if (!compress_ds) {
log_error_write(srv, __FILE__, __LINE__, "sbb", "evil", con->physical.path, con->uri.path);
-
+
return HANDLER_GO_ON;
}
-
- if (buffer_is_equal(compress_ds->value, sce->content_type)
- || (content_type && buffer_is_equal(compress_ds->value, content_type))) {
+
+ if (buffer_is_equal(compress_ds->value, sce->content_type)) {
/* mimetype found */
data_string *ds;
-
+
/* the response might change according to Accept-Encoding */
response_header_insert(srv, con, CONST_STR_LEN("Vary"), CONST_STR_LEN("Accept-Encoding"));
-
+
if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Accept-Encoding"))) {
int accept_encoding = 0;
char *value = ds->value->ptr;
+ int srv_encodings = 0;
int matched_encodings = 0;
- int use_etag = sce->etag != NULL && sce->etag->ptr != NULL;
-
+
/* get client side support encodings */
-#ifdef USE_ZLIB
if (NULL != strstr(value, "gzip")) accept_encoding |= HTTP_ACCEPT_ENCODING_GZIP;
if (NULL != strstr(value, "deflate")) accept_encoding |= HTTP_ACCEPT_ENCODING_DEFLATE;
if (NULL != strstr(value, "compress")) accept_encoding |= HTTP_ACCEPT_ENCODING_COMPRESS;
-#endif
-#ifdef USE_BZ2LIB
if (NULL != strstr(value, "bzip2")) accept_encoding |= HTTP_ACCEPT_ENCODING_BZIP2;
-#endif
if (NULL != strstr(value, "identity")) accept_encoding |= HTTP_ACCEPT_ENCODING_IDENTITY;
-
+
+ /* get server side supported ones */
+#ifdef USE_BZ2LIB
+ srv_encodings |= HTTP_ACCEPT_ENCODING_BZIP2;
+#endif
+#ifdef USE_ZLIB
+ srv_encodings |= HTTP_ACCEPT_ENCODING_GZIP;
+ srv_encodings |= HTTP_ACCEPT_ENCODING_DEFLATE;
+#endif
+
/* find matching entries */
- matched_encodings = accept_encoding & p->conf.allowed_encodings;
-
+ matched_encodings = accept_encoding & srv_encodings;
+
if (matched_encodings) {
const char *dflt_gzip = "gzip";
const char *dflt_deflate = "deflate";
const char *dflt_bzip2 = "bzip2";
-
+
const char *compression_name = NULL;
int compression_type = 0;
-
- mtime = strftime_cache_get(srv, sce->st.st_mtime);
-
- /* try matching original etag of uncompressed version */
- if (use_etag) {
- etag_mutate(con->physical.etag, sce->etag);
- if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) {
- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
- response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
- response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
- return HANDLER_FINISHED;
- }
- }
-
+
/* select best matching encoding */
if (matched_encodings & HTTP_ACCEPT_ENCODING_BZIP2) {
compression_type = HTTP_ACCEPT_ENCODING_BZIP2;
@@ -828,60 +650,52 @@ PHYSICALPATH_FUNC(mod_compress_physical) {
compression_type = HTTP_ACCEPT_ENCODING_DEFLATE;
compression_name = dflt_deflate;
}
+
+ /* deflate it */
+ if (p->conf.compress_cache_dir->used) {
+ if (0 == deflate_file_to_file(srv, con, p,
+ con->physical.path, sce, compression_type)) {
+ buffer *mtime;
+
+ response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name));
+
+ mtime = strftime_cache_get(srv, sce->st.st_mtime);
+ response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
- if (use_etag) {
- /* try matching etag of compressed version */
- buffer_copy_string_buffer(srv->tmp_buf, sce->etag);
- buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN("-"));
- buffer_append_string(srv->tmp_buf, compression_name);
- etag_mutate(con->physical.etag, srv->tmp_buf);
- }
+ etag_mutate(con->physical.etag, sce->etag);
+ response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
- if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) {
+ response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
+
+ return HANDLER_GO_ON;
+ }
+ } else if (0 == deflate_file_to_buffer(srv, con, p,
+ con->physical.path, sce, compression_type)) {
+
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name));
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
- response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
- if (use_etag) {
- response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
- }
+
return HANDLER_FINISHED;
}
-
- /* deflate it */
- if (use_etag && p->conf.compress_cache_dir->used) {
- if (0 != deflate_file_to_file(srv, con, p, con->physical.path, sce, compression_type))
- return HANDLER_GO_ON;
- } else {
- if (0 != deflate_file_to_buffer(srv, con, p, con->physical.path, sce, compression_type))
- return HANDLER_GO_ON;
- }
- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name));
- response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
- if (use_etag) {
- response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
- }
- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
- /* let mod_staticfile handle the cached compressed files, physical path was modified */
- return (use_etag && p->conf.compress_cache_dir->used) ? HANDLER_GO_ON : HANDLER_FINISHED;
+ break;
}
}
}
}
-
+
return HANDLER_GO_ON;
}
-int mod_compress_plugin_init(plugin *p);
int mod_compress_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("compress");
-
+
p->init = mod_compress_init;
p->set_defaults = mod_compress_setdefaults;
p->handle_subrequest_start = mod_compress_physical;
p->cleanup = mod_compress_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_dirlisting.c b/src/mod_dirlisting.c
index cd317ec..9b06fdb 100644
--- a/src/mod_dirlisting.c
+++ b/src/mod_dirlisting.c
@@ -1,13 +1,3 @@
-#include "base.h"
-#include "log.h"
-#include "buffer.h"
-
-#include "plugin.h"
-
-#include "response.h"
-#include "stat_cache.h"
-#include "stream.h"
-
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
@@ -18,6 +8,16 @@
#include <unistd.h>
#include <time.h>
+#include "base.h"
+#include "log.h"
+#include "buffer.h"
+
+#include "plugin.h"
+
+#include "response.h"
+#include "stat_cache.h"
+#include "stream.h"
+
/**
* this is a dirlisting for a lighttpd plugin
*/
@@ -31,8 +31,6 @@
#include <attr/attributes.h>
#endif
-#include "version.h"
-
/* plugin config for all request/connections */
typedef struct {
@@ -53,32 +51,24 @@ typedef struct {
unsigned short dir_listing;
unsigned short hide_dot_files;
unsigned short show_readme;
- unsigned short hide_readme_file;
- unsigned short encode_readme;
- unsigned short show_header;
- unsigned short hide_header_file;
- unsigned short encode_header;
- unsigned short auto_layout;
-
+
excludes_buffer *excludes;
buffer *external_css;
buffer *encoding;
- buffer *set_footer;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
buffer *tmp_buf;
- buffer *content_charset;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
-static excludes_buffer *excludes_buffer_init(void) {
+excludes_buffer *excludes_buffer_init(void) {
excludes_buffer *exb;
exb = calloc(1, sizeof(*exb));
@@ -86,7 +76,7 @@ static excludes_buffer *excludes_buffer_init(void) {
return exb;
}
-static int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
+int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
#ifdef HAVE_PCRE_H
size_t i;
const char *errptr;
@@ -133,7 +123,7 @@ static int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
#endif
}
-static void excludes_buffer_free(excludes_buffer *exb) {
+void excludes_buffer_free(excludes_buffer *exb) {
#ifdef HAVE_PCRE_H
size_t i;
@@ -152,45 +142,41 @@ static void excludes_buffer_free(excludes_buffer *exb) {
/* init the plugin data */
INIT_FUNC(mod_dirlisting_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
p->tmp_buf = buffer_init();
- p->content_charset = buffer_init();
-
+
return p;
}
/* detroy the plugin data */
FREE_FUNC(mod_dirlisting_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
if (!s) continue;
-
+
excludes_buffer_free(s->excludes);
buffer_free(s->external_css);
buffer_free(s->encoding);
- buffer_free(s->set_footer);
-
+
free(s);
}
free(p->config_storage);
}
-
+
buffer_free(p->tmp_buf);
- buffer_free(p->content_charset);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -198,7 +184,7 @@ static int parse_config_entry(server *srv, plugin_config *s, array *ca, const ch
data_unset *du;
if (NULL != (du = array_get_element(ca, option))) {
- data_array *da;
+ data_array *da = (data_array *)du;
size_t j;
if (du->type != TYPE_ARRAY) {
@@ -222,10 +208,10 @@ static int parse_config_entry(server *srv, plugin_config *s, array *ca, const ch
if (0 != excludes_buffer_append(s->excludes,
((data_string *)(da->value->data[j]))->value)) {
#ifdef HAVE_PCRE_H
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"pcre-compile failed for", ((data_string *)(da->value->data[j]))->value);
#else
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"pcre support is missing, please install libpcre and the headers");
#endif
}
@@ -237,83 +223,45 @@ static int parse_config_entry(server *srv, plugin_config *s, array *ca, const ch
/* handle plugin config and check values */
-#define CONFIG_EXCLUDE "dir-listing.exclude"
-#define CONFIG_ACTIVATE "dir-listing.activate"
-#define CONFIG_HIDE_DOTFILES "dir-listing.hide-dotfiles"
-#define CONFIG_EXTERNAL_CSS "dir-listing.external-css"
-#define CONFIG_ENCODING "dir-listing.encoding"
-#define CONFIG_SHOW_README "dir-listing.show-readme"
-#define CONFIG_HIDE_README_FILE "dir-listing.hide-readme-file"
-#define CONFIG_SHOW_HEADER "dir-listing.show-header"
-#define CONFIG_HIDE_HEADER_FILE "dir-listing.hide-header-file"
-#define CONFIG_DIR_LISTING "server.dir-listing"
-#define CONFIG_SET_FOOTER "dir-listing.set-footer"
-#define CONFIG_ENCODE_README "dir-listing.encode-readme"
-#define CONFIG_ENCODE_HEADER "dir-listing.encode-header"
-#define CONFIG_AUTO_LAYOUT "dir-listing.auto-layout"
-
-
SETDEFAULTS_FUNC(mod_dirlisting_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
- { CONFIG_EXCLUDE, NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { CONFIG_ACTIVATE, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
- { CONFIG_HIDE_DOTFILES, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
- { CONFIG_EXTERNAL_CSS, NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
- { CONFIG_ENCODING, NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 4 */
- { CONFIG_SHOW_README, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
- { CONFIG_HIDE_README_FILE, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 6 */
- { CONFIG_SHOW_HEADER, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
- { CONFIG_HIDE_HEADER_FILE, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
- { CONFIG_DIR_LISTING, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
- { CONFIG_SET_FOOTER, NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
- { CONFIG_ENCODE_README, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
- { CONFIG_ENCODE_HEADER, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
- { CONFIG_AUTO_LAYOUT, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
-
+
+ config_values_t cv[] = {
+ { "dir-listing.exclude", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
+ { "dir-listing.activate", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
+ { "dir-listing.hide-dotfiles", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
+ { "dir-listing.external-css", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
+ { "dir-listing.encoding", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 4 */
+ { "dir-listing.show-readme", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
+ { "server.dir-listing", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 6 */
+
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
array *ca;
-
+
s = calloc(1, sizeof(plugin_config));
s->excludes = excludes_buffer_init();
s->dir_listing = 0;
s->external_css = buffer_init();
s->hide_dot_files = 0;
s->show_readme = 0;
- s->hide_readme_file = 0;
- s->show_header = 0;
- s->hide_header_file = 0;
- s->encode_readme = 1;
- s->encode_header = 1;
- s->auto_layout = 1;
-
s->encoding = buffer_init();
- s->set_footer = buffer_init();
-
+
cv[0].destination = s->excludes;
cv[1].destination = &(s->dir_listing);
cv[2].destination = &(s->hide_dot_files);
cv[3].destination = s->external_css;
cv[4].destination = s->encoding;
cv[5].destination = &(s->show_readme);
- cv[6].destination = &(s->hide_readme_file);
- cv[7].destination = &(s->show_header);
- cv[8].destination = &(s->hide_header_file);
- cv[9].destination = &(s->dir_listing); /* old name */
- cv[10].destination = s->set_footer;
- cv[11].destination = &(s->encode_readme);
- cv[12].destination = &(s->encode_header);
- cv[13].destination = &(s->auto_layout);
+ cv[6].destination = &(s->dir_listing); /* old name */
p->config_storage[i] = s;
ca = ((data_config *)srv->config_context->data[i])->value;
@@ -322,7 +270,7 @@ SETDEFAULTS_FUNC(mod_dirlisting_set_defaults) {
return HANDLER_ERROR;
}
- parse_config_entry(srv, s, ca, CONFIG_EXCLUDE);
+ parse_config_entry(srv, s, ca, "dir-listing.exclude");
}
return HANDLER_GO_ON;
@@ -339,58 +287,37 @@ static int mod_dirlisting_patch_connection(server *srv, connection *con, plugin_
PATCH(hide_dot_files);
PATCH(encoding);
PATCH(show_readme);
- PATCH(hide_readme_file);
- PATCH(show_header);
- PATCH(hide_header_file);
PATCH(excludes);
- PATCH(set_footer);
- PATCH(encode_readme);
- PATCH(encode_header);
- PATCH(auto_layout);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
- if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_ACTIVATE)) ||
- buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_DIR_LISTING))) {
+
+ if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.activate")) ||
+ buffer_is_equal_string(du->key, CONST_STR_LEN("server.dir-listing"))) {
PATCH(dir_listing);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_HIDE_DOTFILES))) {
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.hide-dotfiles"))) {
PATCH(hide_dot_files);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_EXTERNAL_CSS))) {
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.external-css"))) {
PATCH(external_css);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_ENCODING))) {
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.encoding"))) {
PATCH(encoding);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_SHOW_README))) {
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.show-readme"))) {
PATCH(show_readme);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_HIDE_README_FILE))) {
- PATCH(hide_readme_file);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_SHOW_HEADER))) {
- PATCH(show_header);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_HIDE_HEADER_FILE))) {
- PATCH(hide_header_file);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_SET_FOOTER))) {
- PATCH(set_footer);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_EXCLUDE))) {
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.excludes"))) {
PATCH(excludes);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_ENCODE_README))) {
- PATCH(encode_readme);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_ENCODE_HEADER))) {
- PATCH(encode_header);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_AUTO_LAYOUT))) {
- PATCH(auto_layout);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -469,7 +396,7 @@ static int http_list_directory_sizefmt(char *buf, off_t size) {
u++;
}
- out += LI_ltostr(out, size);
+ out += ltostr(out, size);
out[0] = '.';
out[1] = remain + '0';
out[2] = *u;
@@ -480,87 +407,66 @@ static int http_list_directory_sizefmt(char *buf, off_t size) {
static void http_list_directory_header(server *srv, connection *con, plugin_data *p, buffer *out) {
UNUSED(srv);
-
- if (p->conf.auto_layout) {
- buffer_append_string_len(out, CONST_STR_LEN(
- "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
- "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n"
- "<head>\n"
- "<title>Index of "
- ));
- buffer_append_string_encoded(out, CONST_BUF_LEN(con->uri.path), ENCODING_MINIMAL_XML);
- buffer_append_string_len(out, CONST_STR_LEN("</title>\n"));
-
- if (p->conf.external_css->used > 1) {
- buffer_append_string_len(out, CONST_STR_LEN("<link rel=\"stylesheet\" type=\"text/css\" href=\""));
- buffer_append_string_buffer(out, p->conf.external_css);
- buffer_append_string_len(out, CONST_STR_LEN("\" />\n"));
- } else {
- buffer_append_string_len(out, CONST_STR_LEN(
- "<style type=\"text/css\">\n"
- "a, a:active {text-decoration: none; color: blue;}\n"
- "a:visited {color: #48468F;}\n"
- "a:hover, a:focus {text-decoration: underline; color: red;}\n"
- "body {background-color: #F5F5F5;}\n"
- "h2 {margin-bottom: 12px;}\n"
- "table {margin-left: 12px;}\n"
- "th, td {"
- " font: 90% monospace;"
- " text-align: left;"
- "}\n"
- "th {"
- " font-weight: bold;"
- " padding-right: 14px;"
- " padding-bottom: 3px;"
- "}\n"
- "td {padding-right: 14px;}\n"
- "td.s, th.s {text-align: right;}\n"
- "div.list {"
- " background-color: white;"
- " border-top: 1px solid #646464;"
- " border-bottom: 1px solid #646464;"
- " padding-top: 10px;"
- " padding-bottom: 14px;"
- "}\n"
- "div.foot {"
- " font: 90% monospace;"
- " color: #787878;"
- " padding-top: 4px;"
- "}\n"
- "</style>\n"
- ));
- }
-
- buffer_append_string_len(out, CONST_STR_LEN("</head>\n<body>\n"));
- }
-
- /* HEADER.txt */
- if (p->conf.show_header) {
- stream s;
- /* if we have a HEADER file, display it in <pre class="header"></pre> */
-
- buffer_copy_string_buffer(p->tmp_buf, con->physical.path);
- BUFFER_APPEND_SLASH(p->tmp_buf);
- buffer_append_string_len(p->tmp_buf, CONST_STR_LEN("HEADER.txt"));
-
- if (-1 != stream_open(&s, p->tmp_buf)) {
- if (p->conf.encode_header) {
- buffer_append_string_len(out, CONST_STR_LEN("<pre class=\"header\">"));
- buffer_append_string_encoded(out, s.start, s.size, ENCODING_MINIMAL_XML);
- buffer_append_string_len(out, CONST_STR_LEN("</pre>"));
- } else {
- buffer_append_string_len(out, s.start, s.size);
- }
- }
- stream_close(&s);
+
+ BUFFER_APPEND_STRING_CONST(out,
+ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n"
+ "<head>\n"
+ "<title>Index of "
+ );
+ buffer_append_string_encoded(out, CONST_BUF_LEN(con->uri.path), ENCODING_HTML);
+ BUFFER_APPEND_STRING_CONST(out, "</title>\n");
+
+ if (p->conf.external_css->used > 1) {
+ BUFFER_APPEND_STRING_CONST(out, "<link rel=\"stylesheet\" type=\"text/css\" href=\"");
+ buffer_append_string_buffer(out, p->conf.external_css);
+ BUFFER_APPEND_STRING_CONST(out, "\" />\n");
+ } else {
+ BUFFER_APPEND_STRING_CONST(out,
+ "<style type=\"text/css\">\n"
+ "a, a:active {text-decoration: none; color: blue;}\n"
+ "a:visited {color: #48468F;}\n"
+ "a:hover, a:focus {text-decoration: underline; color: red;}\n"
+ "body {background-color: #F5F5F5;}\n"
+ "h2 {margin-bottom: 12px;}\n"
+ "table {margin-left: 12px;}\n"
+ "th, td {"
+ " font-family: \"Courier New\", Courier, monospace;"
+ " font-size: 10pt;"
+ " text-align: left;"
+ "}\n"
+ "th {"
+ " font-weight: bold;"
+ " padding-right: 14px;"
+ " padding-bottom: 3px;"
+ "}\n"
+ );
+ BUFFER_APPEND_STRING_CONST(out,
+ "td {padding-right: 14px;}\n"
+ "td.s, th.s {text-align: right;}\n"
+ "div.list {"
+ " background-color: white;"
+ " border-top: 1px solid #646464;"
+ " border-bottom: 1px solid #646464;"
+ " padding-top: 10px;"
+ " padding-bottom: 14px;"
+ "}\n"
+ "div.foot {"
+ " font-family: \"Courier New\", Courier, monospace;"
+ " font-size: 10pt;"
+ " color: #787878;"
+ " padding-top: 4px;"
+ "}\n"
+ "</style>\n"
+ );
}
- buffer_append_string_len(out, CONST_STR_LEN("<h2>Index of "));
- buffer_append_string_encoded(out, CONST_BUF_LEN(con->uri.path), ENCODING_MINIMAL_XML);
- buffer_append_string_len(out, CONST_STR_LEN(
+ BUFFER_APPEND_STRING_CONST(out, "</head>\n<body>\n<h2>Index of ");
+ buffer_append_string_encoded(out, CONST_BUF_LEN(con->uri.path), ENCODING_HTML);
+ BUFFER_APPEND_STRING_CONST(out,
"</h2>\n"
"<div class=\"list\">\n"
- "<table summary=\"Directory Listing\" cellpadding=\"0\" cellspacing=\"0\">\n"
+ "<table cellpadding=\"0\" cellspacing=\"0\">\n"
"<thead>"
"<tr>"
"<th class=\"n\">Name</th>"
@@ -576,57 +482,49 @@ static void http_list_directory_header(server *srv, connection *con, plugin_data
"<td class=\"s\">- &nbsp;</td>"
"<td class=\"t\">Directory</td>"
"</tr>\n"
- ));
+ );
}
static void http_list_directory_footer(server *srv, connection *con, plugin_data *p, buffer *out) {
UNUSED(srv);
-
- buffer_append_string_len(out, CONST_STR_LEN(
+
+ BUFFER_APPEND_STRING_CONST(out,
"</tbody>\n"
"</table>\n"
"</div>\n"
- ));
-
+ );
+
if (p->conf.show_readme) {
stream s;
/* if we have a README file, display it in <pre class="readme"></pre> */
-
+
buffer_copy_string_buffer(p->tmp_buf, con->physical.path);
BUFFER_APPEND_SLASH(p->tmp_buf);
- buffer_append_string_len(p->tmp_buf, CONST_STR_LEN("README.txt"));
-
+ BUFFER_APPEND_STRING_CONST(p->tmp_buf, "README.txt");
+
if (-1 != stream_open(&s, p->tmp_buf)) {
- if (p->conf.encode_readme) {
- buffer_append_string_len(out, CONST_STR_LEN("<pre class=\"readme\">"));
- buffer_append_string_encoded(out, s.start, s.size, ENCODING_MINIMAL_XML);
- buffer_append_string_len(out, CONST_STR_LEN("</pre>"));
- } else {
- buffer_append_string_len(out, s.start, s.size);
- }
+ BUFFER_APPEND_STRING_CONST(out, "<pre class=\"readme\">");
+ buffer_append_string_encoded(out, s.start, s.size, ENCODING_HTML);
+ BUFFER_APPEND_STRING_CONST(out, "</pre>");
}
stream_close(&s);
}
+
+ BUFFER_APPEND_STRING_CONST(out,
+ "<div class=\"foot\">"
+ );
- if(p->conf.auto_layout) {
- buffer_append_string_len(out, CONST_STR_LEN(
- "<div class=\"foot\">"
- ));
-
- if (p->conf.set_footer->used > 1) {
- buffer_append_string_buffer(out, p->conf.set_footer);
- } else if (buffer_is_empty(con->conf.server_tag)) {
- buffer_append_string_len(out, CONST_STR_LEN(PACKAGE_DESC));
- } else {
- buffer_append_string_buffer(out, con->conf.server_tag);
- }
-
- buffer_append_string_len(out, CONST_STR_LEN(
- "</div>\n"
- "</body>\n"
- "</html>\n"
- ));
+ if (buffer_is_empty(con->conf.server_tag)) {
+ BUFFER_APPEND_STRING_CONST(out, PACKAGE_NAME "/" PACKAGE_VERSION);
+ } else {
+ buffer_append_string_buffer(out, con->conf.server_tag);
}
+
+ BUFFER_APPEND_STRING_CONST(out,
+ "</div>\n"
+ "</body>\n"
+ "</html>\n"
+ );
}
static int http_list_directory(server *srv, connection *con, plugin_data *p, buffer *dir) {
@@ -653,16 +551,15 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
#endif
if (dir->used == 0) return -1;
-
+
i = dir->used - 1;
#ifdef HAVE_PATHCONF
- if (0 >= (name_max = pathconf(dir->ptr, _PC_NAME_MAX))) {
- /* some broken fs (fuse) return 0 instead of -1 */
+ if (-1 == (name_max = pathconf(dir->ptr, _PC_NAME_MAX))) {
#ifdef NAME_MAX
name_max = NAME_MAX;
#else
- name_max = 255; /* stupid default */
+ name_max = 256; /* stupid default */
#endif
}
#elif defined __WIN32
@@ -670,14 +567,14 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
#else
name_max = NAME_MAX;
#endif
-
+
path = malloc(dir->used + name_max);
assert(path);
strcpy(path, dir->ptr);
path_file = path + i;
if (NULL == (dp = opendir(path))) {
- log_error_write(srv, __FILE__, __LINE__, "sbs",
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
"opendir failed:", dir, strerror(errno));
free(path);
@@ -692,7 +589,7 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
assert(files.ent);
files.size = DIRLIST_BLOB_SIZE;
files.used = 0;
-
+
while ((dent = readdir(dp)) != NULL) {
unsigned short exclude_match = 0;
@@ -705,15 +602,6 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
continue;
}
- if (p->conf.hide_readme_file) {
- if (strcmp(dent->d_name, "README.txt") == 0)
- continue;
- }
- if (p->conf.hide_header_file) {
- if (strcmp(dent->d_name, "HEADER.txt") == 0)
- continue;
- }
-
/* compare d_name against excludes array
* elements, skipping any that match.
*/
@@ -745,12 +633,12 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
#endif
i = strlen(dent->d_name);
-
+
/* NOTE: the manual says, d_name is never more than NAME_MAX
* so this should actually not be a buffer-overflow-risk
*/
if (i > (size_t)name_max) continue;
-
+
memcpy(path_file, dent->d_name, i + 1);
if (stat(path, &st) != 0)
continue;
@@ -780,13 +668,13 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
if (files.used) http_dirls_sort(files.ent, files.used);
out = chunkqueue_get_append_buffer(con->write_queue);
- buffer_copy_string_len(out, CONST_STR_LEN("<?xml version=\"1.0\" encoding=\""));
+ BUFFER_COPY_STRING_CONST(out, "<?xml version=\"1.0\" encoding=\"");
if (buffer_is_empty(p->conf.encoding)) {
- buffer_append_string_len(out, CONST_STR_LEN("iso-8859-1"));
+ BUFFER_APPEND_STRING_CONST(out, "iso-8859-1");
} else {
buffer_append_string_buffer(out, p->conf.encoding);
}
- buffer_append_string_len(out, CONST_STR_LEN("\"?>\n"));
+ BUFFER_APPEND_STRING_CONST(out, "\"?>\n");
http_list_directory_header(srv, con, p, out);
/* directories */
@@ -799,14 +687,14 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
#else
strftime(datebuf, sizeof(datebuf), "%Y-%b-%d %H:%M:%S", localtime(&(tmp->mtime)));
#endif
-
- buffer_append_string_len(out, CONST_STR_LEN("<tr><td class=\"n\"><a href=\""));
+
+ BUFFER_APPEND_STRING_CONST(out, "<tr><td class=\"n\"><a href=\"");
buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_REL_URI_PART);
- buffer_append_string_len(out, CONST_STR_LEN("/\">"));
- buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_MINIMAL_XML);
- buffer_append_string_len(out, CONST_STR_LEN("</a>/</td><td class=\"m\">"));
+ BUFFER_APPEND_STRING_CONST(out, "/\">");
+ buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_HTML);
+ BUFFER_APPEND_STRING_CONST(out, "</a>/</td><td class=\"m\">");
buffer_append_string_len(out, datebuf, sizeof(datebuf) - 1);
- buffer_append_string_len(out, CONST_STR_LEN("</td><td class=\"s\">- &nbsp;</td><td class=\"t\">Directory</td></tr>\n"));
+ BUFFER_APPEND_STRING_CONST(out, "</td><td class=\"s\">- &nbsp;</td><td class=\"t\">Directory</td></tr>\n");
free(tmp);
}
@@ -817,7 +705,7 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
content_type = NULL;
#ifdef HAVE_XATTR
-
+
if (con->conf.use_xattr) {
memcpy(path_file, DIRLIST_ENT_NAME(tmp), tmp->namelen + 1);
attrlen = sizeof(attrval) - 1;
@@ -827,7 +715,7 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
}
}
#endif
-
+
if (content_type == NULL) {
content_type = "application/octet-stream";
for (k = 0; k < con->conf.mimetypes->used; k++) {
@@ -847,7 +735,7 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
}
}
}
-
+
#ifdef HAVE_LOCALTIME_R
localtime_r(&(tmp->mtime), &tm);
strftime(datebuf, sizeof(datebuf), "%Y-%b-%d %H:%M:%S", &tm);
@@ -856,17 +744,17 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
#endif
http_list_directory_sizefmt(sizebuf, tmp->size);
- buffer_append_string_len(out, CONST_STR_LEN("<tr><td class=\"n\"><a href=\""));
+ BUFFER_APPEND_STRING_CONST(out, "<tr><td class=\"n\"><a href=\"");
buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_REL_URI_PART);
- buffer_append_string_len(out, CONST_STR_LEN("\">"));
- buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_MINIMAL_XML);
- buffer_append_string_len(out, CONST_STR_LEN("</a></td><td class=\"m\">"));
+ BUFFER_APPEND_STRING_CONST(out, "\">");
+ buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_HTML);
+ BUFFER_APPEND_STRING_CONST(out, "</a></td><td class=\"m\">");
buffer_append_string_len(out, datebuf, sizeof(datebuf) - 1);
- buffer_append_string_len(out, CONST_STR_LEN("</td><td class=\"s\">"));
+ BUFFER_APPEND_STRING_CONST(out, "</td><td class=\"s\">");
buffer_append_string(out, sizebuf);
- buffer_append_string_len(out, CONST_STR_LEN("</td><td class=\"t\">"));
+ BUFFER_APPEND_STRING_CONST(out, "</td><td class=\"t\">");
buffer_append_string(out, content_type);
- buffer_append_string_len(out, CONST_STR_LEN("</td></tr>\n"));
+ BUFFER_APPEND_STRING_CONST(out, "</td></tr>\n");
free(tmp);
}
@@ -876,16 +764,7 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
free(path);
http_list_directory_footer(srv, con, p, out);
-
- /* Insert possible charset to Content-Type */
- if (buffer_is_empty(p->conf.encoding)) {
- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
- } else {
- buffer_copy_string_len(p->content_charset, CONST_STR_LEN("text/html; charset="));
- buffer_append_string_buffer(p->content_charset, p->conf.encoding);
- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(p->content_charset));
- }
-
+ response_header_insert(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
con->file_finished = 1;
return 0;
@@ -896,65 +775,52 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
URIHANDLER_FUNC(mod_dirlisting_subrequest) {
plugin_data *p = p_d;
stat_cache_entry *sce = NULL;
-
+
UNUSED(srv);
-
- /* we only handle GET, POST and HEAD */
- switch(con->request.http_method) {
- case HTTP_METHOD_GET:
- case HTTP_METHOD_POST:
- case HTTP_METHOD_HEAD:
- break;
- default:
- return HANDLER_GO_ON;
- }
-
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
+
if (con->physical.path->used == 0) return HANDLER_GO_ON;
if (con->uri.path->used == 0) return HANDLER_GO_ON;
if (con->uri.path->ptr[con->uri.path->used - 2] != '/') return HANDLER_GO_ON;
-
+
mod_dirlisting_patch_connection(srv, con, p);
if (!p->conf.dir_listing) return HANDLER_GO_ON;
-
+
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- handling the request as Dir-Listing");
log_error_write(srv, __FILE__, __LINE__, "sb", "URI :", con->uri.path);
}
-
+
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
- log_error_write(srv, __FILE__, __LINE__, "SB", "stat_cache_get_entry failed: ", con->physical.path);
+ fprintf(stderr, "%s.%d: %s\n", __FILE__, __LINE__, con->physical.path->ptr);
SEGFAULT();
}
-
+
if (!S_ISDIR(sce->st.st_mode)) return HANDLER_GO_ON;
-
+
if (http_list_directory(srv, con, p, con->physical.path)) {
/* dirlisting failed */
con->http_status = 403;
}
-
+
buffer_reset(con->physical.path);
-
+
/* not found */
return HANDLER_FINISHED;
}
/* this function is called at dlopen() time and inits the callbacks */
-int mod_dirlisting_plugin_init(plugin *p);
int mod_dirlisting_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("dirlisting");
-
+
p->init = mod_dirlisting_init;
p->handle_subrequest_start = mod_dirlisting_subrequest;
p->set_defaults = mod_dirlisting_set_defaults;
p->cleanup = mod_dirlisting_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_evasive.c b/src/mod_evasive.c
deleted file mode 100644
index 2907053..0000000
--- a/src/mod_evasive.c
+++ /dev/null
@@ -1,211 +0,0 @@
-#include "base.h"
-#include "log.h"
-#include "buffer.h"
-
-#include "plugin.h"
-
-#include "inet_ntop_cache.h"
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
-/**
- * mod_evasive
- *
- * we indent to implement all features the mod_evasive from apache has
- *
- * - limit of connections per IP
- * - provide a list of block-listed ip/networks (no access)
- * - provide a white-list of ips/network which is not affected by the limit
- * (hmm, conditionals might be enough)
- * - provide a bandwidth limiter per IP
- *
- * started by:
- * - w1zzard@techpowerup.com
- */
-
-typedef struct {
- unsigned short max_conns;
- unsigned short silent;
-} plugin_config;
-
-typedef struct {
- PLUGIN_DATA;
-
- plugin_config **config_storage;
-
- plugin_config conf;
-} plugin_data;
-
-INIT_FUNC(mod_evasive_init) {
- plugin_data *p;
-
- p = calloc(1, sizeof(*p));
-
- return p;
-}
-
-FREE_FUNC(mod_evasive_free) {
- plugin_data *p = p_d;
-
- UNUSED(srv);
-
- if (!p) return HANDLER_GO_ON;
-
- if (p->config_storage) {
- size_t i;
- for (i = 0; i < srv->config_context->used; i++) {
- plugin_config *s = p->config_storage[i];
-
- free(s);
- }
- free(p->config_storage);
- }
-
- free(p);
-
- return HANDLER_GO_ON;
-}
-
-SETDEFAULTS_FUNC(mod_evasive_set_defaults) {
- plugin_data *p = p_d;
- size_t i = 0;
-
- config_values_t cv[] = {
- { "evasive.max-conns-per-ip", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { "evasive.silent", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
- { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
- };
-
- p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
- for (i = 0; i < srv->config_context->used; i++) {
- plugin_config *s;
-
- s = calloc(1, sizeof(plugin_config));
- s->max_conns = 0;
- s->silent = 0;
-
- cv[0].destination = &(s->max_conns);
- cv[1].destination = &(s->silent);
-
- p->config_storage[i] = s;
-
- if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
- return HANDLER_ERROR;
- }
- }
-
- return HANDLER_GO_ON;
-}
-
-#define PATCH(x) \
- p->conf.x = s->x;
-static int mod_evasive_patch_connection(server *srv, connection *con, plugin_data *p) {
- size_t i, j;
- plugin_config *s = p->config_storage[0];
-
- PATCH(max_conns);
- PATCH(silent);
-
- /* skip the first, the global context */
- for (i = 1; i < srv->config_context->used; i++) {
- data_config *dc = (data_config *)srv->config_context->data[i];
- s = p->config_storage[i];
-
- /* condition didn't match */
- if (!config_check_cond(srv, con, dc)) continue;
-
- /* merge config */
- for (j = 0; j < dc->value->used; j++) {
- data_unset *du = dc->value->data[j];
-
- if (buffer_is_equal_string(du->key, CONST_STR_LEN("evasive.max-conns-per-ip"))) {
- PATCH(max_conns);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("evasive.silent"))) {
- PATCH(silent);
- }
- }
- }
-
- return 0;
-}
-#undef PATCH
-
-URIHANDLER_FUNC(mod_evasive_uri_handler) {
- plugin_data *p = p_d;
- size_t conns_by_ip = 0;
- size_t j;
-
- if (con->uri.path->used == 0) return HANDLER_GO_ON;
-
- mod_evasive_patch_connection(srv, con, p);
-
- /* no limit set, nothing to block */
- if (p->conf.max_conns == 0) return HANDLER_GO_ON;
-
- switch (con->dst_addr.plain.sa_family) {
- case AF_INET:
-#ifdef HAVE_IPV6
- case AF_INET6:
-#endif
- break;
- default: /* Address family not supported */
- return HANDLER_GO_ON;
- };
-
- for (j = 0; j < srv->conns->used; j++) {
- connection *c = srv->conns->ptr[j];
-
- /* check if other connections are already actively serving data for the same IP
- * we can only ban connections which are already behind the 'read request' state
- * */
- if (c->dst_addr.plain.sa_family != con->dst_addr.plain.sa_family) continue;
- if (c->state <= CON_STATE_REQUEST_END) continue;
-
- switch (con->dst_addr.plain.sa_family) {
- case AF_INET:
- if (c->dst_addr.ipv4.sin_addr.s_addr != con->dst_addr.ipv4.sin_addr.s_addr) continue;
- break;
-#ifdef HAVE_IPV6
- case AF_INET6:
- if (0 != memcmp(c->dst_addr.ipv6.sin6_addr.s6_addr, con->dst_addr.ipv6.sin6_addr.s6_addr, 16)) continue;
- break;
-#endif
- default: /* Address family not supported, should never be reached */
- continue;
- };
- conns_by_ip++;
-
- if (conns_by_ip > p->conf.max_conns) {
- if (!p->conf.silent) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- inet_ntop_cache_get_ip(srv, &(con->dst_addr)),
- "turned away. Too many connections.");
- }
-
- con->http_status = 403;
- con->mode = DIRECT;
- return HANDLER_FINISHED;
- }
- }
-
- return HANDLER_GO_ON;
-}
-
-
-int mod_evasive_plugin_init(plugin *p);
-int mod_evasive_plugin_init(plugin *p) {
- p->version = LIGHTTPD_VERSION_ID;
- p->name = buffer_init_string("evasive");
-
- p->init = mod_evasive_init;
- p->set_defaults = mod_evasive_set_defaults;
- p->handle_uri_clean = mod_evasive_uri_handler;
- p->cleanup = mod_evasive_free;
-
- p->data = NULL;
-
- return 0;
-}
diff --git a/src/mod_evhost.c b/src/mod_evhost.c
index 7aabf6e..bc8adb6 100644
--- a/src/mod_evhost.c
+++ b/src/mod_evhost.c
@@ -1,16 +1,16 @@
+#include <string.h>
+#include <errno.h>
+#include <ctype.h>
+
#include "plugin.h"
#include "log.h"
#include "response.h"
#include "stat_cache.h"
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-
typedef struct {
/* unparsed pieces */
buffer *path_pieces_raw;
-
+
/* pieces for path creation */
size_t len;
buffer **path_pieces;
@@ -21,14 +21,14 @@ typedef struct {
buffer *tmp_buf;
plugin_config **config_storage;
- plugin_config conf;
+ plugin_config conf;
} plugin_data;
INIT_FUNC(mod_evhost_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->tmp_buf = buffer_init();
return p;
@@ -36,34 +36,34 @@ INIT_FUNC(mod_evhost_init) {
FREE_FUNC(mod_evhost_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
-
+
if(s->path_pieces) {
size_t j;
for (j = 0; j < s->len; j++) {
buffer_free(s->path_pieces[j]);
}
-
+
free(s->path_pieces);
}
-
+
buffer_free(s->path_pieces_raw);
-
+
free(s);
}
free(p->config_storage);
}
-
+
buffer_free(p->tmp_buf);
free(p);
@@ -73,30 +73,30 @@ FREE_FUNC(mod_evhost_free) {
static void mod_evhost_parse_pattern(plugin_config *s) {
char *ptr = s->path_pieces_raw->ptr,*pos;
-
+
s->path_pieces = NULL;
-
+
for(pos=ptr;*ptr;ptr++) {
if(*ptr == '%') {
s->path_pieces = realloc(s->path_pieces,(s->len+2) * sizeof(*s->path_pieces));
s->path_pieces[s->len] = buffer_init();
s->path_pieces[s->len+1] = buffer_init();
-
+
buffer_copy_string_len(s->path_pieces[s->len],pos,ptr-pos);
pos = ptr + 2;
-
+
buffer_copy_string_len(s->path_pieces[s->len+1],ptr++,2);
-
+
s->len += 2;
}
}
-
+
if(*pos != '\0') {
s->path_pieces = realloc(s->path_pieces,(s->len+1) * sizeof(*s->path_pieces));
s->path_pieces[s->len] = buffer_init();
-
- buffer_copy_string_len(s->path_pieces[s->len],pos,ptr-pos);
-
+
+ buffer_append_memory(s->path_pieces[s->len],pos,ptr-pos);
+
s->len += 1;
}
}
@@ -104,9 +104,9 @@ static void mod_evhost_parse_pattern(plugin_config *s) {
SETDEFAULTS_FUNC(mod_evhost_set_defaults) {
plugin_data *p = p_d;
size_t i;
-
+
/**
- *
+ *
* #
* # define a pattern for the host url finding
* # %% => % sign
@@ -115,52 +115,50 @@ SETDEFAULTS_FUNC(mod_evhost_set_defaults) {
* # %2 => domain name without tld
* # %3 => subdomain 1 name
* # %4 => subdomain 2 name
- * # %_ => fqdn (without port info)
* #
* evhost.path-pattern = "/home/ckruse/dev/www/%3/htdocs/"
- *
+ *
*/
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "evhost.path-pattern", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->path_pieces_raw = buffer_init();
s->path_pieces = NULL;
s->len = 0;
-
+
cv[0].destination = s->path_pieces_raw;
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
-
+
if (s->path_pieces_raw->used != 0) {
mod_evhost_parse_pattern(s);
}
}
-
+
return HANDLER_GO_ON;
}
/**
- * assign the different parts of the domain to array-indezes (sub2.sub1.domain.tld)
- * - %0 - domain.tld
+ * assign the different parts of the domain to array-indezes
+ * - %0 - full hostname (authority w/o port)
* - %1 - tld
- * - %2 - domain
- * - %3 - sub1
- * - ...
+ * - %2 - domain.tld
+ * - %3 -
*/
static int mod_evhost_parse_host(connection *con,array *host) {
@@ -170,7 +168,7 @@ static int mod_evhost_parse_host(connection *con,array *host) {
int first = 1;
data_string *ds;
int i;
-
+
/* first, find the domain + tld */
for(;ptr > con->uri.authority->ptr;ptr--) {
if(*ptr == '.') {
@@ -181,45 +179,45 @@ static int mod_evhost_parse_host(connection *con,array *host) {
first = 1;
}
}
-
+
ds = data_string_init();
- buffer_copy_string_len(ds->key,CONST_STR_LEN("%0"));
-
+ buffer_copy_string(ds->key,"%0");
+
/* if we stopped at a dot, skip the dot */
if (*ptr == '.') ptr++;
buffer_copy_string_len(ds->value, ptr, colon-ptr);
-
+
array_insert_unique(host,(data_unset *)ds);
-
+
/* if the : is not the start of the authority, go on parsing the hostname */
-
+
if (colon != con->uri.authority->ptr) {
for(ptr = colon - 1, i = 1; ptr > con->uri.authority->ptr; ptr--) {
if(*ptr == '.') {
if (ptr != colon - 1) {
/* is something between the dots */
ds = data_string_init();
- buffer_copy_string_len(ds->key,CONST_STR_LEN("%"));
+ buffer_copy_string(ds->key,"%");
buffer_append_long(ds->key, i++);
buffer_copy_string_len(ds->value,ptr+1,colon-ptr-1);
-
+
array_insert_unique(host,(data_unset *)ds);
}
colon = ptr;
}
}
-
+
/* if the . is not the first charactor of the hostname */
if (colon != ptr) {
ds = data_string_init();
- buffer_copy_string_len(ds->key,CONST_STR_LEN("%"));
- buffer_append_long(ds->key, i /* ++ */);
+ buffer_copy_string(ds->key,"%");
+ buffer_append_long(ds->key, i++);
buffer_copy_string_len(ds->value,ptr,colon-ptr);
-
+
array_insert_unique(host,(data_unset *)ds);
}
}
-
+
return 0;
}
@@ -228,29 +226,29 @@ static int mod_evhost_parse_host(connection *con,array *host) {
static int mod_evhost_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(path_pieces);
PATCH(len);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("evhost.path-pattern"))) {
PATCH(path_pieces);
PATCH(len);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -263,42 +261,32 @@ static handler_t mod_evhost_uri_handler(server *srv, connection *con, void *p_d)
register char *ptr;
int not_good = 0;
stat_cache_entry *sce = NULL;
-
+
/* not authority set */
if (con->uri.authority->used == 0) return HANDLER_GO_ON;
-
+
mod_evhost_patch_connection(srv, con, p);
-
+
/* missing even default(global) conf */
if (0 == p->conf.len) {
return HANDLER_GO_ON;
}
parsed_host = array_init();
-
+
mod_evhost_parse_host(con, parsed_host);
-
+
/* build document-root */
buffer_reset(p->tmp_buf);
-
+
for (i = 0; i < p->conf.len; i++) {
ptr = p->conf.path_pieces[i]->ptr;
if (*ptr == '%') {
data_string *ds;
-
+
if (*(ptr+1) == '%') {
/* %% */
- buffer_append_string_len(p->tmp_buf,CONST_STR_LEN("%"));
- } else if (*(ptr+1) == '_' ) {
- /* %_ == full hostname */
- char *colon = strchr(con->uri.authority->ptr, ':');
-
- if(colon == NULL) {
- buffer_append_string_buffer(p->tmp_buf, con->uri.authority); /* adds fqdn */
- } else {
- /* strip the port out of the authority-part of the URI scheme */
- buffer_append_string_len(p->tmp_buf, con->uri.authority->ptr, colon - con->uri.authority->ptr); /* adds fqdn */
- }
+ BUFFER_APPEND_STRING_CONST(p->tmp_buf,"%");
} else if (NULL != (ds = (data_string *)array_get_element(parsed_host,p->conf.path_pieces[i]->ptr))) {
if (ds->value->used) {
buffer_append_string_buffer(p->tmp_buf,ds->value);
@@ -310,11 +298,11 @@ static handler_t mod_evhost_uri_handler(server *srv, connection *con, void *p_d)
buffer_append_string_buffer(p->tmp_buf,p->conf.path_pieces[i]);
}
}
-
+
BUFFER_APPEND_SLASH(p->tmp_buf);
-
+
array_free(parsed_host);
-
+
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, p->tmp_buf, &sce)) {
log_error_write(srv, __FILE__, __LINE__, "sb", strerror(errno), p->tmp_buf);
not_good = 1;
@@ -322,15 +310,14 @@ static handler_t mod_evhost_uri_handler(server *srv, connection *con, void *p_d)
log_error_write(srv, __FILE__, __LINE__, "sb", "not a directory:", p->tmp_buf);
not_good = 1;
}
-
+
if (!not_good) {
buffer_copy_string_buffer(con->physical.doc_root, p->tmp_buf);
}
-
+
return HANDLER_GO_ON;
}
-int mod_evhost_plugin_init(plugin *p);
int mod_evhost_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("evhost");
@@ -338,9 +325,9 @@ int mod_evhost_plugin_init(plugin *p) {
p->set_defaults = mod_evhost_set_defaults;
p->handle_docroot = mod_evhost_uri_handler;
p->cleanup = mod_evhost_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_expire.c b/src/mod_expire.c
index 734cb93..619b542 100644
--- a/src/mod_expire.c
+++ b/src/mod_expire.c
@@ -1,3 +1,8 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -6,14 +11,9 @@
#include "plugin.h"
#include "stat_cache.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
/**
- * this is a expire module for a lighttpd
- *
+ * this is a expire module for a lighttpd
+ *
* set 'Expires:' HTTP Headers on demand
*/
@@ -27,83 +27,80 @@ typedef struct {
typedef struct {
PLUGIN_DATA;
-
+
buffer *expire_tstmp;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
/* init the plugin data */
INIT_FUNC(mod_expire_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->expire_tstmp = buffer_init();
-
+
buffer_prepare_copy(p->expire_tstmp, 255);
-
+
return p;
}
/* detroy the plugin data */
FREE_FUNC(mod_expire_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
buffer_free(p->expire_tstmp);
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
- if (!s) continue;
-
+
array_free(s->expire_url);
+
free(s);
}
free(p->config_storage);
}
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
-static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, time_t *offset) {
+static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, int *offset) {
char *ts;
int type = -1;
- time_t retts = 0;
-
+ int retts = 0;
+
UNUSED(p);
- /*
+ /*
* parse
- *
- * '(access|now|modification) [plus] {<num> <type>}*'
- *
+ *
+ * '(access|modification) [plus] {<num> <type>}*'
+ *
* e.g. 'access 1 years'
*/
-
+
if (expire->used == 0) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"empty:");
return -1;
}
-
+
ts = expire->ptr;
-
+
if (0 == strncmp(ts, "access ", 7)) {
type = 0;
ts += 7;
- } else if (0 == strncmp(ts, "now ", 4)) {
- type = 0;
- ts += 4;
} else if (0 == strncmp(ts, "modification ", 13)) {
type = 1;
ts += 13;
@@ -113,47 +110,44 @@ static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, ti
"invalid <base>:", ts);
return -1;
}
-
+
if (0 == strncmp(ts, "plus ", 5)) {
/* skip the optional plus */
ts += 5;
}
-
- /* the rest is just <number> (years|months|weeks|days|hours|minutes|seconds) */
+
+ /* the rest is just <number> (years|months|days|hours|minutes|seconds) */
while (1) {
char *space, *err;
int num;
-
+
if (NULL == (space = strchr(ts, ' '))) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"missing space after <num>:", ts);
return -1;
}
-
+
num = strtol(ts, &err, 10);
if (*err != ' ') {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"missing <type> after <num>:", ts);
return -1;
}
-
+
ts = space + 1;
-
+
if (NULL != (space = strchr(ts, ' '))) {
int slen;
/* */
-
+
slen = space - ts;
-
- if (slen == 5 &&
+
+ if (slen == 5 &&
0 == strncmp(ts, "years", slen)) {
num *= 60 * 60 * 24 * 30 * 12;
} else if (slen == 6 &&
0 == strncmp(ts, "months", slen)) {
num *= 60 * 60 * 24 * 30;
- } else if (slen == 5 &&
- 0 == strncmp(ts, "weeks", slen)) {
- num *= 60 * 60 * 24 * 7;
} else if (slen == 4 &&
0 == strncmp(ts, "days", slen)) {
num *= 60 * 60 * 24;
@@ -167,21 +161,19 @@ static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, ti
0 == strncmp(ts, "seconds", slen)) {
num *= 1;
} else {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"unknown type:", ts);
return -1;
}
-
+
retts += num;
-
+
ts = space + 1;
} else {
if (0 == strcmp(ts, "years")) {
num *= 60 * 60 * 24 * 30 * 12;
} else if (0 == strcmp(ts, "months")) {
num *= 60 * 60 * 24 * 30;
- } else if (0 == strcmp(ts, "weeks")) {
- num *= 60 * 60 * 24 * 7;
} else if (0 == strcmp(ts, "days")) {
num *= 60 * 60 * 24;
} else if (0 == strcmp(ts, "hours")) {
@@ -191,19 +183,19 @@ static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, ti
} else if (0 == strcmp(ts, "seconds")) {
num *= 1;
} else {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"unknown type:", ts);
return -1;
}
-
+
retts += num;
-
+
break;
}
}
-
+
if (offset != NULL) *offset = retts;
-
+
return type;
}
@@ -213,43 +205,43 @@ static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, ti
SETDEFAULTS_FUNC(mod_expire_set_defaults) {
plugin_data *p = p_d;
size_t i = 0, k;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "expire.url", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->expire_url = array_init();
-
+
cv[0].destination = s->expire_url;
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
-
+
for (k = 0; k < s->expire_url->used; k++) {
data_string *ds = (data_string *)s->expire_url->data[k];
-
+
/* parse lines */
if (-1 == mod_expire_get_offset(srv, p, ds->value, NULL)) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"parsing expire.url failed:", ds->value);
return HANDLER_ERROR;
}
}
}
-
-
+
+
return HANDLER_GO_ON;
}
@@ -258,27 +250,27 @@ SETDEFAULTS_FUNC(mod_expire_set_defaults) {
static int mod_expire_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(expire_url);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("expire.url"))) {
PATCH(expire_url);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -287,84 +279,83 @@ URIHANDLER_FUNC(mod_expire_path_handler) {
plugin_data *p = p_d;
int s_len;
size_t k;
-
+
if (con->uri.path->used == 0) return HANDLER_GO_ON;
-
+
mod_expire_patch_connection(srv, con, p);
-
+
s_len = con->uri.path->used - 1;
-
+
for (k = 0; k < p->conf.expire_url->used; k++) {
data_string *ds = (data_string *)p->conf.expire_url->data[k];
int ct_len = ds->key->used - 1;
-
+
if (ct_len > s_len) continue;
if (ds->key->used == 0) continue;
-
+
if (0 == strncmp(con->uri.path->ptr, ds->key->ptr, ct_len)) {
- time_t ts, expires;
+ int ts;
+ time_t t;
size_t len;
stat_cache_entry *sce = NULL;
-
+
stat_cache_get_entry(srv, con, con->physical.path, &sce);
-
+
switch(mod_expire_get_offset(srv, p, ds->value, &ts)) {
case 0:
/* access */
- expires = (ts + srv->cur_ts);
+ t = (ts + srv->cur_ts);
break;
case 1:
/* modification */
-
- expires = (ts + sce->st.st_mtime);
+
+ t = (ts + sce->st.st_mtime);
break;
default:
/* -1 is handled at parse-time */
break;
}
-
- /* expires should be at least srv->cur_ts */
- if (expires < srv->cur_ts) expires = srv->cur_ts;
-
- if (0 == (len = strftime(p->expire_tstmp->ptr, p->expire_tstmp->size - 1,
- "%a, %d %b %Y %H:%M:%S GMT", gmtime(&(expires))))) {
+
+
+ if (0 == (len = strftime(p->expire_tstmp->ptr, p->expire_tstmp->size - 1,
+ "%a, %d %b %Y %H:%M:%S GMT", gmtime(&(t))))) {
/* could not set expire header, out of mem */
-
+
return HANDLER_GO_ON;
+
}
-
+
p->expire_tstmp->used = len + 1;
-
- /* HTTP/1.0 */
+
+ /* HTTP/1.0 */
response_header_overwrite(srv, con, CONST_STR_LEN("Expires"), CONST_BUF_LEN(p->expire_tstmp));
- /* HTTP/1.1 */
- buffer_copy_string_len(p->expire_tstmp, CONST_STR_LEN("max-age="));
- buffer_append_long(p->expire_tstmp, expires - srv->cur_ts); /* as expires >= srv->cur_ts the difference is >= 0 */
-
- response_header_append(srv, con, CONST_STR_LEN("Cache-Control"), CONST_BUF_LEN(p->expire_tstmp));
-
+ /* HTTP/1.1 */
+ buffer_copy_string(p->expire_tstmp, "max-age=");
+ buffer_append_long(p->expire_tstmp, ts);
+
+ response_header_overwrite(srv, con, CONST_STR_LEN("Cache-Control"), CONST_BUF_LEN(p->expire_tstmp));
+
return HANDLER_GO_ON;
}
}
-
+
/* not found */
return HANDLER_GO_ON;
}
/* this function is called at dlopen() time and inits the callbacks */
-int mod_expire_plugin_init(plugin *p);
int mod_expire_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("expire");
-
+
p->init = mod_expire_init;
p->handle_subrequest_start = mod_expire_path_handler;
p->set_defaults = mod_expire_set_defaults;
p->cleanup = mod_expire_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_extforward.c b/src/mod_extforward.c
deleted file mode 100644
index d63bbb4..0000000
--- a/src/mod_extforward.c
+++ /dev/null
@@ -1,517 +0,0 @@
-#include "base.h"
-#include "log.h"
-#include "buffer.h"
-
-#include "plugin.h"
-
-#include "inet_ntop_cache.h"
-#include "configfile.h"
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <netinet/in.h>
-#include <errno.h>
-
-/**
- * mod_extforward.c for lighttpd, by comman.kang <at> gmail <dot> com
- * extended, modified by Lionel Elie Mamane (LEM), lionel <at> mamane <dot> lu
- * support chained proxies by glen@delfi.ee, #1528
- *
- * Config example:
- *
- * Trust proxy 10.0.0.232 and 10.0.0.232
- * extforward.forwarder = ( "10.0.0.232" => "trust",
- * "10.0.0.233" => "trust" )
- *
- * Trust all proxies (NOT RECOMMENDED!)
- * extforward.forwarder = ( "all" => "trust")
- *
- * Note that "all" has precedence over specific entries,
- * so "all except" setups will not work.
- *
- * In case you have chained proxies, you can add all their IP's to the
- * config. However "all" has effect only on connecting IP, as the
- * X-Forwarded-For header can not be trusted.
- *
- * Note: The effect of this module is variable on $HTTP["remotip"] directives and
- * other module's remote ip dependent actions.
- * Things done by modules before we change the remoteip or after we reset it will match on the proxy's IP.
- * Things done in between these two moments will match on the real client's IP.
- * The moment things are done by a module depends on in which hook it does things and within the same hook
- * on whether they are before/after us in the module loading order
- * (order in the server.modules directive in the config file).
- *
- * Tested behaviours:
- *
- * mod_access: Will match on the real client.
- *
- * mod_accesslog:
- * In order to see the "real" ip address in access log ,
- * you'll have to load mod_extforward after mod_accesslog.
- * like this:
- *
- * server.modules = (
- * .....
- * mod_accesslog,
- * mod_extforward
- * )
- *
- * Known issues:
- * seems causing segfault with mod_ssl and $HTTP{"socket"} directives
- * LEM 2006.05.26: Fixed segfault $SERVER["socket"] directive. Untested with SSL.
- *
- * ChangeLog:
- * 2005.12.19 Initial Version
- * 2005.12.19 fixed conflict with conditional directives
- * 2006.05.26 LEM: IPv6 support
- * 2006.05.26 LEM: Fix a segfault with $SERVER["socket"] directive.
- * 2006.05.26 LEM: Run at uri_raw time, as we don't need to see the URI
- * In this manner, we run before mod_access and $HTTP["remoteip"] directives work!
- * 2006.05.26 LEM: Clean config_cond cache of tests whose result we probably change.
- */
-
-
-/* plugin config for all request/connections */
-
-typedef struct {
- array *forwarder;
- array *headers;
-} plugin_config;
-
-typedef struct {
- PLUGIN_DATA;
-
- plugin_config **config_storage;
-
- plugin_config conf;
-} plugin_data;
-
-
-/* context , used for restore remote ip */
-
-typedef struct {
- sock_addr saved_remote_addr;
- buffer *saved_remote_addr_buf;
-} handler_ctx;
-
-
-static handler_ctx * handler_ctx_init(sock_addr oldaddr, buffer *oldaddr_buf) {
- handler_ctx * hctx;
- hctx = calloc(1, sizeof(*hctx));
- hctx->saved_remote_addr = oldaddr;
- hctx->saved_remote_addr_buf = oldaddr_buf;
- return hctx;
-}
-
-static void handler_ctx_free(handler_ctx *hctx) {
- free(hctx);
-}
-
-/* init the plugin data */
-INIT_FUNC(mod_extforward_init) {
- plugin_data *p;
- p = calloc(1, sizeof(*p));
- return p;
-}
-
-/* destroy the plugin data */
-FREE_FUNC(mod_extforward_free) {
- plugin_data *p = p_d;
-
- UNUSED(srv);
-
- if (!p) return HANDLER_GO_ON;
-
- if (p->config_storage) {
- size_t i;
-
- for (i = 0; i < srv->config_context->used; i++) {
- plugin_config *s = p->config_storage[i];
-
- if (!s) continue;
-
- array_free(s->forwarder);
- array_free(s->headers);
-
- free(s);
- }
- free(p->config_storage);
- }
-
-
- free(p);
-
- return HANDLER_GO_ON;
-}
-
-/* handle plugin config and check values */
-
-SETDEFAULTS_FUNC(mod_extforward_set_defaults) {
- plugin_data *p = p_d;
- size_t i = 0;
-
- config_values_t cv[] = {
- { "extforward.forwarder", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { "extforward.headers", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
- { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
- };
-
- if (!p) return HANDLER_ERROR;
-
- p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
- for (i = 0; i < srv->config_context->used; i++) {
- plugin_config *s;
-
- s = calloc(1, sizeof(plugin_config));
- s->forwarder = array_init();
- s->headers = array_init();
-
- cv[0].destination = s->forwarder;
- cv[1].destination = s->headers;
-
- p->config_storage[i] = s;
-
- if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
- return HANDLER_ERROR;
- }
- }
-
- return HANDLER_GO_ON;
-}
-
-#define PATCH(x) \
- p->conf.x = s->x;
-static int mod_extforward_patch_connection(server *srv, connection *con, plugin_data *p) {
- size_t i, j;
- plugin_config *s = p->config_storage[0];
-
- PATCH(forwarder);
- PATCH(headers);
-
- /* skip the first, the global context */
- for (i = 1; i < srv->config_context->used; i++) {
- data_config *dc = (data_config *)srv->config_context->data[i];
- s = p->config_storage[i];
-
- /* condition didn't match */
- if (!config_check_cond(srv, con, dc)) continue;
-
- /* merge config */
- for (j = 0; j < dc->value->used; j++) {
- data_unset *du = dc->value->data[j];
-
- if (buffer_is_equal_string(du->key, CONST_STR_LEN("extforward.forwarder"))) {
- PATCH(forwarder);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("extforward.headers"))) {
- PATCH(headers);
- }
- }
- }
-
- return 0;
-}
-#undef PATCH
-
-
-static void put_string_into_array_len(array *ary, const char *str, int len)
-{
- data_string *tempdata;
- if (len == 0)
- return;
- tempdata = data_string_init();
- buffer_copy_string_len(tempdata->value,str,len);
- array_insert_unique(ary,(data_unset *)tempdata);
-}
-/*
- extract a forward array from the environment
-*/
-static array *extract_forward_array(buffer *pbuffer)
-{
- array *result = array_init();
- if (pbuffer->used > 0) {
- char *base, *curr;
- /* state variable, 0 means not in string, 1 means in string */
- int in_str = 0;
- for (base = pbuffer->ptr, curr = pbuffer->ptr; *curr; curr++) {
- if (in_str) {
- if ((*curr > '9' || *curr < '0') && *curr != '.' && *curr != ':' && (*curr < 'a' || *curr > 'f') && (*curr < 'A' || *curr > 'F')) {
- /* found an separator , insert value into result array */
- put_string_into_array_len(result, base, curr - base);
- /* change state to not in string */
- in_str = 0;
- }
- } else {
- if ((*curr >= '0' && *curr <= '9') || *curr == ':' || (*curr >= 'a' && *curr <= 'f') || (*curr >= 'A' && *curr <= 'F')) {
- /* found leading char of an IP address, move base pointer and change state */
- base = curr;
- in_str = 1;
- }
- }
- }
- /* if breaking out while in str, we got to the end of string, so add it */
- if (in_str) {
- put_string_into_array_len(result, base, curr - base);
- }
- }
- return result;
-}
-
-#define IP_TRUSTED 1
-#define IP_UNTRUSTED 0
-/*
- * check whether ip is trusted, return 1 for trusted , 0 for untrusted
- */
-static int is_proxy_trusted(const char *ipstr, plugin_data *p)
-{
- data_string* allds = (data_string *)array_get_element(p->conf.forwarder, "all");
-
- if (allds) {
- if (strcasecmp(allds->value->ptr, "trust") == 0) {
- return IP_TRUSTED;
- } else {
- return IP_UNTRUSTED;
- }
- }
-
- return (data_string *)array_get_element(p->conf.forwarder, ipstr) ? IP_TRUSTED : IP_UNTRUSTED;
-}
-
-/*
- * Return char *ip of last address of proxy that is not trusted.
- * Do not accept "all" keyword here.
- */
-static const char *last_not_in_array(array *a, plugin_data *p)
-{
- array *forwarder = p->conf.forwarder;
- int i;
-
- for (i = a->used - 1; i >= 0; i--) {
- data_string *ds = (data_string *)a->data[i];
- const char *ip = ds->value->ptr;
-
- if (!array_get_element(forwarder, ip)) {
- return ip;
- }
- }
- return NULL;
-}
-
-static struct addrinfo *ipstr_to_sockaddr(server *srv, const char *host) {
- struct addrinfo hints, *res0;
- int result;
-
- memset(&hints, 0, sizeof(hints));
-#ifndef AI_NUMERICSERV
- /**
- * quoting $ man getaddrinfo
- *
- * NOTES
- * AI_ADDRCONFIG, AI_ALL, and AI_V4MAPPED are available since glibc 2.3.3.
- * AI_NUMERICSERV is available since glibc 2.3.4.
- */
-#define AI_NUMERICSERV 0
-#endif
- hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
-
- errno = 0;
- result = getaddrinfo(host, NULL, &hints, &res0);
-
- if (result != 0) {
- log_error_write(srv, __FILE__, __LINE__, "SSSs(S)",
- "could not resolve hostname ", host, " because ", gai_strerror(result), strerror(errno));
-
- return NULL;
- } else if (res0 == 0) {
- log_error_write(srv, __FILE__, __LINE__, "SSS",
- "Problem in resolving hostname ", host, ": succeeded, but no information returned");
- }
-
- return res0;
-}
-
-
-
-static void clean_cond_cache(server *srv, connection *con) {
- config_cond_cache_reset_item(srv, con, COMP_HTTP_REMOTE_IP);
-}
-
-URIHANDLER_FUNC(mod_extforward_uri_handler) {
- plugin_data *p = p_d;
- data_string *forwarded = NULL;
-#ifdef HAVE_IPV6
- char b2[INET6_ADDRSTRLEN + 1];
- struct addrinfo *addrlist = NULL;
-#endif
- const char *dst_addr_str = NULL;
- array *forward_array = NULL;
- const char *real_remote_addr = NULL;
-#ifdef HAVE_IPV6
-#endif
-
- if (!con->request.headers) return HANDLER_GO_ON;
-
- mod_extforward_patch_connection(srv, con, p);
-
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "-- mod_extforward_uri_handler called");
- }
-
- if (p->conf.headers->used) {
- data_string *ds;
- size_t k;
-
- for(k = 0; k < p->conf.headers->used; k++) {
- ds = (data_string *) p->conf.headers->data[k];
- if (NULL != (forwarded = (data_string*) array_get_element(con->request.headers, ds->value->ptr))) break;
- }
- } else {
- forwarded = (data_string *) array_get_element(con->request.headers,"X-Forwarded-For");
- if (NULL == forwarded) forwarded = (data_string *) array_get_element(con->request.headers, "Forwarded-For");
- }
-
- if (NULL == forwarded) {
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s", "no forward header found, skipping");
- }
-
- return HANDLER_GO_ON;
- }
-
-#ifdef HAVE_IPV6
- dst_addr_str = inet_ntop(con->dst_addr.plain.sa_family,
- con->dst_addr.plain.sa_family == AF_INET6 ?
- (struct sockaddr *)&(con->dst_addr.ipv6.sin6_addr) :
- (struct sockaddr *)&(con->dst_addr.ipv4.sin_addr),
- b2, (sizeof b2) - 1);
-#else
- dst_addr_str = inet_ntoa(con->dst_addr.ipv4.sin_addr);
-#endif
-
- /* if the remote ip itself is not trusted, then do nothing */
- if (IP_UNTRUSTED == is_proxy_trusted(dst_addr_str, p)) {
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "remote address is NOT a trusted proxy, skipping");
- }
-
- return HANDLER_GO_ON;
- }
-
- /* build forward_array from forwarded data_string */
- forward_array = extract_forward_array(forwarded->value);
- real_remote_addr = last_not_in_array(forward_array, p);
-
- if (real_remote_addr != NULL) { /* parsed */
- sock_addr sock;
- struct addrinfo *addrs_left;
- server_socket *srv_sock = con->srv_socket;
- data_string *forwarded_proto = (data_string *)array_get_element(con->request.headers, "X-Forwarded-Proto");
-
- if (forwarded_proto && !strcmp(forwarded_proto->value->ptr, "https")) {
- srv_sock->is_proxy_ssl = 1;
- } else {
- srv_sock->is_proxy_ssl = 0;
- }
-
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "using address:", real_remote_addr);
- }
-#ifdef HAVE_IPV6
- addrlist = ipstr_to_sockaddr(srv, real_remote_addr);
- sock.plain.sa_family = AF_UNSPEC;
- for (addrs_left = addrlist; addrs_left != NULL; addrs_left = addrs_left -> ai_next) {
- sock.plain.sa_family = addrs_left->ai_family;
- if (sock.plain.sa_family == AF_INET) {
- sock.ipv4.sin_addr = ((struct sockaddr_in*)addrs_left->ai_addr)->sin_addr;
- break;
- } else if (sock.plain.sa_family == AF_INET6) {
- sock.ipv6.sin6_addr = ((struct sockaddr_in6*)addrs_left->ai_addr)->sin6_addr;
- break;
- }
- }
-#else
- UNUSED(addrs_left);
- sock.ipv4.sin_addr.s_addr = inet_addr(real_remote_addr);
- sock.plain.sa_family = (sock.ipv4.sin_addr.s_addr == 0xFFFFFFFF) ? AF_UNSPEC : AF_INET;
-#endif
- if (sock.plain.sa_family != AF_UNSPEC) {
- /* we found the remote address, modify current connection and save the old address */
- if (con->plugin_ctx[p->id]) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "patching an already patched connection!");
- handler_ctx_free(con->plugin_ctx[p->id]);
- con->plugin_ctx[p->id] = NULL;
- }
- /* save old address */
- con->plugin_ctx[p->id] = handler_ctx_init(con->dst_addr, con->dst_addr_buf);
- /* patch connection address */
- con->dst_addr = sock;
- con->dst_addr_buf = buffer_init();
- buffer_copy_string(con->dst_addr_buf, real_remote_addr);
-
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "patching con->dst_addr_buf for the accesslog:", real_remote_addr);
- }
- /* Now, clean the conf_cond cache, because we may have changed the results of tests */
- clean_cond_cache(srv, con);
- }
-#ifdef HAVE_IPV6
- if (addrlist != NULL ) freeaddrinfo(addrlist);
-#endif
- }
- array_free(forward_array);
-
- /* not found */
- return HANDLER_GO_ON;
-}
-
-CONNECTION_FUNC(mod_extforward_restore) {
- plugin_data *p = p_d;
- handler_ctx *hctx = con->plugin_ctx[p->id];
-
- if (!hctx) return HANDLER_GO_ON;
-
- con->dst_addr = hctx->saved_remote_addr;
- buffer_free(con->dst_addr_buf);
-
- con->dst_addr_buf = hctx->saved_remote_addr_buf;
-
- handler_ctx_free(hctx);
-
- con->plugin_ctx[p->id] = NULL;
-
- /* Now, clean the conf_cond cache, because we may have changed the results of tests */
- clean_cond_cache(srv, con);
-
- return HANDLER_GO_ON;
-}
-
-
-/* this function is called at dlopen() time and inits the callbacks */
-
-int mod_extforward_plugin_init(plugin *p);
-int mod_extforward_plugin_init(plugin *p) {
- p->version = LIGHTTPD_VERSION_ID;
- p->name = buffer_init_string("extforward");
-
- p->init = mod_extforward_init;
- p->handle_uri_raw = mod_extforward_uri_handler;
- p->handle_request_done = mod_extforward_restore;
- p->connection_reset = mod_extforward_restore;
- p->set_defaults = mod_extforward_set_defaults;
- p->cleanup = mod_extforward_free;
-
- p->data = NULL;
-
- return 0;
-}
-
diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c
index 4c11e36..890062c 100644
--- a/src/mod_fastcgi.c
+++ b/src/mod_fastcgi.c
@@ -1,3 +1,13 @@
+#include <sys/types.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <assert.h>
+#include <signal.h>
+
#include "buffer.h"
#include "server.h"
#include "keyvalue.h"
@@ -13,28 +23,8 @@
#include "inet_ntop_cache.h"
#include "stat_cache.h"
-#include "status_counter.h"
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <assert.h>
-#include <signal.h>
-
-#ifdef HAVE_FASTCGI_FASTCGI_H
-# include <fastcgi/fastcgi.h>
-#else
-# ifdef HAVE_FASTCGI_H
-# include <fastcgi.h>
-# else
-# include "fastcgi.h"
-# endif
-#endif /* HAVE_FASTCGI_FASTCGI_H */
+#include <fastcgi.h>
#include <stdio.h>
#ifdef HAVE_SYS_FILIO_H
@@ -43,6 +33,11 @@
#include "sys-socket.h"
+
+#ifndef UNIX_PATH_MAX
+# define UNIX_PATH_MAX 108
+#endif
+
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
@@ -50,112 +45,111 @@
#include <sys/wait.h>
#endif
-#include "version.h"
-
-#define FCGI_ENV_ADD_CHECK(ret, con) \
- if (ret == -1) { \
- con->http_status = 400; \
- con->file_finished = 1; \
- return -1; \
- };
/*
- *
+ *
* TODO:
- *
+ *
* - add timeout for a connect to a non-fastcgi process
* (use state_timestamp + state)
- *
+ *
*/
typedef struct fcgi_proc {
size_t id; /* id will be between 1 and max_procs */
- buffer *unixsocket; /* config.socket + "-" + id */
+ buffer *socket; /* config.socket + "-" + id */
unsigned port; /* config.port + pno */
-
- buffer *connection_name; /* either tcp:<host>:<port> or unix:<socket> for debugging purposes */
-
+
pid_t pid; /* PID of the spawned process (0 if not spawned locally) */
size_t load; /* number of requests waiting on this process */
+ time_t last_used; /* see idle_timeout */
size_t requests; /* see max_requests */
struct fcgi_proc *prev, *next; /* see first */
-
- time_t disabled_until; /* this proc is disabled until, use something else until then */
-
+
+ time_t disable_ts; /* replace by host->something */
+
int is_local;
- enum {
- PROC_STATE_UNSET, /* init-phase */
- PROC_STATE_RUNNING, /* alive */
- PROC_STATE_OVERLOADED, /* listen-queue is full,
- don't send anything to this proc for the next 2 seconds */
- PROC_STATE_DIED_WAIT_FOR_PID, /* */
- PROC_STATE_DIED, /* marked as dead, should be restarted */
- PROC_STATE_KILLED /* was killed as we don't have the load anymore */
- } state;
+ enum { PROC_STATE_UNSET, /* init-phase */
+ PROC_STATE_RUNNING, /* alive */
+ PROC_STATE_DIED_WAIT_FOR_PID,
+ PROC_STATE_KILLED, /* was killed as we don't have the load anymore */
+ PROC_STATE_DIED, /* marked as dead, should be restarted */
+ PROC_STATE_DISABLED /* proc disabled as it resulted in an error */
+ } state;
} fcgi_proc;
typedef struct {
- /* the key that is used to reference this value */
- buffer *id;
-
/* list of processes handling this extension
* sorted by lowest load
*
* whenever a job is done move it up in the list
- * until it is sorted, move it down as soon as the
+ * until it is sorted, move it down as soon as the
* job is started
*/
- fcgi_proc *first;
- fcgi_proc *unused_procs;
+ fcgi_proc *first;
+ fcgi_proc *unused_procs;
- /*
+ /*
* spawn at least min_procs, at max_procs.
*
- * as soon as the load of the first entry
+ * as soon as the load of the first entry
* is max_load_per_proc we spawn a new one
- * and add it to the first entry and give it
+ * and add it to the first entry and give it
* the load
- *
+ *
*/
+ unsigned short min_procs;
unsigned short max_procs;
size_t num_procs; /* how many procs are started */
- size_t active_procs; /* how many of them are really running, i.e. state = PROC_STATE_RUNNING */
+ size_t active_procs; /* how many of them are really running */
+
+ unsigned short max_load_per_proc;
/*
- * time after a disabled remote connection is tried to be re-enabled
- *
+ * kick the process from the list if it was not
+ * used for idle_timeout until min_procs is
+ * reached. this helps to get the processlist
+ * small again we had a small peak load.
*
*/
-
+
+ unsigned short idle_timeout;
+
+ /*
+ * time after a disabled remote connection is tried to be re-enabled
+ *
+ *
+ */
+
unsigned short disable_time;
/*
- * some fastcgi processes get a little bit larger
- * than wanted. max_requests_per_proc kills a
+ * same fastcgi processes get a little bit larger
+ * than wanted. max_requests_per_proc kills a
* process after a number of handled requests.
*
*/
size_t max_requests_per_proc;
-
+
/* config */
- /*
- * host:port
+ /*
+ * host:port
*
- * if host is one of the local IP adresses the
+ * if host is one of the local IP adresses the
* whole connection is local
*
- * if port is not 0, and host is not specified,
- * "localhost" (INADDR_LOOPBACK) is assumed.
- *
- */
- buffer *host;
+ * if tcp/ip should be used host AND port have
+ * to be specified
+ *
+ */
+ buffer *host;
unsigned short port;
/*
@@ -168,27 +162,27 @@ typedef struct {
*/
buffer *unixsocket;
- /* if socket is local we can start the fastcgi
+ /* if socket is local we can start the fastcgi
* process ourself
*
* bin-path is the path to the binary
*
* check min_procs and max_procs for the number
- * of process to start up
+ * of process to start-up
*/
- buffer *bin_path;
-
- /* bin-path is set bin-environment is taken to
+ buffer *bin_path;
+
+ /* bin-path is set bin-environment is taken to
* create the environement before starting the
* FastCGI process
- *
+ *
*/
array *bin_env;
-
+
array *bin_env_copy;
-
+
/*
- * docroot-translation between URL->phys and the
+ * docroot-translation between URL->phys and the
* remote host
*
* reasons:
@@ -207,7 +201,7 @@ typedef struct {
unsigned short mode;
/*
- * check_local tells you if the phys file is stat()ed
+ * check_local tell you if the phys file is stat()ed
* or not. FastCGI doesn't care if the service is
* remote. If the web-server side doesn't contain
* the fastcgi-files we should not stat() for them
@@ -217,59 +211,44 @@ typedef struct {
/*
* append PATH_INFO to SCRIPT_FILENAME
- *
- * php needs this if cgi.fix_pathinfo is provided
- *
+ *
+ * php needs this if cgi.fix_pathinfo is provied
+ *
*/
-
+
unsigned short break_scriptfilename_for_php;
/*
- * workaround for program when prefix="/"
- *
- * rule to build PATH_INFO is hardcoded for when check_local is disabled
- * enable this option to use the workaround
- *
- */
-
- unsigned short fix_root_path_name;
-
- /*
* If the backend includes X-LIGHTTPD-send-file in the response
* we use the value as filename and ignore the content.
*
*/
unsigned short allow_xsendfile;
-
+
ssize_t load; /* replace by host->load */
size_t max_id; /* corresponds most of the time to
num_procs.
-
+
only if a process is killed max_id waits for the process itself
- to die and decrements it afterwards */
+ to die and decrements its afterwards */
buffer *strip_request_uri;
-
- unsigned short kill_signal; /* we need a setting for this as libfcgi
- applications prefer SIGUSR1 while the
- rest of the world would use SIGTERM
- *sigh* */
} fcgi_extension_host;
/*
* one extension can have multiple hosts assigned
- * one host can spawn additional processes on the same
+ * one host can spawn additional processes on the same
* socket (if we control it)
*
* ext -> host -> procs
* 1:n 1:n
*
- * if the fastcgi process is remote that whole goes down
+ * if the fastcgi process is remote that whole goes down
* to
*
* ext -> host -> procs
- * 1:n 1:1
+ * 1:n 1:1
*
* in case of PHP and FCGI_CHILDREN we have again a procs
* but we don't control it directly.
@@ -279,11 +258,8 @@ typedef struct {
typedef struct {
buffer *key; /* like .php */
- int note_is_sent;
- int last_used_ndx;
-
fcgi_extension_host **hosts;
-
+
size_t used;
size_t size;
} fcgi_extension;
@@ -297,16 +273,20 @@ typedef struct {
typedef struct {
- fcgi_exts *exts;
-
- array *ext_mapping;
-
- unsigned int debug;
+ fcgi_exts *exts;
+
+ int debug;
} plugin_config;
typedef struct {
- char **ptr;
+ size_t *ptr;
+ size_t used;
+ size_t size;
+} buffer_uint;
+typedef struct {
+ char **ptr;
+
size_t size;
size_t used;
} char_array;
@@ -314,44 +294,39 @@ typedef struct {
/* generic plugin data, shared between all connections */
typedef struct {
PLUGIN_DATA;
-
+ buffer_uint fcgi_request_id;
+
buffer *fcgi_env;
-
+
buffer *path;
buffer *parse_response;
-
- buffer *statuskey;
-
+
plugin_config **config_storage;
-
+
plugin_config conf; /* this is only used as long as no handler_ctx is setup */
} plugin_data;
/* connection specific data */
-typedef enum {
- FCGI_STATE_UNSET,
- FCGI_STATE_INIT,
- FCGI_STATE_CONNECT_DELAYED,
- FCGI_STATE_PREPARE_WRITE,
- FCGI_STATE_WRITE,
- FCGI_STATE_READ
+typedef enum { FCGI_STATE_INIT, FCGI_STATE_CONNECT, FCGI_STATE_PREPARE_WRITE,
+ FCGI_STATE_WRITE, FCGI_STATE_READ
} fcgi_connection_state_t;
typedef struct {
fcgi_proc *proc;
fcgi_extension_host *host;
- fcgi_extension *ext;
-
+
fcgi_connection_state_t state;
time_t state_timestamp;
-
+
int reconnects; /* number of reconnect attempts */
-
+
chunkqueue *rb; /* read queue */
chunkqueue *wb; /* write queue */
-
+
buffer *response_header;
-
+
+ int delayed; /* flag to mark that the connect() is delayed */
+
size_t request_id;
int fd; /* fd to the fastcgi process */
int fde_ndx; /* index into the fd-event buffer */
@@ -360,159 +335,49 @@ typedef struct {
int got_proc;
int send_content_body;
-
+
plugin_config conf;
-
+
connection *remote_conn; /* dumb pointer */
plugin_data *plugin_data; /* dumb pointer */
} handler_ctx;
/* ok, we need a prototype */
-static handler_t fcgi_handle_fdevent(server *srv, void *ctx, int revents);
-
-static void reset_signals(void) {
-#ifdef SIGTTOU
- signal(SIGTTOU, SIG_DFL);
-#endif
-#ifdef SIGTTIN
- signal(SIGTTIN, SIG_DFL);
-#endif
-#ifdef SIGTSTP
- signal(SIGTSTP, SIG_DFL);
-#endif
- signal(SIGHUP, SIG_DFL);
- signal(SIGPIPE, SIG_DFL);
- signal(SIGUSR1, SIG_DFL);
-}
-
-static void fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
- buffer_copy_string_len(b, CONST_STR_LEN("fastcgi.backend."));
- buffer_append_string_buffer(b, host->id);
- if (proc) {
- buffer_append_string_len(b, CONST_STR_LEN("."));
- buffer_append_long(b, proc->id);
- }
-}
-
-static void fcgi_proc_load_inc(server *srv, handler_ctx *hctx) {
- plugin_data *p = hctx->plugin_data;
- hctx->proc->load++;
-
- status_counter_inc(srv, CONST_STR_LEN("fastcgi.active-requests"));
-
- fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc);
- buffer_append_string_len(p->statuskey, CONST_STR_LEN(".load"));
-
- status_counter_set(srv, CONST_BUF_LEN(p->statuskey), hctx->proc->load);
-}
-
-static void fcgi_proc_load_dec(server *srv, handler_ctx *hctx) {
- plugin_data *p = hctx->plugin_data;
- hctx->proc->load--;
-
- status_counter_dec(srv, CONST_STR_LEN("fastcgi.active-requests"));
-
- fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc);
- buffer_append_string_len(p->statuskey, CONST_STR_LEN(".load"));
-
- status_counter_set(srv, CONST_BUF_LEN(p->statuskey), hctx->proc->load);
-}
-
-static void fcgi_host_assign(server *srv, handler_ctx *hctx, fcgi_extension_host *host) {
- plugin_data *p = hctx->plugin_data;
- hctx->host = host;
- hctx->host->load++;
-
- fastcgi_status_copy_procname(p->statuskey, hctx->host, NULL);
- buffer_append_string_len(p->statuskey, CONST_STR_LEN(".load"));
-
- status_counter_set(srv, CONST_BUF_LEN(p->statuskey), hctx->host->load);
-}
-
-static void fcgi_host_reset(server *srv, handler_ctx *hctx) {
- plugin_data *p = hctx->plugin_data;
- hctx->host->load--;
-
- fastcgi_status_copy_procname(p->statuskey, hctx->host, NULL);
- buffer_append_string_len(p->statuskey, CONST_STR_LEN(".load"));
-
- status_counter_set(srv, CONST_BUF_LEN(p->statuskey), hctx->host->load);
-
- hctx->host = NULL;
-}
-
-static void fcgi_host_disable(server *srv, handler_ctx *hctx) {
- plugin_data *p = hctx->plugin_data;
-
- if (hctx->host->disable_time || hctx->proc->is_local) {
- if (hctx->proc->state == PROC_STATE_RUNNING) hctx->host->active_procs--;
- hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
- hctx->proc->state = hctx->proc->is_local ? PROC_STATE_DIED_WAIT_FOR_PID : PROC_STATE_DIED;
-
- if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
- "backend disabled for", hctx->host->disable_time, "seconds");
- }
- }
-}
+static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents);
-static int fastcgi_status_init(server *srv, buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
-#define CLEAN(x) \
- fastcgi_status_copy_procname(b, host, proc); \
- buffer_append_string_len(b, CONST_STR_LEN(x)); \
- status_counter_set(srv, CONST_BUF_LEN(b), 0);
+int fcgi_proclist_sort_down(server *srv, fcgi_extension_host *host, fcgi_proc *proc);
- CLEAN(".disabled");
- CLEAN(".died");
- CLEAN(".overloaded");
- CLEAN(".connected");
- CLEAN(".load");
-#undef CLEAN
-
-#define CLEAN(x) \
- fastcgi_status_copy_procname(b, host, NULL); \
- buffer_append_string_len(b, CONST_STR_LEN(x)); \
- status_counter_set(srv, CONST_BUF_LEN(b), 0);
-
- CLEAN(".load");
-
-#undef CLEAN
-
- return 0;
-}
static handler_ctx * handler_ctx_init() {
handler_ctx * hctx;
-
+
hctx = calloc(1, sizeof(*hctx));
assert(hctx);
-
+
hctx->fde_ndx = -1;
-
+
hctx->response_header = buffer_init();
-
+
hctx->request_id = 0;
hctx->state = FCGI_STATE_INIT;
hctx->proc = NULL;
-
+
hctx->fd = -1;
+
+ hctx->delayed = 0;
hctx->reconnects = 0;
hctx->send_content_body = 1;
hctx->rb = chunkqueue_init();
hctx->wb = chunkqueue_init();
-
+
return hctx;
}
-static void handler_ctx_free(server *srv, handler_ctx *hctx) {
- if (hctx->host) {
- fcgi_host_reset(srv, hctx);
- }
-
+static void handler_ctx_free(handler_ctx *hctx) {
buffer_free(hctx->response_header);
chunkqueue_free(hctx->rb);
@@ -521,36 +386,33 @@ static void handler_ctx_free(server *srv, handler_ctx *hctx) {
free(hctx);
}
-static fcgi_proc *fastcgi_process_init() {
+fcgi_proc *fastcgi_process_init() {
fcgi_proc *f;
f = calloc(1, sizeof(*f));
- f->unixsocket = buffer_init();
- f->connection_name = buffer_init();
-
+ f->socket = buffer_init();
+
f->prev = NULL;
f->next = NULL;
-
+
return f;
}
-static void fastcgi_process_free(fcgi_proc *f) {
+void fastcgi_process_free(fcgi_proc *f) {
if (!f) return;
-
+
fastcgi_process_free(f->next);
-
- buffer_free(f->unixsocket);
- buffer_free(f->connection_name);
-
+
+ buffer_free(f->socket);
+
free(f);
}
-static fcgi_extension_host *fastcgi_host_init() {
+fcgi_extension_host *fastcgi_host_init() {
fcgi_extension_host *f;
f = calloc(1, sizeof(*f));
- f->id = buffer_init();
f->host = buffer_init();
f->unixsocket = buffer_init();
f->docroot = buffer_init();
@@ -558,14 +420,13 @@ static fcgi_extension_host *fastcgi_host_init() {
f->bin_env = array_init();
f->bin_env_copy = array_init();
f->strip_request_uri = buffer_init();
-
+
return f;
}
-static void fastcgi_host_free(fcgi_extension_host *h) {
+void fastcgi_host_free(fcgi_extension_host *h) {
if (!h) return;
-
- buffer_free(h->id);
+
buffer_free(h->host);
buffer_free(h->unixsocket);
buffer_free(h->docroot);
@@ -573,53 +434,53 @@ static void fastcgi_host_free(fcgi_extension_host *h) {
buffer_free(h->strip_request_uri);
array_free(h->bin_env);
array_free(h->bin_env_copy);
-
+
fastcgi_process_free(h->first);
fastcgi_process_free(h->unused_procs);
-
+
free(h);
-
+
}
-static fcgi_exts *fastcgi_extensions_init() {
+fcgi_exts *fastcgi_extensions_init() {
fcgi_exts *f;
f = calloc(1, sizeof(*f));
-
+
return f;
}
-static void fastcgi_extensions_free(fcgi_exts *f) {
+void fastcgi_extensions_free(fcgi_exts *f) {
size_t i;
-
+
if (!f) return;
-
+
for (i = 0; i < f->used; i++) {
fcgi_extension *fe;
size_t j;
-
+
fe = f->exts[i];
-
+
for (j = 0; j < fe->used; j++) {
fcgi_extension_host *h;
-
+
h = fe->hosts[j];
-
+
fastcgi_host_free(h);
}
-
+
buffer_free(fe->key);
free(fe->hosts);
-
+
free(fe);
}
-
+
free(f->exts);
-
+
free(f);
}
-static int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_host *fh) {
+int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_host *fh) {
fcgi_extension *fe;
size_t i;
@@ -636,7 +497,6 @@ static int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_
fe = calloc(1, sizeof(*fe));
assert(fe);
fe->key = buffer_init();
- fe->last_used_ndx = -1;
buffer_copy_string_buffer(fe->key, key);
/* */
@@ -665,116 +525,102 @@ static int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_
assert(fe->hosts);
}
- fe->hosts[fe->used++] = fh;
+ fe->hosts[fe->used++] = fh;
return 0;
-
+
}
INIT_FUNC(mod_fastcgi_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->fcgi_env = buffer_init();
-
+
p->path = buffer_init();
p->parse_response = buffer_init();
-
- p->statuskey = buffer_init();
-
+
return p;
}
FREE_FUNC(mod_fastcgi_free) {
plugin_data *p = p_d;
-
+ buffer_uint *r = &(p->fcgi_request_id);
+
UNUSED(srv);
+ if (r->ptr) free(r->ptr);
+
buffer_free(p->fcgi_env);
buffer_free(p->path);
buffer_free(p->parse_response);
- buffer_free(p->statuskey);
-
+
if (p->config_storage) {
size_t i, j, n;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
fcgi_exts *exts;
-
+
if (!s) continue;
-
+
exts = s->exts;
for (j = 0; j < exts->used; j++) {
fcgi_extension *ex;
-
+
ex = exts->exts[j];
-
+
for (n = 0; n < ex->used; n++) {
fcgi_proc *proc;
fcgi_extension_host *host;
-
+
host = ex->hosts[n];
-
+
for (proc = host->first; proc; proc = proc->next) {
- if (proc->pid != 0) {
- kill(proc->pid, host->kill_signal);
- }
-
- if (proc->is_local &&
- !buffer_is_empty(proc->unixsocket)) {
- unlink(proc->unixsocket->ptr);
+ if (proc->pid != 0) kill(proc->pid, SIGTERM);
+
+ if (proc->is_local &&
+ !buffer_is_empty(proc->socket)) {
+ unlink(proc->socket->ptr);
}
}
-
+
for (proc = host->unused_procs; proc; proc = proc->next) {
- if (proc->pid != 0) {
- kill(proc->pid, host->kill_signal);
- }
- if (proc->is_local &&
- !buffer_is_empty(proc->unixsocket)) {
- unlink(proc->unixsocket->ptr);
+ if (proc->pid != 0) kill(proc->pid, SIGTERM);
+
+ if (proc->is_local &&
+ !buffer_is_empty(proc->socket)) {
+ unlink(proc->socket->ptr);
}
}
}
}
-
+
fastcgi_extensions_free(s->exts);
- array_free(s->ext_mapping);
-
+
free(s);
}
free(p->config_storage);
}
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
static int env_add(char_array *env, const char *key, size_t key_len, const char *val, size_t val_len) {
char *dst;
- size_t i;
-
+
if (!key || !val) return -1;
-
+
dst = malloc(key_len + val_len + 3);
memcpy(dst, key, key_len);
dst[key_len] = '=';
- memcpy(dst + key_len + 1, val, val_len);
- dst[key_len + 1 + val_len] = '\0';
-
- for (i = 0; i < env->used; i++) {
- if (0 == strncmp(dst, env->ptr[i], key_len + 1)) {
- /* don't care about free as we are in a forked child which is going to exec(...) */
- /* free(env->ptr[i]); */
- env->ptr[i] = dst;
- return 0;
- }
- }
-
+ /* add the \0 from the value */
+ memcpy(dst + key_len + 1, val, val_len + 1);
+
if (env->size == 0) {
env->size = 16;
env->ptr = malloc(env->size * sizeof(*env->ptr));
@@ -782,9 +628,9 @@ static int env_add(char_array *env, const char *key, size_t key_len, const char
env->size += 16;
env->ptr = realloc(env->ptr, env->size * sizeof(*env->ptr));
}
-
+
env->ptr[env->used++] = dst;
-
+
return 0;
}
@@ -803,15 +649,15 @@ static int parse_binpath(char_array *env, buffer *b) {
if (env->size == 0) {
env->size = 16;
env->ptr = malloc(env->size * sizeof(*env->ptr));
- } else if (env->size == env->used) {
+ } else if (env->size == env->used) {
env->size += 16;
env->ptr = realloc(env->ptr, env->size * sizeof(*env->ptr));
}
-
+
b->ptr[i] = '\0';
env->ptr[env->used++] = start;
-
+
start = b->ptr + i + 1;
break;
default:
@@ -844,7 +690,7 @@ static int parse_binpath(char_array *env, buffer *b) {
return 0;
}
-static int fcgi_spawn_connection(server *srv,
+static int fcgi_spawn_connection(server *srv,
plugin_data *p,
fcgi_extension_host *host,
fcgi_proc *proc) {
@@ -856,37 +702,33 @@ static int fcgi_spawn_connection(server *srv,
#endif
struct sockaddr_in fcgi_addr_in;
struct sockaddr *fcgi_addr;
-
+
socklen_t servlen;
-
+
#ifndef HAVE_FORK
return -1;
#endif
-
+
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "sdb",
- "new proc, socket:", proc->port, proc->unixsocket);
+ "new proc, socket:", proc->port, proc->socket);
}
-
- if (!buffer_is_empty(proc->unixsocket)) {
+
+ if (!buffer_is_empty(proc->socket)) {
memset(&fcgi_addr, 0, sizeof(fcgi_addr));
-
+
#ifdef HAVE_SYS_UN_H
fcgi_addr_un.sun_family = AF_UNIX;
- strcpy(fcgi_addr_un.sun_path, proc->unixsocket->ptr);
-
+ strcpy(fcgi_addr_un.sun_path, proc->socket->ptr);
+
#ifdef SUN_LEN
servlen = SUN_LEN(&fcgi_addr_un);
#else
/* stevens says: */
- servlen = proc->unixsocket->used + sizeof(fcgi_addr_un.sun_family);
+ servlen = proc->socket->used - 1 + sizeof(fcgi_addr_un.sun_family);
#endif
socket_type = AF_UNIX;
fcgi_addr = (struct sockaddr *) &fcgi_addr_un;
-
- buffer_copy_string_len(proc->connection_name, CONST_STR_LEN("unix:"));
- buffer_append_string_buffer(proc->connection_name, proc->unixsocket);
-
#else
log_error_write(srv, __FILE__, __LINE__, "s",
"ERROR: Unix Domain sockets are not supported.");
@@ -894,112 +736,102 @@ static int fcgi_spawn_connection(server *srv,
#endif
} else {
fcgi_addr_in.sin_family = AF_INET;
-
+
if (buffer_is_empty(host->host)) {
- fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
} else {
struct hostent *he;
-
- /* set a useful default */
- fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
-
-
+
+ /* set a usefull default */
+ fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
+
+
if (NULL == (he = gethostbyname(host->host->ptr))) {
- log_error_write(srv, __FILE__, __LINE__,
- "sdb", "gethostbyname failed: ",
+ log_error_write(srv, __FILE__, __LINE__,
+ "sdb", "gethostbyname failed: ",
h_errno, host->host);
return -1;
}
-
+
if (he->h_addrtype != AF_INET) {
log_error_write(srv, __FILE__, __LINE__, "sd", "addr-type != AF_INET: ", he->h_addrtype);
return -1;
}
-
+
if (he->h_length != sizeof(struct in_addr)) {
log_error_write(srv, __FILE__, __LINE__, "sd", "addr-length != sizeof(in_addr): ", he->h_length);
return -1;
}
-
+
memcpy(&(fcgi_addr_in.sin_addr.s_addr), he->h_addr_list[0], he->h_length);
-
+
}
fcgi_addr_in.sin_port = htons(proc->port);
servlen = sizeof(fcgi_addr_in);
-
+
socket_type = AF_INET;
fcgi_addr = (struct sockaddr *) &fcgi_addr_in;
-
- buffer_copy_string_len(proc->connection_name, CONST_STR_LEN("tcp:"));
- if (!buffer_is_empty(host->host)) {
- buffer_append_string_buffer(proc->connection_name, host->host);
- } else {
- buffer_append_string_len(proc->connection_name, CONST_STR_LEN("localhost"));
- }
- buffer_append_string_len(proc->connection_name, CONST_STR_LEN(":"));
- buffer_append_long(proc->connection_name, proc->port);
}
-
+
if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"failed:", strerror(errno));
return -1;
}
-
+
if (-1 == connect(fcgi_fd, fcgi_addr, servlen)) {
- /* server is not up, spawn it */
+ /* server is not up, spawn in */
pid_t child;
int val;
-
- if (errno != ENOENT &&
- !buffer_is_empty(proc->unixsocket)) {
- unlink(proc->unixsocket->ptr);
+
+ if (!buffer_is_empty(proc->socket)) {
+ unlink(proc->socket->ptr);
}
-
+
close(fcgi_fd);
-
+
/* reopen socket */
if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"socket failed:", strerror(errno));
return -1;
}
-
+
val = 1;
if (setsockopt(fcgi_fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"socketsockopt failed:", strerror(errno));
return -1;
}
-
+
/* create socket */
if (-1 == bind(fcgi_fd, fcgi_addr, servlen)) {
- log_error_write(srv, __FILE__, __LINE__, "sbs",
- "bind failed for:",
- proc->connection_name,
+ log_error_write(srv, __FILE__, __LINE__, "sbds",
+ "bind failed for:",
+ proc->socket,
+ proc->port,
strerror(errno));
return -1;
}
-
+
if (-1 == listen(fcgi_fd, 1024)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"listen failed:", strerror(errno));
return -1;
}
-
-#ifdef HAVE_FORK
+
+#ifdef HAVE_FORK
switch ((child = fork())) {
case 0: {
size_t i = 0;
- char *c;
char_array env;
char_array arg;
-
+
/* create environment */
env.ptr = NULL;
env.size = 0;
env.used = 0;
-
+
arg.ptr = NULL;
arg.size = 0;
arg.used = 0;
@@ -1009,18 +841,18 @@ static int fcgi_spawn_connection(server *srv,
dup2(fcgi_fd, FCGI_LISTENSOCK_FILENO);
close(fcgi_fd);
}
-
+
/* we don't need the client socket */
for (i = 3; i < 256; i++) {
close(i);
}
-
+
/* build clean environment */
if (host->bin_env_copy->used) {
for (i = 0; i < host->bin_env_copy->used; i++) {
data_string *ds = (data_string *)host->bin_env_copy->data[i];
char *ge;
-
+
if (NULL != (ge = getenv(ds->value->ptr))) {
env_add(&env, CONST_BUF_LEN(ds->value), ge, strlen(ge));
}
@@ -1028,57 +860,42 @@ static int fcgi_spawn_connection(server *srv,
} else {
for (i = 0; environ[i]; i++) {
char *eq;
-
+
if (NULL != (eq = strchr(environ[i], '='))) {
env_add(&env, environ[i], eq - environ[i], eq+1, strlen(eq+1));
}
}
}
-
+
/* create environment */
for (i = 0; i < host->bin_env->used; i++) {
data_string *ds = (data_string *)host->bin_env->data[i];
-
+
env_add(&env, CONST_BUF_LEN(ds->key), CONST_BUF_LEN(ds->value));
}
-
+
for (i = 0; i < env.used; i++) {
/* search for PHP_FCGI_CHILDREN */
if (0 == strncmp(env.ptr[i], "PHP_FCGI_CHILDREN=", sizeof("PHP_FCGI_CHILDREN=") - 1)) break;
}
-
+
/* not found, add a default */
if (i == env.used) {
env_add(&env, CONST_STR_LEN("PHP_FCGI_CHILDREN"), CONST_STR_LEN("1"));
}
-
+
env.ptr[env.used] = NULL;
parse_binpath(&arg, host->bin_path);
-
- /* chdir into the base of the bin-path,
- * search for the last / */
- if (NULL != (c = strrchr(arg.ptr[0], '/'))) {
- *c = '\0';
-
- /* change to the physical directory */
- if (-1 == chdir(arg.ptr[0])) {
- *c = '/';
- log_error_write(srv, __FILE__, __LINE__, "sss", "chdir failed:", strerror(errno), arg.ptr[0]);
- }
- *c = '/';
- }
-
- reset_signals();
-
+
/* exec the cgi */
execve(arg.ptr[0], arg.ptr, env.ptr);
-
- /* log_error_write(srv, __FILE__, __LINE__, "sbs",
- "execve failed for:", host->bin_path, strerror(errno)); */
-
+
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
+ "execve failed for:", host->bin_path, strerror(errno));
+
exit(errno);
-
+
break;
}
case -1:
@@ -1086,17 +903,17 @@ static int fcgi_spawn_connection(server *srv,
break;
default:
/* father */
-
+
/* wait */
select(0, NULL, NULL, NULL, &tv);
-
+
switch (waitpid(child, &status, WNOHANG)) {
case 0:
/* child still running after timeout, good */
break;
case -1:
/* no PID found ? should never happen */
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"pid not found:", strerror(errno));
return -1;
default:
@@ -1104,26 +921,30 @@ static int fcgi_spawn_connection(server *srv,
"the fastcgi-backend", host->bin_path, "failed to start:");
/* the child should not terminate at all */
if (WIFEXITED(status)) {
- log_error_write(srv, __FILE__, __LINE__, "sdb",
- "child exited with status",
+ log_error_write(srv, __FILE__, __LINE__, "sdb",
+ "child exited with status",
WEXITSTATUS(status), host->bin_path);
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "if you try do run PHP as FastCGI backend make sure you use the FastCGI enabled version.\n"
+ "You can find out if it is the right one by executing 'php -v' and it should display '(cgi-fcgi)' "
+ "in the output, NOT (cgi) NOR (cli)\n"
+ "For more information check http://www.lighttpd.net/documentation/fastcgi.html#preparing-php-as-a-fastcgi-program");
log_error_write(srv, __FILE__, __LINE__, "s",
- "If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.\n"
- "If this is PHP on Gentoo, add 'fastcgi' to the USE flags.");
+ "If this is PHP on Gentoo add fastcgi to the USE flags");
} else if (WIFSIGNALED(status)) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "terminated by signal:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "terminated by signal:",
WTERMSIG(status));
if (WTERMSIG(status) == 11) {
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "to be exact: it seg-fault, crashed, died, ... you get the idea." );
log_error_write(srv, __FILE__, __LINE__, "s",
- "to be exact: it segfaulted, crashed, died, ... you get the idea." );
- log_error_write(srv, __FILE__, __LINE__, "s",
- "If this is PHP, try removing the bytecode caches for now and try again.");
+ "If this is PHP try to remove the byte-code caches for now and try again.");
}
} else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child died somehow:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child died somehow:",
status);
}
return -1;
@@ -1131,27 +952,28 @@ static int fcgi_spawn_connection(server *srv,
/* register process */
proc->pid = child;
+ proc->last_used = srv->cur_ts;
proc->is_local = 1;
-
+
break;
}
#endif
} else {
proc->is_local = 0;
proc->pid = 0;
-
+
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "sb",
- "(debug) socket is already used; won't spawn:",
- proc->connection_name);
+ "(debug) socket is already used, won't spawn:",
+ proc->socket);
}
}
-
+
proc->state = PROC_STATE_RUNNING;
host->active_procs++;
-
+
close(fcgi_fd);
-
+
return 0;
}
@@ -1161,279 +983,274 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
data_unset *du;
size_t i = 0;
buffer *fcgi_mode = buffer_init();
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "fastcgi.server", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { "fastcgi.debug", NULL, T_CONFIG_INT , T_CONFIG_SCOPE_CONNECTION }, /* 1 */
- { "fastcgi.map-extensions", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
+ { "fastcgi.debug", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
array *ca;
-
+
s = malloc(sizeof(plugin_config));
s->exts = fastcgi_extensions_init();
s->debug = 0;
- s->ext_mapping = array_init();
-
+
cv[0].destination = s->exts;
cv[1].destination = &(s->debug);
- cv[2].destination = s->ext_mapping;
-
+
p->config_storage[i] = s;
ca = ((data_config *)srv->config_context->data[i])->value;
-
+
if (0 != config_insert_values_global(srv, ca, cv)) {
return HANDLER_ERROR;
}
-
- /*
+
+ /*
* <key> = ( ... )
*/
-
+
if (NULL != (du = array_get_element(ca, "fastcgi.server"))) {
size_t j;
data_array *da = (data_array *)du;
-
+
if (du->type != TYPE_ARRAY) {
- log_error_write(srv, __FILE__, __LINE__, "sss",
+ log_error_write(srv, __FILE__, __LINE__, "sss",
"unexpected type for key: ", "fastcgi.server", "array of strings");
-
+
return HANDLER_ERROR;
}
-
-
- /*
- * fastcgi.server = ( "<ext>" => ( ... ),
+
+
+ /*
+ * fastcgi.server = ( "<ext>" => ( ... ),
* "<ext>" => ( ... ) )
*/
-
+
for (j = 0; j < da->value->used; j++) {
size_t n;
data_array *da_ext = (data_array *)da->value->data[j];
-
+
if (da->value->data[j]->type != TYPE_ARRAY) {
- log_error_write(srv, __FILE__, __LINE__, "sssbs",
- "unexpected type for key: ", "fastcgi.server",
+ log_error_write(srv, __FILE__, __LINE__, "sssbs",
+ "unexpected type for key: ", "fastcgi.server",
"[", da->value->data[j]->key, "](string)");
-
+
return HANDLER_ERROR;
}
-
- /*
- * da_ext->key == name of the extension
+
+ /*
+ * da_ext->key == name of the extension
*/
-
- /*
- * fastcgi.server = ( "<ext>" =>
- * ( "<host>" => ( ... ),
+
+ /*
+ * fastcgi.server = ( "<ext>" =>
+ * ( "<host>" => ( ... ),
* "<host>" => ( ... )
- * ),
+ * ),
* "<ext>" => ... )
*/
-
+
for (n = 0; n < da_ext->value->used; n++) {
data_array *da_host = (data_array *)da_ext->value->data[n];
-
- fcgi_extension_host *host;
-
- config_values_t fcv[] = {
+
+ fcgi_extension_host *df;
+
+ config_values_t fcv[] = {
{ "host", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "docroot", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ "mode", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
{ "socket", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
{ "bin-path", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 4 */
-
+
{ "check-local", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
{ "port", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 6 */
- { "max-procs", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
- { "disable-time", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
-
- { "bin-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
- { "bin-copy-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
-
- { "broken-scriptfilename", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
- { "allow-x-send-file", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
- { "strip-request-uri", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
- { "kill-signal", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 14 */
- { "fix-root-scriptname", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 15 */
-
+ { "min-procs-not-working", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 7 this is broken for now */
+ { "max-procs", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
+ { "max-load-per-proc", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
+ { "idle-timeout", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
+ { "disable-time", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
+
+ { "bin-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
+ { "bin-copy-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
+
+ { "broken-scriptfilename", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 14 */
+ { "allow-x-send-file", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 15 */
+ { "strip-request-uri", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 16 */
+
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (da_host->type != TYPE_ARRAY) {
- log_error_write(srv, __FILE__, __LINE__, "ssSBS",
- "unexpected type for key:",
- "fastcgi.server",
+ log_error_write(srv, __FILE__, __LINE__, "ssSBS",
+ "unexpected type for key:",
+ "fastcgi.server",
"[", da_host->key, "](string)");
-
+
return HANDLER_ERROR;
}
-
- host = fastcgi_host_init();
-
- buffer_copy_string_buffer(host->id, da_host->key);
-
- host->check_local = 1;
- host->max_procs = 4;
- host->mode = FCGI_RESPONDER;
- host->disable_time = 1;
- host->break_scriptfilename_for_php = 0;
- host->allow_xsendfile = 0; /* handle X-LIGHTTPD-send-file */
- host->kill_signal = SIGTERM;
- host->fix_root_path_name = 0;
-
- fcv[0].destination = host->host;
- fcv[1].destination = host->docroot;
+
+ df = fastcgi_host_init();
+
+ df->check_local = 1;
+ df->min_procs = 4;
+ df->max_procs = 4;
+ df->max_load_per_proc = 1;
+ df->idle_timeout = 60;
+ df->mode = FCGI_RESPONDER;
+ df->disable_time = 60;
+ df->break_scriptfilename_for_php = 0;
+ df->allow_xsendfile = 0; /* handle X-LIGHTTPD-send-file */
+
+ fcv[0].destination = df->host;
+ fcv[1].destination = df->docroot;
fcv[2].destination = fcgi_mode;
- fcv[3].destination = host->unixsocket;
- fcv[4].destination = host->bin_path;
-
- fcv[5].destination = &(host->check_local);
- fcv[6].destination = &(host->port);
- fcv[7].destination = &(host->max_procs);
- fcv[8].destination = &(host->disable_time);
-
- fcv[9].destination = host->bin_env;
- fcv[10].destination = host->bin_env_copy;
- fcv[11].destination = &(host->break_scriptfilename_for_php);
- fcv[12].destination = &(host->allow_xsendfile);
- fcv[13].destination = host->strip_request_uri;
- fcv[14].destination = &(host->kill_signal);
- fcv[15].destination = &(host->fix_root_path_name);
-
+ fcv[3].destination = df->unixsocket;
+ fcv[4].destination = df->bin_path;
+
+ fcv[5].destination = &(df->check_local);
+ fcv[6].destination = &(df->port);
+ fcv[7].destination = &(df->min_procs);
+ fcv[8].destination = &(df->max_procs);
+ fcv[9].destination = &(df->max_load_per_proc);
+ fcv[10].destination = &(df->idle_timeout);
+ fcv[11].destination = &(df->disable_time);
+
+ fcv[12].destination = df->bin_env;
+ fcv[13].destination = df->bin_env_copy;
+ fcv[14].destination = &(df->break_scriptfilename_for_php);
+ fcv[15].destination = &(df->allow_xsendfile);
+ fcv[16].destination = df->strip_request_uri;
+
if (0 != config_insert_values_internal(srv, da_host->value, fcv)) {
return HANDLER_ERROR;
}
-
- if ((!buffer_is_empty(host->host) || host->port) &&
- !buffer_is_empty(host->unixsocket)) {
- log_error_write(srv, __FILE__, __LINE__, "sbsbsbs",
- "either host/port or socket have to be set in:",
- da->key, "= (",
- da_ext->key, " => (",
- da_host->key, " ( ...");
-
+
+ if ((!buffer_is_empty(df->host) || df->port) &&
+ !buffer_is_empty(df->unixsocket)) {
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "either host+port or socket");
+
return HANDLER_ERROR;
}
-
- if (!buffer_is_empty(host->unixsocket)) {
+
+ if (!buffer_is_empty(df->unixsocket)) {
/* unix domain socket */
- struct sockaddr_un un;
-
- if (host->unixsocket->used > sizeof(un.sun_path) - 2) {
- log_error_write(srv, __FILE__, __LINE__, "sbsbsbs",
- "unixsocket is too long in:",
- da->key, "= (",
- da_ext->key, " => (",
- da_host->key, " ( ...");
-
+
+ if (df->unixsocket->used > UNIX_PATH_MAX - 2) {
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "path of the unixdomain socket is too large");
return HANDLER_ERROR;
}
} else {
/* tcp/ip */
-
- if (buffer_is_empty(host->host) &&
- buffer_is_empty(host->bin_path)) {
- log_error_write(srv, __FILE__, __LINE__, "sbsbsbs",
- "host or binpath have to be set in:",
- da->key, "= (",
- da_ext->key, " => (",
- da_host->key, " ( ...");
-
+
+ if (buffer_is_empty(df->host) &&
+ buffer_is_empty(df->bin_path)) {
+ log_error_write(srv, __FILE__, __LINE__, "sbbbs",
+ "missing key (string):",
+ da->key,
+ da_ext->key,
+ da_host->key,
+ "host");
+
return HANDLER_ERROR;
- } else if (host->port == 0) {
- log_error_write(srv, __FILE__, __LINE__, "sbsbsbs",
- "port has to be set in:",
- da->key, "= (",
- da_ext->key, " => (",
- da_host->key, " ( ...");
-
+ } else if (df->port == 0) {
+ log_error_write(srv, __FILE__, __LINE__, "sbbbs",
+ "missing key (short):",
+ da->key,
+ da_ext->key,
+ da_host->key,
+ "port");
return HANDLER_ERROR;
}
}
-
- if (!buffer_is_empty(host->bin_path)) {
+
+ if (!buffer_is_empty(df->bin_path)) {
/* a local socket + self spawning */
size_t pno;
+ /* HACK: just to make sure the adaptive spawing is disabled */
+ df->min_procs = df->max_procs;
+
+ if (df->min_procs > df->max_procs) df->max_procs = df->min_procs;
+ if (df->max_load_per_proc < 1) df->max_load_per_proc = 0;
+
if (s->debug) {
- log_error_write(srv, __FILE__, __LINE__, "ssbsdsbsd",
+ log_error_write(srv, __FILE__, __LINE__, "ssbsdsbsdsd",
"--- fastcgi spawning local",
- "\n\tproc:", host->bin_path,
- "\n\tport:", host->port,
- "\n\tsocket", host->unixsocket,
- "\n\tmax-procs:", host->max_procs);
+ "\n\tproc:", df->bin_path,
+ "\n\tport:", df->port,
+ "\n\tsocket", df->unixsocket,
+ "\n\tmin-procs:", df->min_procs,
+ "\n\tmax-procs:", df->max_procs);
}
-
- for (pno = 0; pno < host->max_procs; pno++) {
+
+ for (pno = 0; pno < df->min_procs; pno++) {
fcgi_proc *proc;
proc = fastcgi_process_init();
- proc->id = host->num_procs++;
- host->max_id++;
+ proc->id = df->num_procs++;
+ df->max_id++;
- if (buffer_is_empty(host->unixsocket)) {
- proc->port = host->port + pno;
+ if (buffer_is_empty(df->unixsocket)) {
+ proc->port = df->port + pno;
} else {
- buffer_copy_string_buffer(proc->unixsocket, host->unixsocket);
- buffer_append_string_len(proc->unixsocket, CONST_STR_LEN("-"));
- buffer_append_long(proc->unixsocket, pno);
+ buffer_copy_string_buffer(proc->socket, df->unixsocket);
+ buffer_append_string(proc->socket, "-");
+ buffer_append_long(proc->socket, pno);
}
-
+
if (s->debug) {
log_error_write(srv, __FILE__, __LINE__, "ssdsbsdsd",
"--- fastcgi spawning",
- "\n\tport:", host->port,
- "\n\tsocket", host->unixsocket,
- "\n\tcurrent:", pno, "/", host->max_procs);
+ "\n\tport:", df->port,
+ "\n\tsocket", df->unixsocket,
+ "\n\tcurrent:", pno, "/", df->min_procs);
}
-
- if (fcgi_spawn_connection(srv, p, host, proc)) {
+
+ if (fcgi_spawn_connection(srv, p, df, proc)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"[ERROR]: spawning fcgi failed.");
return HANDLER_ERROR;
}
-
- fastcgi_status_init(srv, p->statuskey, host, proc);
-
- proc->next = host->first;
- if (host->first) host->first->prev = proc;
-
- host->first = proc;
+
+ proc->next = df->first;
+ if (df->first) df->first->prev = proc;
+
+ df->first = proc;
}
} else {
- fcgi_proc *proc;
-
- proc = fastcgi_process_init();
- proc->id = host->num_procs++;
- host->max_id++;
- host->active_procs++;
- proc->state = PROC_STATE_RUNNING;
-
- if (buffer_is_empty(host->unixsocket)) {
- proc->port = host->port;
+ fcgi_proc *fp;
+
+ fp = fastcgi_process_init();
+ fp->id = df->num_procs++;
+ df->max_id++;
+ df->active_procs++;
+ fp->state = PROC_STATE_RUNNING;
+
+ if (buffer_is_empty(df->unixsocket)) {
+ fp->port = df->port;
} else {
- buffer_copy_string_buffer(proc->unixsocket, host->unixsocket);
+ buffer_copy_string_buffer(fp->socket, df->unixsocket);
}
-
- fastcgi_status_init(srv, p->statuskey, host, proc);
-
- host->first = proc;
-
- host->max_procs = 1;
+
+ df->first = fp;
+
+ df->min_procs = 1;
+ df->max_procs = 1;
}
-
+
if (!buffer_is_empty(fcgi_mode)) {
if (strcmp(fcgi_mode->ptr, "responder") == 0) {
- host->mode = FCGI_RESPONDER;
+ df->mode = FCGI_RESPONDER;
} else if (strcmp(fcgi_mode->ptr, "authorizer") == 0) {
- host->mode = FCGI_AUTHORIZER;
- if (buffer_is_empty(host->docroot)) {
+ df->mode = FCGI_AUTHORIZER;
+ if (buffer_is_empty(df->docroot)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"ERROR: docroot is required for authorizer mode.");
return HANDLER_ERROR;
@@ -1444,157 +1261,190 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
fcgi_mode, "(ignored, mode set to responder)");
}
}
-
+
/* if extension already exists, take it */
- fastcgi_extension_insert(s->exts, da_ext->key, host);
+ fastcgi_extension_insert(s->exts, da_ext->key, df);
}
}
}
}
-
+
buffer_free(fcgi_mode);
-
+
return HANDLER_GO_ON;
}
static int fcgi_set_state(server *srv, handler_ctx *hctx, fcgi_connection_state_t state) {
hctx->state = state;
hctx->state_timestamp = srv->cur_ts;
-
+
return 0;
}
-static void fcgi_connection_close(server *srv, handler_ctx *hctx) {
+static size_t fcgi_requestid_new(server *srv, plugin_data *p) {
+ size_t m = 0;
+ size_t i;
+ buffer_uint *r = &(p->fcgi_request_id);
+
+ UNUSED(srv);
+
+ for (i = 0; i < r->used; i++) {
+ if (r->ptr[i] > m) m = r->ptr[i];
+ }
+
+ if (r->size == 0) {
+ r->size = 16;
+ r->ptr = malloc(sizeof(*r->ptr) * r->size);
+ } else if (r->used == r->size) {
+ r->size += 16;
+ r->ptr = realloc(r->ptr, sizeof(*r->ptr) * r->size);
+ }
+
+ r->ptr[r->used++] = ++m;
+
+ return m;
+}
+
+static int fcgi_requestid_del(server *srv, plugin_data *p, size_t request_id) {
+ size_t i;
+ buffer_uint *r = &(p->fcgi_request_id);
+
+ UNUSED(srv);
+
+ for (i = 0; i < r->used; i++) {
+ if (r->ptr[i] == request_id) break;
+ }
+
+ if (i != r->used) {
+ /* found */
+
+ if (i != r->used - 1) {
+ r->ptr[i] = r->ptr[r->used - 1];
+ }
+ r->used--;
+ }
+
+ return 0;
+}
+
+void fcgi_connection_close(server *srv, handler_ctx *hctx) {
plugin_data *p;
connection *con;
-
+
if (NULL == hctx) return;
-
+
p = hctx->plugin_data;
con = hctx->remote_conn;
-
+
+ if (con->mode != p->id) {
+ WP();
+ return;
+ }
+
if (hctx->fd != -1) {
fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
fdevent_unregister(srv->ev, hctx->fd);
close(hctx->fd);
srv->cur_fds--;
}
+
+ if (hctx->request_id != 0) {
+ fcgi_requestid_del(srv, p, hctx->request_id);
+ }
if (hctx->host && hctx->proc) {
+ hctx->host->load--;
+
if (hctx->got_proc) {
/* after the connect the process gets a load */
- fcgi_proc_load_dec(srv, hctx);
-
+ hctx->proc->load--;
+
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "ssdsbsd",
- "released proc:",
- "pid:", hctx->proc->pid,
- "socket:", hctx->proc->connection_name,
- "load:", hctx->proc->load);
+ log_error_write(srv, __FILE__, __LINE__, "sddb",
+ "release proc:",
+ hctx->fd,
+ hctx->proc->pid, hctx->proc->socket);
}
}
- }
+ fcgi_proclist_sort_down(srv, hctx->host, hctx->proc);
+ }
- handler_ctx_free(srv, hctx);
- con->plugin_ctx[p->id] = NULL;
+
+ handler_ctx_free(hctx);
+ con->plugin_ctx[p->id] = NULL;
}
static int fcgi_reconnect(server *srv, handler_ctx *hctx) {
plugin_data *p = hctx->plugin_data;
-
- /* child died
- *
- * 1.
- *
+
+ /* child died
+ *
+ * 1.
+ *
* connect was ok, connection was accepted
* but the php accept loop checks after the accept if it should die or not.
- *
- * if yes we can only detect it at a write()
- *
+ *
+ * if yes we can only detect it at a write()
+ *
* next step is resetting this attemp and setup a connection again
- *
- * if we have more than 5 reconnects for the same request, die
- *
- * 2.
- *
+ *
+ * if we have more then 5 reconnects for the same request, die
+ *
+ * 2.
+ *
* we have a connection but the child died by some other reason
- *
+ *
*/
-
- if (hctx->fd != -1) {
- fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
- fdevent_unregister(srv->ev, hctx->fd);
- close(hctx->fd);
- srv->cur_fds--;
- hctx->fd = -1;
- }
-
+
+ fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
+ fdevent_unregister(srv->ev, hctx->fd);
+ close(hctx->fd);
+ srv->cur_fds--;
+
+ fcgi_requestid_del(srv, p, hctx->request_id);
+
fcgi_set_state(srv, hctx, FCGI_STATE_INIT);
-
+
hctx->request_id = 0;
hctx->reconnects++;
-
- if (p->conf.debug > 2) {
- if (hctx->proc) {
- log_error_write(srv, __FILE__, __LINE__, "sdb",
- "release proc for reconnect:",
- hctx->proc->pid, hctx->proc->connection_name);
- } else {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "release proc for reconnect:",
- hctx->host->unixsocket);
- }
- }
-
- if (hctx->proc && hctx->got_proc) {
- fcgi_proc_load_dec(srv, hctx);
+
+ if (p->conf.debug) {
+ log_error_write(srv, __FILE__, __LINE__, "sddb",
+ "release proc:",
+ hctx->fd,
+ hctx->proc->pid, hctx->proc->socket);
}
-
- /* perhaps another host gives us more luck */
- fcgi_host_reset(srv, hctx);
-
+
+ hctx->proc->load--;
+ fcgi_proclist_sort_down(srv, hctx->host, hctx->proc);
+
return 0;
}
static handler_t fcgi_connection_reset(server *srv, connection *con, void *p_d) {
plugin_data *p = p_d;
-
+
fcgi_connection_close(srv, con->plugin_ctx[p->id]);
-
+
return HANDLER_GO_ON;
}
static int fcgi_env_add(buffer *env, const char *key, size_t key_len, const char *val, size_t val_len) {
size_t len;
-
+
if (!key || !val) return -1;
-
+
len = key_len + val_len;
-
+
len += key_len > 127 ? 4 : 1;
len += val_len > 127 ? 4 : 1;
-
- if (env->used + len >= FCGI_MAX_LENGTH) {
- /**
- * we can't append more headers, ignore it
- */
- return -1;
- }
-
- /**
- * field length can be 31bit max
- *
- * HINT: this can't happen as FCGI_MAX_LENGTH is only 16bit
- */
- if (key_len > 0x7fffffff) key_len = 0x7fffffff;
- if (val_len > 0x7fffffff) val_len = 0x7fffffff;
-
+
buffer_prepare_append(env, len);
-
+
if (key_len > 127) {
env->ptr[env->used++] = ((key_len >> 24) & 0xff) | 0x80;
env->ptr[env->used++] = (key_len >> 16) & 0xff;
@@ -1603,7 +1453,7 @@ static int fcgi_env_add(buffer *env, const char *key, size_t key_len, const char
} else {
env->ptr[env->used++] = (key_len >> 0) & 0xff;
}
-
+
if (val_len > 127) {
env->ptr[env->used++] = ((val_len >> 24) & 0xff) | 0x80;
env->ptr[env->used++] = (val_len >> 16) & 0xff;
@@ -1612,18 +1462,16 @@ static int fcgi_env_add(buffer *env, const char *key, size_t key_len, const char
} else {
env->ptr[env->used++] = (val_len >> 0) & 0xff;
}
-
+
memcpy(env->ptr + env->used, key, key_len);
env->used += key_len;
memcpy(env->ptr + env->used, val, val_len);
env->used += val_len;
-
+
return 0;
}
static int fcgi_header(FCGI_Header * header, unsigned char type, size_t request_id, int contentLength, unsigned char paddingLength) {
- assert(contentLength <= FCGI_MAX_LENGTH);
-
header->version = FCGI_VERSION_1;
header->type = type;
header->requestIdB0 = request_id & 0xff;
@@ -1632,138 +1480,136 @@ static int fcgi_header(FCGI_Header * header, unsigned char type, size_t request_
header->contentLengthB1 = (contentLength >> 8) & 0xff;
header->paddingLength = paddingLength;
header->reserved = 0;
-
+
return 0;
}
+/**
+ *
+ * returns
+ * -1 error
+ * 0 connected
+ * 1 not connected yet
+ */
-typedef enum {
- CONNECTION_OK,
- CONNECTION_DELAYED, /* retry after event, take same host */
- CONNECTION_OVERLOADED, /* disable for 1 second, take another backend */
- CONNECTION_DEAD /* disable for 60 seconds, take another backend */
-} connection_result_t;
-
-static connection_result_t fcgi_establish_connection(server *srv, handler_ctx *hctx) {
+static int fcgi_establish_connection(server *srv, handler_ctx *hctx) {
struct sockaddr *fcgi_addr;
struct sockaddr_in fcgi_addr_in;
#ifdef HAVE_SYS_UN_H
struct sockaddr_un fcgi_addr_un;
#endif
socklen_t servlen;
-
+
fcgi_extension_host *host = hctx->host;
fcgi_proc *proc = hctx->proc;
int fcgi_fd = hctx->fd;
-
+
memset(&fcgi_addr, 0, sizeof(fcgi_addr));
-
- if (!buffer_is_empty(proc->unixsocket)) {
+
+ if (!buffer_is_empty(proc->socket)) {
#ifdef HAVE_SYS_UN_H
/* use the unix domain socket */
fcgi_addr_un.sun_family = AF_UNIX;
- strcpy(fcgi_addr_un.sun_path, proc->unixsocket->ptr);
+ strcpy(fcgi_addr_un.sun_path, proc->socket->ptr);
#ifdef SUN_LEN
servlen = SUN_LEN(&fcgi_addr_un);
#else
/* stevens says: */
- servlen = proc->unixsocket->used + sizeof(fcgi_addr_un.sun_family);
+ servlen = proc->socket->used - 1 + sizeof(fcgi_addr_un.sun_family);
#endif
fcgi_addr = (struct sockaddr *) &fcgi_addr_un;
-
- if (buffer_is_empty(proc->connection_name)) {
- /* on remote spawing we have to set the connection-name now */
- buffer_copy_string_len(proc->connection_name, CONST_STR_LEN("unix:"));
- buffer_append_string_buffer(proc->connection_name, proc->unixsocket);
- }
#else
- return CONNECTION_DEAD;
+ return -1;
#endif
} else {
fcgi_addr_in.sin_family = AF_INET;
- if (!buffer_is_empty(host->host)) {
- if (0 == inet_aton(host->host->ptr, &(fcgi_addr_in.sin_addr))) {
- log_error_write(srv, __FILE__, __LINE__, "sbs",
- "converting IP address failed for", host->host,
- "\nBe sure to specify an IP address here");
-
- return CONNECTION_DEAD;
- }
- } else {
- fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ if (0 == inet_aton(host->host->ptr, &(fcgi_addr_in.sin_addr))) {
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
+ "converting IP-adress failed for", host->host,
+ "\nBe sure to specify an IP address here");
+
+ return -1;
}
fcgi_addr_in.sin_port = htons(proc->port);
servlen = sizeof(fcgi_addr_in);
-
+
fcgi_addr = (struct sockaddr *) &fcgi_addr_in;
-
- if (buffer_is_empty(proc->connection_name)) {
- /* on remote spawing we have to set the connection-name now */
- buffer_copy_string_len(proc->connection_name, CONST_STR_LEN("tcp:"));
- if (!buffer_is_empty(host->host)) {
- buffer_append_string_buffer(proc->connection_name, host->host);
- } else {
- buffer_append_string_len(proc->connection_name, CONST_STR_LEN("localhost"));
- }
- buffer_append_string_len(proc->connection_name, CONST_STR_LEN(":"));
- buffer_append_long(proc->connection_name, proc->port);
- }
}
-
+
if (-1 == connect(fcgi_fd, fcgi_addr, servlen)) {
- if (errno == EINPROGRESS ||
+ if (errno == EINPROGRESS ||
errno == EALREADY ||
errno == EINTR) {
- if (hctx->conf.debug > 2) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "connect delayed; will continue later:", proc->connection_name);
+ if (hctx->conf.debug) {
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "connect delayed, will continue later:", fcgi_fd);
}
-
- return CONNECTION_DELAYED;
+
+ return 1;
} else if (errno == EAGAIN) {
- if (hctx->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sbsd",
- "This means that you have more incoming requests than your FastCGI backend can handle in parallel."
- "It might help to spawn more FastCGI backends or PHP children; if not, decrease server.max-connections."
- "The load for this FastCGI backend", proc->connection_name, "is", proc->load);
+#if 0
+ if(hctx->delayed == 0) {
+ log_error_write(srv, __FILE__, __LINE__, "sdsdsdb",
+ "need reconnect, will continue later:", fcgi_fd,
+ "reconnects:", hctx->reconnects,
+ "load:", host->load,
+ host->unixsocket);
}
-
- return CONNECTION_OVERLOADED;
+#endif
+ hctx->reconnects++;
+ return -1;
} else {
- log_error_write(srv, __FILE__, __LINE__, "sssb",
- "connect failed:",
- strerror(errno), "on",
- proc->connection_name);
+ log_error_write(srv, __FILE__, __LINE__, "sdsddb",
+ "connect failed:", fcgi_fd,
+ strerror(errno), errno,
+ proc->port, proc->socket);
- return CONNECTION_DEAD;
+#if 0
+ if (errno == EAGAIN) {
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "This means that the you have more incoming requests than your fastcgi-backend can handle in parallel. "
+ "Perhaps it helps to spawn more fastcgi backend or php-children, if not decrease server.max-connections."
+ "The load for this fastcgi backend is:", proc->load);
+ }
+#endif
+
+ return -1;
}
}
-
+#if 0
+ if(hctx->delayed == 1) {
+ log_error_write(srv, __FILE__, __LINE__, "sdsdsdb",
+ "reconnected:", fcgi_fd,
+ "reconnects:", hctx->reconnects,
+ "load:", host->load,
+ host->unixsocket);
+ }
+#endif
hctx->reconnects = 0;
if (hctx->conf.debug > 1) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"connect succeeded: ", fcgi_fd);
}
- return CONNECTION_OK;
+ return 0;
}
static int fcgi_env_add_request_headers(server *srv, connection *con, plugin_data *p) {
size_t i;
-
+
for (i = 0; i < con->request.headers->used; i++) {
data_string *ds;
-
+
ds = (data_string *)con->request.headers->data[i];
-
+
if (ds->value->used && ds->key->used) {
size_t j;
buffer_reset(srv->tmp_buf);
-
+
if (0 != strcasecmp(ds->key->ptr, "CONTENT-TYPE")) {
- buffer_copy_string_len(srv->tmp_buf, CONST_STR_LEN("HTTP_"));
+ BUFFER_COPY_STRING_CONST(srv->tmp_buf, "HTTP_");
srv->tmp_buf->used--;
}
-
+
buffer_prepare_append(srv->tmp_buf, ds->key->used + 2);
for (j = 0; j < ds->key->used - 1; j++) {
char c = '_';
@@ -1777,38 +1623,32 @@ static int fcgi_env_add_request_headers(server *srv, connection *con, plugin_dat
srv->tmp_buf->ptr[srv->tmp_buf->used++] = c;
}
srv->tmp_buf->ptr[srv->tmp_buf->used++] = '\0';
-
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_BUF_LEN(srv->tmp_buf), CONST_BUF_LEN(ds->value)),con);
+
+ fcgi_env_add(p->fcgi_env, CONST_BUF_LEN(srv->tmp_buf), CONST_BUF_LEN(ds->value));
}
}
-
+
for (i = 0; i < con->environment->used; i++) {
data_string *ds;
-
+
ds = (data_string *)con->environment->data[i];
-
+
if (ds->value->used && ds->key->used) {
size_t j;
buffer_reset(srv->tmp_buf);
-
+
buffer_prepare_append(srv->tmp_buf, ds->key->used + 2);
for (j = 0; j < ds->key->used - 1; j++) {
- char c = '_';
- if (light_isalpha(ds->key->ptr[j])) {
- /* upper-case */
- c = ds->key->ptr[j] & ~32;
- } else if (light_isdigit(ds->key->ptr[j])) {
- /* copy */
- c = ds->key->ptr[j];
- }
- srv->tmp_buf->ptr[srv->tmp_buf->used++] = c;
+ srv->tmp_buf->ptr[srv->tmp_buf->used++] =
+ isalpha((unsigned char)ds->key->ptr[j]) ?
+ toupper((unsigned char)ds->key->ptr[j]) : '_';
}
srv->tmp_buf->ptr[srv->tmp_buf->used++] = '\0';
-
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_BUF_LEN(srv->tmp_buf), CONST_BUF_LEN(ds->value)), con);
+
+ fcgi_env_add(p->fcgi_env, CONST_BUF_LEN(srv->tmp_buf), CONST_BUF_LEN(ds->value));
}
}
-
+
return 0;
}
@@ -1817,24 +1657,24 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
FCGI_BeginRequestRecord beginRecord;
FCGI_Header header;
buffer *b;
-
+
char buf[32];
const char *s;
#ifdef HAVE_IPV6
char b2[INET6_ADDRSTRLEN + 1];
#endif
-
+
plugin_data *p = hctx->plugin_data;
fcgi_extension_host *host= hctx->host;
connection *con = hctx->remote_conn;
server_socket *srv_sock = con->srv_socket;
-
+
sock_addr our_addr;
socklen_t our_addr_len;
-
+
/* send FCGI_BEGIN_REQUEST */
-
+
fcgi_header(&(beginRecord.header), FCGI_BEGIN_REQUEST, request_id, sizeof(beginRecord.body), 0);
beginRecord.body.roleB0 = host->mode;
beginRecord.body.roleB1 = 0;
@@ -1842,89 +1682,76 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
memset(beginRecord.body.reserved, 0, sizeof(beginRecord.body.reserved));
b = chunkqueue_get_append_buffer(hctx->wb);
-
+
buffer_copy_memory(b, (const char *)&beginRecord, sizeof(beginRecord));
-
+
/* send FCGI_PARAMS */
buffer_prepare_copy(p->fcgi_env, 1024);
- if (buffer_is_empty(con->conf.server_tag)) {
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC)),con)
- } else {
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag)),con)
- }
-
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
+
if (con->server_name->used) {
- size_t len = con->server_name->used - 1;
-
- if (con->server_name->ptr[0] == '[') {
- const char *colon = strstr(con->server_name->ptr, "]:");
- if (colon) len = (colon + 1) - con->server_name->ptr;
- } else {
- const char *colon = strchr(con->server_name->ptr, ':');
- if (colon) len = colon - con->server_name->ptr;
- }
-
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len),con)
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
} else {
#ifdef HAVE_IPV6
- s = inet_ntop(srv_sock->addr.plain.sa_family,
- srv_sock->addr.plain.sa_family == AF_INET6 ?
+ s = inet_ntop(srv_sock->addr.plain.sa_family,
+ srv_sock->addr.plain.sa_family == AF_INET6 ?
(const void *) &(srv_sock->addr.ipv6.sin6_addr) :
(const void *) &(srv_sock->addr.ipv4.sin_addr),
b2, sizeof(b2)-1);
#else
s = inet_ntoa(srv_sock->addr.ipv4.sin_addr);
#endif
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), s, strlen(s)),con)
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), s, strlen(s));
}
-
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("GATEWAY_INTERFACE"), CONST_STR_LEN("CGI/1.1")),con)
-
- LI_ltostr(buf,
+
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("GATEWAY_INTERFACE"), CONST_STR_LEN("CGI/1.1"));
+
+ ltostr(buf,
#ifdef HAVE_IPV6
ntohs(srv_sock->addr.plain.sa_family ? srv_sock->addr.ipv6.sin6_port : srv_sock->addr.ipv4.sin_port)
#else
ntohs(srv_sock->addr.ipv4.sin_port)
#endif
);
-
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_PORT"), buf, strlen(buf)),con)
-
+
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_PORT"), buf, strlen(buf));
+
/* get the server-side of the connection to the client */
our_addr_len = sizeof(our_addr);
-
+
if (-1 == getsockname(con->fd, &(our_addr.plain), &our_addr_len)) {
s = inet_ntop_cache_get_ip(srv, &(srv_sock->addr));
} else {
s = inet_ntop_cache_get_ip(srv, &(our_addr));
}
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_ADDR"), s, strlen(s)),con)
-
- LI_ltostr(buf,
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_ADDR"), s, strlen(s));
+
+ ltostr(buf,
#ifdef HAVE_IPV6
ntohs(con->dst_addr.plain.sa_family ? con->dst_addr.ipv6.sin6_port : con->dst_addr.ipv4.sin_port)
#else
ntohs(con->dst_addr.ipv4.sin_port)
#endif
);
-
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REMOTE_PORT"), buf, strlen(buf)),con)
-
+
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REMOTE_PORT"), buf, strlen(buf));
+
s = inet_ntop_cache_get_ip(srv, &(con->dst_addr));
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REMOTE_ADDR"), s, strlen(s)),con)
-
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REMOTE_ADDR"), s, strlen(s));
+
if (!buffer_is_empty(con->authed_user)) {
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REMOTE_USER"), CONST_BUF_LEN(con->authed_user)),con)
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REMOTE_USER"),
+ CONST_BUF_LEN(con->authed_user));
}
-
+
if (con->request.content_length > 0 && host->mode != FCGI_AUTHORIZER) {
/* CGI-SPEC 6.1.2 and FastCGI spec 6.3 */
-
+
/* request.content_length < SSIZE_MAX, see request.c */
- LI_ltostr(buf, con->request.content_length);
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("CONTENT_LENGTH"), buf, strlen(buf)),con)
+ ltostr(buf, con->request.content_length);
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("CONTENT_LENGTH"), buf, strlen(buf));
}
if (host->mode != FCGI_AUTHORIZER) {
@@ -1935,22 +1762,22 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
* For AUTHORIZER mode these headers should be omitted.
*/
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SCRIPT_NAME"), CONST_BUF_LEN(con->uri.path)),con)
-
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SCRIPT_NAME"), CONST_BUF_LEN(con->uri.path));
+
if (!buffer_is_empty(con->request.pathinfo)) {
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("PATH_INFO"), CONST_BUF_LEN(con->request.pathinfo)),con)
-
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("PATH_INFO"), CONST_BUF_LEN(con->request.pathinfo));
+
/* PATH_TRANSLATED is only defined if PATH_INFO is set */
-
+
if (!buffer_is_empty(host->docroot)) {
buffer_copy_string_buffer(p->path, host->docroot);
} else {
- buffer_copy_string_buffer(p->path, con->physical.basedir);
+ buffer_copy_string_buffer(p->path, con->physical.doc_root);
}
buffer_append_string_buffer(p->path, con->request.pathinfo);
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("PATH_TRANSLATED"), CONST_BUF_LEN(p->path)),con)
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("PATH_TRANSLATED"), CONST_BUF_LEN(p->path));
} else {
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("PATH_INFO"), CONST_STR_LEN("")),con)
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("PATH_INFO"), CONST_STR_LEN(""));
}
}
@@ -1963,29 +1790,29 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
*/
if (!buffer_is_empty(host->docroot)) {
- /*
- * rewrite SCRIPT_FILENAME
- *
+ /*
+ * rewrite SCRIPT_FILENAME
+ *
*/
-
+
buffer_copy_string_buffer(p->path, host->docroot);
buffer_append_string_buffer(p->path, con->uri.path);
-
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SCRIPT_FILENAME"), CONST_BUF_LEN(p->path)),con)
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(host->docroot)),con)
+
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SCRIPT_FILENAME"), CONST_BUF_LEN(p->path));
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(host->docroot));
} else {
buffer_copy_string_buffer(p->path, con->physical.path);
-
- /* cgi.fix_pathinfo need a broken SCRIPT_FILENAME to find out what PATH_INFO is itself
- *
+
+ /* cgi.fix_pathinfo need a broken SCRIPT_FILENAME to find out what PATH_INFO is itself
+ *
* see src/sapi/cgi_main.c, init_request_info()
*/
if (host->break_scriptfilename_for_php) {
buffer_append_string_buffer(p->path, con->request.pathinfo);
}
-
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SCRIPT_FILENAME"), CONST_BUF_LEN(p->path)),con)
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.basedir)),con)
+
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SCRIPT_FILENAME"), CONST_BUF_LEN(p->path));
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.doc_root));
}
if (host->strip_request_uri->used > 1) {
@@ -1993,54 +1820,57 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
/**
* /app1/index/list
*
- * stripping /app1 or /app1/ should lead to
+ * stripping /app1 or /app1/ should lead to
*
* /index/list
*
*/
if ('/' != host->strip_request_uri->ptr[host->strip_request_uri->used - 2]) {
/* fix the user-input to have / as last char */
- buffer_append_string_len(host->strip_request_uri, CONST_STR_LEN("/"));
+ buffer_append_string(host->strip_request_uri, "/");
}
if (con->request.orig_uri->used >= host->strip_request_uri->used &&
0 == strncmp(con->request.orig_uri->ptr, host->strip_request_uri->ptr, host->strip_request_uri->used - 1)) {
/* the left is the same */
- fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"),
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"),
con->request.orig_uri->ptr + (host->strip_request_uri->used - 2),
- con->request.orig_uri->used - (host->strip_request_uri->used - 2) - 1);
+ con->request.orig_uri->used - (host->strip_request_uri->used - 2));
} else {
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri)),con)
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri));
}
} else {
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri)),con)
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri));
}
if (!buffer_is_equal(con->request.uri, con->request.orig_uri)) {
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REDIRECT_URI"), CONST_BUF_LEN(con->request.uri)),con)
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REDIRECT_URI"), CONST_BUF_LEN(con->request.uri));
}
if (!buffer_is_empty(con->uri.query)) {
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("QUERY_STRING"), CONST_BUF_LEN(con->uri.query)),con)
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("QUERY_STRING"), CONST_BUF_LEN(con->uri.query));
} else {
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("QUERY_STRING"), CONST_STR_LEN("")),con)
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("QUERY_STRING"), CONST_STR_LEN(""));
}
-
+
s = get_http_method_name(con->request.http_method);
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_METHOD"), s, strlen(s)),con)
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REDIRECT_STATUS"), CONST_STR_LEN("200")),con) /* if php is compiled with --force-redirect */
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_METHOD"), s, strlen(s));
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REDIRECT_STATUS"), CONST_STR_LEN("200")); /* if php is compiled with --force-redirect */
s = get_http_version_name(con->request.http_version);
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_PROTOCOL"), s, strlen(s)),con)
-
- if (srv_sock->is_ssl || srv_sock->is_proxy_ssl) {
- FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("HTTPS"), CONST_STR_LEN("on")),con)
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_PROTOCOL"), s, strlen(s));
+
+#ifdef USE_OPENSSL
+ if (srv_sock->is_ssl) {
+ fcgi_env_add(p->fcgi_env, CONST_STR_LEN("HTTPS"), CONST_STR_LEN("on"));
}
-
- FCGI_ENV_ADD_CHECK(fcgi_env_add_request_headers(srv, con, p), con);
-
+#endif
+
+
+ fcgi_env_add_request_headers(srv, con, p);
+
fcgi_header(&(header), FCGI_PARAMS, request_id, p->fcgi_env->used, 0);
buffer_append_memory(b, (const char *)&header, sizeof(header));
buffer_append_memory(b, (const char *)p->fcgi_env->ptr, p->fcgi_env->used);
-
+
fcgi_header(&(header), FCGI_PARAMS, request_id, 0, 0);
buffer_append_memory(b, (const char *)&header, sizeof(header));
@@ -2058,9 +1888,9 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
off_t written = 0;
off_t weHave = 0;
- /* we announce toWrite octets
- * now take all the request_content chunks that we need to fill this request
- * */
+ /* we announce toWrite octects
+ * now take all the request_content chunk that we need to fill this request
+ * */
b = chunkqueue_get_append_buffer(hctx->wb);
fcgi_header(&(header), FCGI_STDIN, request_id, weWant, 0);
@@ -2068,12 +1898,12 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
hctx->wb->bytes_in += sizeof(header);
if (p->conf.debug > 10) {
- log_error_write(srv, __FILE__, __LINE__, "soso", "tosend:", offset, "/", req_cq->bytes_in);
+ fprintf(stderr, "%s.%d: tosend: %lld / %lld\n", __FILE__, __LINE__, offset, req_cq->bytes_in);
}
for (written = 0; written != weWant; ) {
if (p->conf.debug > 10) {
- log_error_write(srv, __FILE__, __LINE__, "soso", "chunk:", written, "/", weWant);
+ fprintf(stderr, "%s.%d: chunk: %lld / %lld\n", __FILE__, __LINE__, written, weWant);
}
switch (req_c->type) {
@@ -2083,14 +1913,16 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
if (weHave > weWant - written) weHave = weWant - written;
if (p->conf.debug > 10) {
- log_error_write(srv, __FILE__, __LINE__, "soSosOsb",
- "sending", weHave, "bytes from (",
- req_c->offset, "/", req_c->file.length, ")",
- req_c->file.name);
+ fprintf(stderr, "%s.%d: sending %lld bytes from (%lld / %lld) %s\n",
+ __FILE__, __LINE__,
+ weHave,
+ req_c->offset,
+ req_c->file.length,
+ req_c->file.name->ptr);
}
assert(weHave != 0);
-
+
chunkqueue_append_file(hctx->wb, req_c->file.name, req_c->offset, weHave);
req_c->offset += weHave;
@@ -2105,7 +1937,7 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
* - we reference the tempfile from the request-content-queue several times
* if the req_c is larger than FCGI_MAX_LENGTH
* - we can't simply cleanup the request-content-queue as soon as possible
- * as it would remove the tempfiles
+ * as it would remove the tempfiles
* - the idea is to 'steal' the tempfiles and attach the is_temp flag to the last
* referencing chunk of the fastcgi-write-queue
*
@@ -2115,7 +1947,7 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
chunk *c;
if (p->conf.debug > 10) {
- log_error_write(srv, __FILE__, __LINE__, "s", "next chunk");
+ fprintf(stderr, "%s.%d: next chunk\n", __FILE__, __LINE__);
}
c = hctx->wb->last;
@@ -2142,10 +1974,10 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
req_c->offset += weHave;
req_cq->bytes_out += weHave;
written += weHave;
-
+
hctx->wb->bytes_in += weHave;
- if (req_c->offset == (off_t) req_c->mem->used - 1) {
+ if (req_c->offset == req_c->mem->used - 1) {
chunkqueue_remove_finished_chunks(req_cq);
req_c = req_cq->first;
@@ -2156,12 +1988,12 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
break;
}
}
-
+
b->used++; /* add virtual \0 */
offset += weWant;
}
}
-
+
b = chunkqueue_get_append_buffer(hctx->wb);
/* terminate STDIN */
fcgi_header(&(header), FCGI_STDIN, request_id, 0, 0);
@@ -2170,53 +2002,65 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
hctx->wb->bytes_in += sizeof(header);
+#if 0
+ for (i = 0; i < hctx->write_buffer->used; i++) {
+ fprintf(stderr, "%02x ", hctx->write_buffer->ptr[i]);
+ if ((i+1) % 16 == 0) {
+ size_t j;
+ for (j = i-15; j <= i; j++) {
+ fprintf(stderr, "%c",
+ isprint((unsigned char)hctx->write_buffer->ptr[j]) ? hctx->write_buffer->ptr[j] : '.');
+ }
+ fprintf(stderr, "\n");
+ }
+ }
+#endif
+
return 0;
}
static int fcgi_response_parse(server *srv, connection *con, plugin_data *p, buffer *in) {
char *s, *ns;
-
+
handler_ctx *hctx = con->plugin_ctx[p->id];
fcgi_extension_host *host= hctx->host;
- int have_sendfile2 = 0;
- off_t sendfile2_content_length = 0;
-
+
UNUSED(srv);
buffer_copy_string_buffer(p->parse_response, in);
-
+
/* search for \n */
for (s = p->parse_response->ptr; NULL != (ns = strchr(s, '\n')); s = ns + 1) {
char *key, *value;
int key_len;
- data_string *ds = NULL;
-
+ data_string *ds;
+
/* a good day. Someone has read the specs and is sending a \r\n to us */
-
+
if (ns > p->parse_response->ptr &&
*(ns-1) == '\r') {
*(ns-1) = '\0';
}
-
+
ns[0] = '\0';
-
+
key = s;
if (NULL == (value = strchr(s, ':'))) {
/* we expect: "<key>: <value>\n" */
continue;
}
-
+
key_len = value - key;
-
+
value++;
/* strip WS */
while (*value == ' ' || *value == '\t') value++;
-
+
if (host->mode != FCGI_AUTHORIZER ||
!(con->http_status == 0 ||
con->http_status == 200)) {
/* authorizers shouldn't affect the response headers sent back to the client */
-
+
/* don't forward Status: */
if (0 != strncasecmp(key, "Status", key_len)) {
if (NULL == (ds = (data_string *)array_get_unused_element(con->response.headers, TYPE_STRING))) {
@@ -2224,11 +2068,11 @@ static int fcgi_response_parse(server *srv, connection *con, plugin_data *p, buf
}
buffer_copy_string_len(ds->key, key, key_len);
buffer_copy_string(ds->value, value);
-
+
array_insert_unique(con->response.headers, (data_unset *)ds);
}
}
-
+
switch(key_len) {
case 4:
if (0 == strncasecmp(key, "Date", key_len)) {
@@ -2252,97 +2096,11 @@ static int fcgi_response_parse(server *srv, connection *con, plugin_data *p, buf
con->parsed_response |= HTTP_CONNECTION;
}
break;
- case 11:
- if (host->allow_xsendfile && 0 == strncasecmp(key, "X-Sendfile2", key_len)&& hctx->send_content_body) {
- char *pos = value;
- have_sendfile2 = 1;
-
- while (*pos) {
- char *filename, *range;
- stat_cache_entry *sce;
- off_t begin_range, end_range, range_len;
-
- while (' ' == *pos) pos++;
- if (!*pos) break;
-
- filename = pos;
- if (NULL == (range = strchr(pos, ' '))) {
- /* missing range */
- if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "Couldn't find range after filename:", filename);
- }
- return 1;
- }
- buffer_copy_string_len(srv->tmp_buf, filename, range - filename);
-
- /* find end of range */
- for (pos = ++range; *pos && *pos != ' ' && *pos != ','; pos++) ;
-
- buffer_urldecode_path(srv->tmp_buf);
- if (HANDLER_ERROR == stat_cache_get_entry(srv, con, srv->tmp_buf, &sce)) {
- if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "send-file error: couldn't get stat_cache entry for X-Sendfile2:",
- srv->tmp_buf);
- }
- return 1;
- } else if (!S_ISREG(sce->st.st_mode)) {
- if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "send-file error: wrong filetype for X-Sendfile2:",
- srv->tmp_buf);
- }
- return 1;
- }
- /* found the file */
-
- /* parse range */
- begin_range = 0; end_range = sce->st.st_size - 1;
- {
- char *rpos = NULL;
- errno = 0;
- begin_range = strtoll(range, &rpos, 10);
- if (errno != 0 || begin_range < 0 || rpos == range) goto range_failed;
- if ('-' != *rpos++) goto range_failed;
- if (rpos != pos) {
- range = rpos;
- end_range = strtoll(range, &rpos, 10);
- if (errno != 0 || end_range < 0 || rpos == range) goto range_failed;
- }
- if (rpos != pos) goto range_failed;
-
- goto range_success;
-
-range_failed:
- if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "Couldn't decode range after filename:", filename);
- }
- return 1;
-
-range_success: ;
- }
-
- /* no parameters accepted */
-
- while (*pos == ' ') pos++;
- if (*pos != '\0' && *pos != ',') return 1;
-
- range_len = end_range - begin_range + 1;
- if (range_len < 0) return 1;
- if (range_len != 0) {
- http_chunk_append_file(srv, con, srv->tmp_buf, begin_range, range_len);
- }
- sendfile2_content_length += range_len;
-
- if (*pos == ',') pos++;
- }
- }
- break;
case 14:
if (0 == strncasecmp(key, "Content-Length", key_len)) {
con->response.content_length = strtol(value, NULL, 10);
con->parsed_response |= HTTP_CONTENT_LENGTH;
-
+
if (con->response.content_length < 0) con->response.content_length = 0;
}
break;
@@ -2350,38 +2108,18 @@ range_success: ;
break;
}
}
-
- if (have_sendfile2) {
- data_string *dcls;
-
- hctx->send_content_body = 0;
- joblist_append(srv, con);
-
- /* fix content-length */
- if (NULL == (dcls = (data_string *)array_get_unused_element(con->response.headers, TYPE_STRING))) {
- dcls = data_response_init();
- }
-
- buffer_copy_string_len(dcls->key, "Content-Length", sizeof("Content-Length")-1);
- buffer_copy_off_t(dcls->value, sendfile2_content_length);
- dcls = (data_string*) array_replace(con->response.headers, (data_unset *)dcls);
- if (dcls) dcls->free((data_unset*)dcls);
-
- con->parsed_response |= HTTP_CONTENT_LENGTH;
- con->response.content_length = sendfile2_content_length;
- }
-
+
/* CGI/1.1 rev 03 - 7.2.1.2 */
if ((con->parsed_response & HTTP_LOCATION) &&
!(con->parsed_response & HTTP_STATUS)) {
con->http_status = 302;
}
-
+
return 0;
}
typedef struct {
- buffer *b;
+ buffer *b;
size_t len;
int type;
int padding;
@@ -2390,8 +2128,8 @@ typedef struct {
static int fastcgi_get_packet(server *srv, handler_ctx *hctx, fastcgi_response_packet *packet) {
chunk * c;
- size_t offset;
- size_t toread;
+ size_t offset = 0;
+ size_t toread = 0;
FCGI_Header *header;
if (!hctx->rb->first) return -1;
@@ -2402,22 +2140,15 @@ static int fastcgi_get_packet(server *srv, handler_ctx *hctx, fastcgi_response_p
packet->padding = 0;
packet->request_id = 0;
- offset = 0; toread = 8;
/* get at least the FastCGI header */
for (c = hctx->rb->first; c; c = c->next) {
- size_t weHave = c->mem->used - c->offset - 1;
-
- if (weHave > toread) weHave = toread;
-
if (packet->b->used == 0) {
- buffer_copy_string_len(packet->b, c->mem->ptr + c->offset, weHave);
+ buffer_copy_string_len(packet->b, c->mem->ptr + c->offset, c->mem->used - c->offset - 1);
} else {
- buffer_append_string_len(packet->b, c->mem->ptr + c->offset, weHave);
+ buffer_append_string_len(packet->b, c->mem->ptr + c->offset, c->mem->used - c->offset - 1);
}
- toread -= weHave;
- offset = weHave; /* skip offset bytes in chunk for "real" data */
- if (0 == toread) break;
+ if (packet->b->used >= sizeof(*header) + 1) break;
}
if ((packet->b->used == 0) ||
@@ -2425,22 +2156,23 @@ static int fastcgi_get_packet(server *srv, handler_ctx *hctx, fastcgi_response_p
/* no header */
buffer_free(packet->b);
- if (hctx->plugin_data->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sdsds", "FastCGI: header too small:", packet->b->used, "bytes <", sizeof(FCGI_Header), "bytes, waiting for more data");
- }
+ log_error_write(srv, __FILE__, __LINE__, "s", "FastCGI: header to small");
return -1;
}
- /* we have at least a header, now check how much me have to fetch */
+ /* we have at least a header, now check how much me have to fetch */
header = (FCGI_Header *)(packet->b->ptr);
-
+
packet->len = (header->contentLengthB0 | (header->contentLengthB1 << 8)) + header->paddingLength;
packet->request_id = (header->requestIdB0 | (header->requestIdB1 << 8));
packet->type = header->type;
packet->padding = header->paddingLength;
+ /* the first bytes in packet->b are the header */
+ offset = sizeof(*header);
+
/* ->b should only be the content */
- buffer_copy_string_len(packet->b, CONST_STR_LEN("")); /* used == 1 */
+ buffer_copy_string(packet->b, ""); /* used == 1 */
if (packet->len) {
/* copy the content */
@@ -2449,15 +2181,15 @@ static int fastcgi_get_packet(server *srv, handler_ctx *hctx, fastcgi_response_p
size_t weHave = c->mem->used - c->offset - offset - 1;
if (weHave > weWant) weHave = weWant;
-
+
buffer_append_string_len(packet->b, c->mem->ptr + c->offset + offset, weHave);
- /* we only skipped the first bytes as they belonged to the fcgi header */
+ /* we only skipped the first 8 bytes as they are the fcgi header */
offset = 0;
}
if (packet->b->used < packet->len + 1) {
- /* we didn't get the full packet */
+ /* we didn't got the full packet */
buffer_free(packet->b);
return -1;
@@ -2481,7 +2213,7 @@ static int fastcgi_get_packet(server *srv, handler_ctx *hctx, fastcgi_response_p
}
chunkqueue_remove_finished_chunks(hctx->rb);
-
+
return 0;
}
@@ -2489,75 +2221,67 @@ static int fcgi_demux_response(server *srv, handler_ctx *hctx) {
int fin = 0;
int toread;
ssize_t r;
-
+
plugin_data *p = hctx->plugin_data;
connection *con = hctx->remote_conn;
int fcgi_fd = hctx->fd;
fcgi_extension_host *host= hctx->host;
fcgi_proc *proc = hctx->proc;
-
- /*
- * check how much we have to read
+
+ /*
+ * check how much we have to read
*/
if (ioctl(hctx->fd, FIONREAD, &toread)) {
- if (errno == EAGAIN) return 0;
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"unexpected end-of-file (perhaps the fastcgi process died):",
fcgi_fd);
return -1;
}
-
+
/* init read-buffer */
-
+
if (toread > 0) {
buffer *b;
- chunk *cq_first = hctx->rb->first;
- chunk *cq_last = hctx->rb->last;
b = chunkqueue_get_append_buffer(hctx->rb);
buffer_prepare_copy(b, toread + 1);
/* append to read-buffer */
if (-1 == (r = read(hctx->fd, b->ptr, toread))) {
- if (errno == EAGAIN) {
- /* roll back the last chunk allocation,
- and continue on next iteration */
- buffer_free(hctx->rb->last->mem);
- free(hctx->rb->last);
- hctx->rb->first = cq_first;
- hctx->rb->last = cq_last;
- return 0;
- }
- log_error_write(srv, __FILE__, __LINE__, "sds",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
"unexpected end-of-file (perhaps the fastcgi process died):",
fcgi_fd, strerror(errno));
return -1;
}
-
+
/* this should be catched by the b > 0 above */
assert(r);
b->used = r + 1; /* one extra for the fake \0 */
b->ptr[b->used - 1] = '\0';
} else {
- log_error_write(srv, __FILE__, __LINE__, "ssdsb",
+ log_error_write(srv, __FILE__, __LINE__, "ssdsdsd",
"unexpected end-of-file (perhaps the fastcgi process died):",
"pid:", proc->pid,
- "socket:", proc->connection_name);
-
+ "fcgi-fd:", fcgi_fd,
+ "remote-fd:", con->fd);
+
return -1;
}
/*
* parse the fastcgi packets and forward the content to the write-queue
*
- */
+ */
while (fin == 0) {
fastcgi_response_packet packet;
/* check if we have at least one packet */
if (0 != fastcgi_get_packet(srv, hctx, &packet)) {
/* no full packet */
+
+ hctx->delayed = 1;
+
break;
}
@@ -2570,9 +2294,9 @@ static int fcgi_demux_response(server *srv, handler_ctx *hctx) {
char *c;
size_t blen;
data_string *ds;
-
- /* search for header terminator
- *
+
+ /* search for header terminator
+ *
* if we start with \r\n check if last packet terminated with \r\n
* if we start with \n check if last packet terminated with \n
* search for \r\n\r\n
@@ -2599,12 +2323,7 @@ static int fcgi_demux_response(server *srv, handler_ctx *hctx) {
}
/* parse the response header */
- if (fcgi_response_parse(srv, con, p, hctx->response_header)) {
- con->http_status = 502;
- hctx->send_content_body = 0;
- con->file_started = 1;
- break;
- }
+ fcgi_response_parse(srv, con, p, hctx->response_header);
con->file_started = 1;
@@ -2615,41 +2334,21 @@ static int fcgi_demux_response(server *srv, handler_ctx *hctx) {
hctx->send_content_body = 0;
}
- if (host->allow_xsendfile && hctx->send_content_body &&
- (NULL != (ds = (data_string *) array_get_element(con->response.headers, "X-LIGHTTPD-send-file"))
- || NULL != (ds = (data_string *) array_get_element(con->response.headers, "X-Sendfile")))) {
+ if (host->allow_xsendfile &&
+ NULL != (ds = (data_string *) array_get_element(con->response.headers, "X-LIGHTTPD-send-file"))) {
stat_cache_entry *sce;
if (HANDLER_ERROR != stat_cache_get_entry(srv, con, ds->value, &sce)) {
- data_string *dcls;
- if (NULL == (dcls = (data_string *)array_get_unused_element(con->response.headers, TYPE_STRING))) {
- dcls = data_response_init();
- }
/* found */
+
http_chunk_append_file(srv, con, ds->value, 0, sce->st.st_size);
hctx->send_content_body = 0; /* ignore the content */
joblist_append(srv, con);
-
- buffer_copy_string_len(dcls->key, "Content-Length", sizeof("Content-Length")-1);
- buffer_copy_off_t(dcls->value, sce->st.st_size);
- dcls = (data_string*) array_replace(con->response.headers, (data_unset *)dcls);
- if (dcls) dcls->free((data_unset*)dcls);
-
- con->parsed_response |= HTTP_CONTENT_LENGTH;
- con->response.content_length = sce->st.st_size;
- } else {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "send-file error: couldn't get stat_cache entry for:",
- ds->value);
- con->http_status = 502;
- hctx->send_content_body = 0;
- con->file_started = 1;
- break;
}
}
-
- if (hctx->send_content_body && blen > 1) {
+
+ if (hctx->send_content_body && blen > 1) {
/* enable chunked-transfer-encoding */
if (con->request.http_version == HTTP_VERSION_1_1 &&
!(con->parsed_response & HTTP_CONTENT_LENGTH)) {
@@ -2671,410 +2370,456 @@ static int fcgi_demux_response(server *srv, handler_ctx *hctx) {
}
break;
case FCGI_STDERR:
- if (packet.len == 0) break;
-
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"FastCGI-stderr:", packet.b);
-
+
break;
case FCGI_END_REQUEST:
con->file_finished = 1;
-
+
if (host->mode != FCGI_AUTHORIZER ||
!(con->http_status == 0 ||
con->http_status == 200)) {
- /* send chunk-end if necessary */
+ /* send chunk-end if nesseary */
http_chunk_append_mem(srv, con, NULL, 0);
joblist_append(srv, con);
}
-
+
fin = 1;
break;
default:
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"FastCGI: header.type not handled: ", packet.type);
break;
}
buffer_free(packet.b);
}
-
+
return fin;
}
-static int fcgi_restart_dead_procs(server *srv, plugin_data *p, fcgi_extension_host *host) {
- fcgi_proc *proc;
+int fcgi_proclist_sort_up(server *srv, fcgi_extension_host *host, fcgi_proc *proc) {
+ fcgi_proc *p;
+
+ UNUSED(srv);
+
+ /* we have been the smallest of the current list
+ * and we want to insert the node sorted as soon
+ * possible
+ *
+ * 1 0 0 0 1 1 1
+ * | ^
+ * | |
+ * +------+
+ *
+ */
- for (proc = host->first; proc; proc = proc->next) {
- int status;
+ /* nothing to sort, only one element */
+ if (host->first == proc && proc->next == NULL) return 0;
- if (p->conf.debug > 2) {
- log_error_write(srv, __FILE__, __LINE__, "sbdddd",
- "proc:",
- proc->connection_name,
- proc->state,
- proc->is_local,
- proc->load,
- proc->pid);
- }
+ for (p = proc; p->next && p->next->load < proc->load; p = p->next);
- /*
- * if the remote side is overloaded, we check back after <n> seconds
- *
- */
- switch (proc->state) {
- case PROC_STATE_KILLED:
- case PROC_STATE_UNSET:
- /* this should never happen as long as adaptive spawing is disabled */
- assert(0);
+ /* no need to move something
+ *
+ * 1 2 2 2 3 3 3
+ * ^
+ * |
+ * +
+ *
+ */
+ if (p == proc) return 0;
- break;
- case PROC_STATE_RUNNING:
- break;
- case PROC_STATE_OVERLOADED:
- if (srv->cur_ts <= proc->disabled_until) break;
+ if (host->first == proc) {
+ /* we have been the first elememt */
- proc->state = PROC_STATE_RUNNING;
- host->active_procs++;
+ host->first = proc->next;
+ host->first->prev = NULL;
+ }
- log_error_write(srv, __FILE__, __LINE__, "sbdb",
- "fcgi-server re-enabled:",
- host->host, host->port,
- host->unixsocket);
- break;
- case PROC_STATE_DIED_WAIT_FOR_PID:
- /* non-local procs don't have PIDs to wait for */
- if (!proc->is_local) {
- proc->state = PROC_STATE_DIED;
- } else {
- /* the child should not terminate at all */
+ /* disconnect proc */
- for ( ;; ) {
- switch(waitpid(proc->pid, &status, WNOHANG)) {
- case 0:
- /* child is still alive */
- if (srv->cur_ts <= proc->disabled_until) break;
+ if (proc->prev) proc->prev->next = proc->next;
+ if (proc->next) proc->next->prev = proc->prev;
+
+ /* proc should be right of p */
+
+ proc->next = p->next;
+ proc->prev = p;
+ if (p->next) p->next->prev = proc;
+ p->next = proc;
+#if 0
+ for(p = host->first; p; p = p->next) {
+ log_error_write(srv, __FILE__, __LINE__, "dd",
+ p->pid, p->load);
+ }
+#else
+ UNUSED(srv);
+#endif
- proc->state = PROC_STATE_RUNNING;
- host->active_procs++;
+ return 0;
+}
- log_error_write(srv, __FILE__, __LINE__, "sbdb",
- "fcgi-server re-enabled:",
- host->host, host->port,
- host->unixsocket);
- break;
- case -1:
- if (errno == EINTR) continue;
+int fcgi_proclist_sort_down(server *srv, fcgi_extension_host *host, fcgi_proc *proc) {
+ fcgi_proc *p;
+
+ UNUSED(srv);
+
+ /* we have been the smallest of the current list
+ * and we want to insert the node sorted as soon
+ * possible
+ *
+ * 0 0 0 0 1 0 1
+ * ^ |
+ * | |
+ * +----------+
+ *
+ *
+ * the basic is idea is:
+ * - the last active fastcgi process should be still
+ * in ram and is not swapped out yet
+ * - processes that are not reused will be killed
+ * after some time by the trigger-handler
+ * - remember it as:
+ * everything > 0 is hot
+ * all unused procs are colder the more right they are
+ * ice-cold processes are propably unused since more
+ * than 'unused-timeout', are swaped out and won't be
+ * reused in the next seconds anyway.
+ *
+ */
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child died somehow, waitpid failed:",
- errno);
- proc->state = PROC_STATE_DIED;
- break;
- default:
- if (WIFEXITED(status)) {
+ /* nothing to sort, only one element */
+ if (host->first == proc && proc->next == NULL) return 0;
+
+ for (p = host->first; p != proc && p->load < proc->load; p = p->next);
+
+
+ /* no need to move something
+ *
+ * 1 2 2 2 3 3 3
+ * ^
+ * |
+ * +
+ *
+ */
+ if (p == proc) return 0;
+
+ /* we have to move left. If we are already the first element
+ * we are done */
+ if (host->first == proc) return 0;
+
+ /* release proc */
+ if (proc->prev) proc->prev->next = proc->next;
+ if (proc->next) proc->next->prev = proc->prev;
+
+ /* proc should be left of p */
+ proc->next = p;
+ proc->prev = p->prev;
+ if (p->prev) p->prev->next = proc;
+ p->prev = proc;
+
+ if (proc->prev == NULL) host->first = proc;
+#if 0
+ for(p = host->first; p; p = p->next) {
+ log_error_write(srv, __FILE__, __LINE__, "dd",
+ p->pid, p->load);
+ }
+#else
+ UNUSED(srv);
+#endif
+
+ return 0;
+}
+
+static int fcgi_restart_dead_procs(server *srv, plugin_data *p, fcgi_extension_host *host) {
+ fcgi_proc *proc;
+
+ for (proc = host->first; proc; proc = proc->next) {
+ if (p->conf.debug) {
+ log_error_write(srv, __FILE__, __LINE__, "sbdbdddd",
+ "proc:",
+ host->host, proc->port,
+ proc->socket,
+ proc->state,
+ proc->is_local,
+ proc->load,
+ proc->pid);
+ }
+
+ if (0 == proc->is_local) {
+ /*
+ * external servers might get disabled
+ *
+ * enable the server again, perhaps it is back again
+ */
+
+ if ((proc->state == PROC_STATE_DISABLED) &&
+ (srv->cur_ts - proc->disable_ts > host->disable_time)) {
+ proc->state = PROC_STATE_RUNNING;
+ host->active_procs++;
+
+ log_error_write(srv, __FILE__, __LINE__, "sbdb",
+ "fcgi-server re-enabled:",
+ host->host, host->port,
+ host->unixsocket);
+ }
+ } else {
+ /* the child should not terminate at all */
+ int status;
+
+ if (proc->state == PROC_STATE_DIED_WAIT_FOR_PID) {
+ switch(waitpid(proc->pid, &status, WNOHANG)) {
+ case 0:
+ /* child is still alive */
+ break;
+ case -1:
+ break;
+ default:
+ if (WIFEXITED(status)) {
#if 0
- log_error_write(srv, __FILE__, __LINE__, "sdsd",
+ log_error_write(srv, __FILE__, __LINE__, "sdsd",
"child exited, pid:", proc->pid,
"status:", WEXITSTATUS(status));
#endif
- } else if (WIFSIGNALED(status)) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child signaled:",
+ } else if (WIFSIGNALED(status)) {
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child signaled:",
WTERMSIG(status));
- } else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child died somehow:",
+ } else {
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child died somehow:",
status);
- }
-
- proc->state = PROC_STATE_DIED;
- break;
}
+
+ proc->state = PROC_STATE_DIED;
break;
}
}
-
- /* fall through if we have a dead proc now */
- if (proc->state != PROC_STATE_DIED) break;
-
- case PROC_STATE_DIED:
- /* local procs get restarted by us,
- * remote ones hopefully by the admin */
-
- if (!buffer_is_empty(host->bin_path)) {
- /* we still have connections bound to this proc,
- * let them terminate first */
- if (proc->load != 0) break;
-
+
+ /*
+ * local servers might died, but we restart them
+ *
+ */
+ if (proc->state == PROC_STATE_DIED &&
+ proc->load == 0) {
/* restart the child */
-
+
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "ssbsdsd",
+ log_error_write(srv, __FILE__, __LINE__, "ssdsbsdsd",
"--- fastcgi spawning",
- "\n\tsocket", proc->connection_name,
- "\n\tcurrent:", 1, "/", host->max_procs);
+ "\n\tport:", host->port,
+ "\n\tsocket", host->unixsocket,
+ "\n\tcurrent:", 1, "/", host->min_procs);
}
-
+
if (fcgi_spawn_connection(srv, p, host, proc)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"ERROR: spawning fcgi failed.");
return HANDLER_ERROR;
}
- } else {
- if (srv->cur_ts <= proc->disabled_until) break;
-
- proc->state = PROC_STATE_RUNNING;
- host->active_procs++;
-
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "fcgi-server re-enabled:",
- proc->connection_name);
+
+ fcgi_proclist_sort_down(srv, host, proc);
}
- break;
}
}
-
+
return 0;
}
+
static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
plugin_data *p = hctx->plugin_data;
fcgi_extension_host *host= hctx->host;
connection *con = hctx->remote_conn;
- fcgi_proc *proc;
-
+
int ret;
- /* sanity check:
- * - host != NULL
- * - either:
- * - tcp socket (do not check host->host->uses, as it may be not set which means INADDR_LOOPBACK)
- * - unix socket
- */
- if (!host) {
- log_error_write(srv, __FILE__, __LINE__, "s", "fatal error: host = NULL");
+ /* sanity check */
+ if (!host ||
+ ((!host->host->used || !host->port) && !host->unixsocket->used)) {
+ log_error_write(srv, __FILE__, __LINE__, "sxddd",
+ "write-req: error",
+ host,
+ host->host->used,
+ host->port,
+ host->unixsocket->used);
return HANDLER_ERROR;
}
- if ((!host->port && !host->unixsocket->used)) {
- log_error_write(srv, __FILE__, __LINE__, "s", "fatal error: neither host->port nor host->unixsocket is set");
- return HANDLER_ERROR;
- }
-
- /* we can't handle this in the switch as we have to fall through in it */
- if (hctx->state == FCGI_STATE_CONNECT_DELAYED) {
- int socket_error;
- socklen_t socket_error_len = sizeof(socket_error);
-
- /* try to finish the connect() */
- if (0 != getsockopt(hctx->fd, SOL_SOCKET, SO_ERROR, &socket_error, &socket_error_len)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "getsockopt failed:", strerror(errno));
-
- fcgi_host_disable(srv, hctx);
-
- return HANDLER_ERROR;
- }
- if (socket_error != 0) {
- if (!hctx->proc->is_local || p->conf.debug) {
- /* local procs get restarted */
-
- log_error_write(srv, __FILE__, __LINE__, "sssb",
- "establishing connection failed:", strerror(socket_error),
- "socket:", hctx->proc->connection_name);
- }
-
- fcgi_host_disable(srv, hctx);
- log_error_write(srv, __FILE__, __LINE__, "sdssdsd",
- "backend is overloaded; we'll disable it for", hctx->host->disable_time, "seconds and send the request to another backend instead:",
- "reconnects:", hctx->reconnects,
- "load:", host->load);
-
- fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc);
- buffer_append_string_len(p->statuskey, CONST_STR_LEN(".died"));
-
- status_counter_inc(srv, CONST_BUF_LEN(p->statuskey));
-
- return HANDLER_ERROR;
- }
- /* go on with preparing the request */
- hctx->state = FCGI_STATE_PREPARE_WRITE;
- }
-
+
switch(hctx->state) {
- case FCGI_STATE_CONNECT_DELAYED:
- /* should never happen */
- break;
case FCGI_STATE_INIT:
- /* do we have a running process for this host (max-procs) ? */
- hctx->proc = NULL;
-
- for (proc = hctx->host->first;
- proc && proc->state != PROC_STATE_RUNNING;
- proc = proc->next);
-
- /* all children are dead */
- if (proc == NULL) {
- hctx->fde_ndx = -1;
-
- return HANDLER_ERROR;
- }
-
- hctx->proc = proc;
-
- /* check the other procs if they have a lower load */
- for (proc = proc->next; proc; proc = proc->next) {
- if (proc->state != PROC_STATE_RUNNING) continue;
- if (proc->load < hctx->proc->load) hctx->proc = proc;
- }
-
ret = host->unixsocket->used ? AF_UNIX : AF_INET;
-
+
if (-1 == (hctx->fd = socket(ret, SOCK_STREAM, 0))) {
if (errno == EMFILE ||
errno == EINTR) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"wait for fd at connection:", con->fd);
-
+
return HANDLER_WAIT_FOR_FD;
}
-
- log_error_write(srv, __FILE__, __LINE__, "ssdd",
+
+ log_error_write(srv, __FILE__, __LINE__, "ssdd",
"socket failed:", strerror(errno), srv->cur_fds, srv->max_fds);
return HANDLER_ERROR;
}
hctx->fde_ndx = -1;
-
+
srv->cur_fds++;
-
+
fdevent_register(srv->ev, hctx->fd, fcgi_handle_fdevent, hctx);
-
+
if (-1 == fdevent_fcntl_set(srv->ev, hctx->fd)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "fcntl failed:", strerror(errno));
-
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "fcntl failed: ", strerror(errno));
+
return HANDLER_ERROR;
}
-
- if (hctx->proc->is_local) {
- hctx->pid = hctx->proc->pid;
- }
-
- switch (fcgi_establish_connection(srv, hctx)) {
- case CONNECTION_DELAYED:
- /* connection is in progress, wait for an event and call getsockopt() below */
-
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
-
- fcgi_set_state(srv, hctx, FCGI_STATE_CONNECT_DELAYED);
- return HANDLER_WAIT_FOR_EVENT;
- case CONNECTION_OVERLOADED:
- /* cool down the backend, it is overloaded
- * -> EAGAIN */
-
- if (hctx->host->disable_time) {
- log_error_write(srv, __FILE__, __LINE__, "sdssdsd",
- "backend is overloaded; we'll disable it for", hctx->host->disable_time, "seconds and send the request to another backend instead:",
- "reconnects:", hctx->reconnects,
- "load:", host->load);
-
- hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
- if (hctx->proc->state == PROC_STATE_RUNNING) hctx->host->active_procs--;
- hctx->proc->state = PROC_STATE_OVERLOADED;
+
+ /* fall through */
+ case FCGI_STATE_CONNECT:
+ if (hctx->state == FCGI_STATE_INIT || hctx->delayed == 1) {
+ for (hctx->proc = hctx->host->first;
+ hctx->proc && hctx->proc->state != PROC_STATE_RUNNING;
+ hctx->proc = hctx->proc->next);
+
+ /* all childs are dead */
+ if (hctx->proc == NULL) {
+ hctx->fde_ndx = -1;
+
+ return HANDLER_ERROR;
+ }
+
+ if (hctx->proc->is_local) {
+ hctx->pid = hctx->proc->pid;
+ }
+
+ switch (fcgi_establish_connection(srv, hctx)) {
+ case 1:
+ fcgi_set_state(srv, hctx, FCGI_STATE_CONNECT);
+
+ /* connection is in progress, wait for an event and call getsockopt() below */
+
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+
+ hctx->delayed = 0;
+ return HANDLER_WAIT_FOR_EVENT;
+ case -1:
+ /* if ECONNREFUSED/EAGAIN re-try connect() */
+
+ fcgi_set_state(srv, hctx, FCGI_STATE_CONNECT);
+ hctx->delayed = 1;
+ return HANDLER_WAIT_FOR_EVENT;
+ default:
+ /* everything is ok, go on */
+ break;
}
- fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc);
- buffer_append_string_len(p->statuskey, CONST_STR_LEN(".overloaded"));
-
- status_counter_inc(srv, CONST_BUF_LEN(p->statuskey));
-
- return HANDLER_ERROR;
- case CONNECTION_DEAD:
- /* we got a hard error from the backend like
- * - ECONNREFUSED for tcp-ip sockets
- * - ENOENT for unix-domain-sockets
- *
- * for check if the host is back in hctx->host->disable_time seconds
- * */
-
- fcgi_host_disable(srv, hctx);
-
- log_error_write(srv, __FILE__, __LINE__, "sdssdsd",
- "backend died; we'll disable it for", hctx->host->disable_time, "seconds and send the request to another backend instead:",
- "reconnects:", hctx->reconnects,
- "load:", host->load);
-
- fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc);
- buffer_append_string_len(p->statuskey, CONST_STR_LEN(".died"));
-
- status_counter_inc(srv, CONST_BUF_LEN(p->statuskey));
-
- return HANDLER_ERROR;
- case CONNECTION_OK:
- /* everything is ok, go on */
-
- fcgi_set_state(srv, hctx, FCGI_STATE_PREPARE_WRITE);
-
- break;
+ } else {
+ int socket_error;
+ socklen_t socket_error_len = sizeof(socket_error);
+
+ /* try to finish the connect() */
+ if (0 != getsockopt(hctx->fd, SOL_SOCKET, SO_ERROR, &socket_error, &socket_error_len)) {
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "getsockopt failed:", strerror(errno));
+
+ return HANDLER_ERROR;
+ }
+ if (socket_error != 0) {
+ if (!hctx->proc->is_local || p->conf.debug) {
+ /* local procs get restarted */
+
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "establishing connection failed:", strerror(socket_error),
+ "port:", hctx->proc->port);
+ }
+
+ return HANDLER_ERROR;
+ }
}
-
- case FCGI_STATE_PREPARE_WRITE:
+
/* ok, we have the connection */
-
- fcgi_proc_load_inc(srv, hctx);
+
+ hctx->proc->load++;
+ hctx->proc->last_used = srv->cur_ts;
hctx->got_proc = 1;
-
- status_counter_inc(srv, CONST_STR_LEN("fastcgi.requests"));
-
- fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc);
- buffer_append_string_len(p->statuskey, CONST_STR_LEN(".connected"));
-
- status_counter_inc(srv, CONST_BUF_LEN(p->statuskey));
-
+
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "ssdsbsd",
- "got proc:",
- "pid:", hctx->proc->pid,
- "socket:", hctx->proc->connection_name,
- "load:", hctx->proc->load);
+ log_error_write(srv, __FILE__, __LINE__, "sddbdd",
+ "got proc:",
+ hctx->fd,
+ hctx->proc->pid,
+ hctx->proc->socket,
+ hctx->proc->port,
+ hctx->proc->load);
}
/* move the proc-list entry down the list */
+ fcgi_proclist_sort_up(srv, hctx->host, hctx->proc);
+
if (hctx->request_id == 0) {
- hctx->request_id = 1; /* always use id 1 as we don't use multiplexing */
+ hctx->request_id = fcgi_requestid_new(srv, p);
} else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"fcgi-request is already in use:", hctx->request_id);
}
-
+
+ fcgi_set_state(srv, hctx, FCGI_STATE_PREPARE_WRITE);
/* fall through */
- if (-1 == fcgi_create_env(srv, hctx, hctx->request_id)) return HANDLER_ERROR;
+ case FCGI_STATE_PREPARE_WRITE:
+ fcgi_create_env(srv, hctx, hctx->request_id);
+
fcgi_set_state(srv, hctx, FCGI_STATE_WRITE);
+
/* fall through */
case FCGI_STATE_WRITE:
- ret = srv->network_backend_write(srv, con, hctx->fd, hctx->wb, MAX_WRITE_LIMIT);
+ ret = srv->network_backend_write(srv, con, hctx->fd, hctx->wb);
chunkqueue_remove_finished_chunks(hctx->wb);
-
+
if (ret < 0) {
switch(errno) {
- case EPIPE:
case ENOTCONN:
- case ECONNRESET:
- /* the connection got dropped after accept()
- * we don't care about that - if you accept() it, you have to handle it.
+ /* the connection got dropped after accept()
+ *
+ * this is most of the time a PHP which dies
+ * after PHP_FCGI_MAX_REQUESTS
+ *
+ */
+ if (hctx->wb->bytes_out == 0 &&
+ hctx->reconnects < 5) {
+ usleep(10000); /* take away the load of the webserver
+ * to let the php a chance to restart
+ */
+
+ fcgi_reconnect(srv, hctx);
+
+ return HANDLER_WAIT_FOR_FD;
+ }
+
+ /* not reconnected ... why
+ *
+ * far@#lighttpd report this for FreeBSD
+ *
*/
-
- log_error_write(srv, __FILE__, __LINE__, "ssosb",
- "connection was dropped after accept() (perhaps the fastcgi process died),",
+
+ log_error_write(srv, __FILE__, __LINE__, "ssdsd",
+ "[REPORT ME] connection was dropped after accept(). reconnect() denied:",
"write-offset:", hctx->wb->bytes_out,
- "socket:", hctx->proc->connection_name);
-
+ "reconnect attempts:", hctx->reconnects);
+
return HANDLER_ERROR;
+ case EAGAIN:
+ case EINTR:
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+
+ return HANDLER_WAIT_FOR_EVENT;
default:
- log_error_write(srv, __FILE__, __LINE__, "ssd",
+ log_error_write(srv, __FILE__, __LINE__, "ssd",
"write failed:", strerror(errno), errno);
-
+
return HANDLER_ERROR;
}
}
@@ -3082,11 +2827,11 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
if (hctx->wb->bytes_out == hctx->wb->bytes_in) {
/* we don't need the out event anymore */
fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
fcgi_set_state(srv, hctx, FCGI_STATE_READ);
} else {
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
-
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+
return HANDLER_WAIT_FOR_EVENT;
}
@@ -3098,115 +2843,106 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
log_error_write(srv, __FILE__, __LINE__, "s", "(debug) unknown state");
return HANDLER_ERROR;
}
-
+
return HANDLER_WAIT_FOR_EVENT;
}
-
-/* might be called on fdevent after a connect() is delay too
- * */
SUBREQUEST_FUNC(mod_fastcgi_handle_subrequest) {
plugin_data *p = p_d;
-
+
handler_ctx *hctx = con->plugin_ctx[p->id];
+ fcgi_proc *proc;
fcgi_extension_host *host;
-
+
if (NULL == hctx) return HANDLER_GO_ON;
-
+
/* not my job */
if (con->mode != p->id) return HANDLER_GO_ON;
-
- /* we don't have a host yet, choose one
- * -> this happens in the first round
- * and when the host died and we have to select a new one */
- if (hctx->host == NULL) {
- size_t k;
- int ndx, used = -1;
-
- /* check if the next server has no load. */
- ndx = hctx->ext->last_used_ndx + 1;
- if(ndx >= (int) hctx->ext->used || ndx < 0) ndx = 0;
- host = hctx->ext->hosts[ndx];
- if (host->load > 0) {
- /* get backend with the least load. */
- for (k = 0, ndx = -1; k < hctx->ext->used; k++) {
- host = hctx->ext->hosts[k];
-
- /* we should have at least one proc that can do something */
- if (host->active_procs == 0) continue;
-
- if (used == -1 || host->load < used) {
- used = host->load;
-
- ndx = k;
- }
- }
- }
-
- /* found a server */
- if (ndx == -1) {
- /* all hosts are down */
-
- fcgi_connection_close(srv, hctx);
-
- con->http_status = 500;
- con->mode = DIRECT;
-
- return HANDLER_FINISHED;
- }
-
- hctx->ext->last_used_ndx = ndx;
- host = hctx->ext->hosts[ndx];
-
- /*
- * if check-local is disabled, use the uri.path handler
- *
- */
-
- /* init handler-context */
-
- /* we put a connection on this host, move the other new connections to other hosts
- *
- * as soon as hctx->host is unassigned, decrease the load again */
- fcgi_host_assign(srv, hctx, host);
- hctx->proc = NULL;
- } else {
- host = hctx->host;
- }
-
+
/* ok, create the request */
switch(fcgi_write_request(srv, hctx)) {
case HANDLER_ERROR:
+ proc = hctx->proc;
host = hctx->host;
-
+
+#if 0
+ if (proc &&
+ 0 == proc->is_local &&
+ proc->state != PROC_STATE_DISABLED) {
+ /* only disable remote servers as we don't manage them*/
+
+ log_error_write(srv, __FILE__, __LINE__, "sbdb", "fcgi-server disabled:",
+ host->host,
+ proc->port,
+ proc->socket);
+
+ /* disable this server */
+ proc->disable_ts = srv->cur_ts;
+ proc->state = PROC_STATE_DISABLED;
+ host->active_procs--;
+ }
+#endif
+
if (hctx->state == FCGI_STATE_INIT ||
- hctx->state == FCGI_STATE_CONNECT_DELAYED) {
- fcgi_restart_dead_procs(srv, p, host);
-
- /* cleanup this request and let the request handler start this request again */
- if (hctx->reconnects < 5) {
- fcgi_reconnect(srv, hctx);
- joblist_append(srv, con); /* in case we come from the event-handler */
-
- return HANDLER_WAIT_FOR_FD;
- } else {
- fcgi_connection_close(srv, hctx);
+ hctx->state == FCGI_STATE_CONNECT) {
+ /* connect() or getsockopt() failed,
+ * restart the request-handling
+ */
+ if (proc && proc->is_local) {
- buffer_reset(con->physical.path);
- con->mode = DIRECT;
- con->http_status = 503;
- joblist_append(srv, con); /* in case we come from the event-handler */
+ if (p->conf.debug) {
+ log_error_write(srv, __FILE__, __LINE__, "sbdb", "connect() to fastcgi failed, restarting the request-handling:",
+ host->host,
+ proc->port,
+ proc->socket);
+ }
- return HANDLER_FINISHED;
+ /*
+ * several hctx might reference the same proc
+ *
+ * Only one of them should mark the proc as dead all the other
+ * ones should just take a new one.
+ *
+ * If a new proc was started with the old struct this might lead
+ * the mark a perfect proc as dead otherwise
+ *
+ */
+ if (proc->state == PROC_STATE_RUNNING &&
+ hctx->pid == proc->pid) {
+ proc->state = PROC_STATE_DIED_WAIT_FOR_PID;
+ }
}
- } else {
+ fcgi_restart_dead_procs(srv, p, host);
+
fcgi_connection_close(srv, hctx);
-
+
buffer_reset(con->physical.path);
con->mode = DIRECT;
- if (con->http_status != 400) con->http_status = 503;
joblist_append(srv, con); /* really ? */
+ /* mis-using HANDLER_WAIT_FOR_FD to break out of the loop
+ * and hope that the childs will be restarted
+ *
+ */
+
+ /* we might get into a LOOP here
+ *
+ * but how to handle this ?
+ *
+ * if we enter a endless loop, we will burn the CPU
+ *
+ * let this handle by the loop-detection
+ */
+
+ return HANDLER_WAIT_FOR_FD;
+ } else {
+ fcgi_connection_close(srv, hctx);
+
+ buffer_reset(con->physical.path);
+ con->mode = DIRECT;
+ con->http_status = 503;
+ joblist_append(srv, con); /* really ? */
+
return HANDLER_FINISHED;
}
case HANDLER_WAIT_FOR_EVENT:
@@ -3223,11 +2959,12 @@ SUBREQUEST_FUNC(mod_fastcgi_handle_subrequest) {
}
}
-static handler_t fcgi_handle_fdevent(server *srv, void *ctx, int revents) {
+static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents) {
+ server *srv = (server *)s;
handler_ctx *hctx = ctx;
connection *con = hctx->remote_conn;
plugin_data *p = hctx->plugin_data;
-
+
fcgi_proc *proc = hctx->proc;
fcgi_extension_host *host= hctx->host;
@@ -3237,39 +2974,37 @@ static handler_t fcgi_handle_fdevent(server *srv, void *ctx, int revents) {
case 0:
break;
case 1:
-
- if (host->mode == FCGI_AUTHORIZER &&
+
+ if (host->mode == FCGI_AUTHORIZER &&
(con->http_status == 200 ||
con->http_status == 0)) {
/*
- * If we are here in AUTHORIZER mode then a request for authorizer
- * was processed already, and status 200 has been returned. We need
- * now to handle authorized request.
+ * If we are here in AUTHORIZER mode then a request for autorizer
+ * was proceeded already, and status 200 has been returned. We need
+ * now to handle autorized request.
*/
buffer_copy_string_buffer(con->physical.doc_root, host->docroot);
- buffer_copy_string_buffer(con->physical.basedir, host->docroot);
-
+
buffer_copy_string_buffer(con->physical.path, host->docroot);
buffer_append_string_buffer(con->physical.path, con->uri.path);
fcgi_connection_close(srv, hctx);
-
+
con->mode = DIRECT;
- con->http_status = 0;
con->file_started = 1; /* fcgi_extension won't touch the request afterwards */
} else {
/* we are done */
fcgi_connection_close(srv, hctx);
}
-
+
joblist_append(srv, con);
return HANDLER_FINISHED;
case -1:
if (proc->pid && proc->state != PROC_STATE_DIED) {
int status;
-
+
/* only fetch the zombie if it is not already done */
-
+
switch(waitpid(proc->pid, &status, WNOHANG)) {
case 0:
/* child is still alive */
@@ -3279,60 +3014,60 @@ static handler_t fcgi_handle_fdevent(server *srv, void *ctx, int revents) {
default:
/* the child should not terminate at all */
if (WIFEXITED(status)) {
- log_error_write(srv, __FILE__, __LINE__, "sdsd",
+ log_error_write(srv, __FILE__, __LINE__, "sdsd",
"child exited, pid:", proc->pid,
"status:", WEXITSTATUS(status));
} else if (WIFSIGNALED(status)) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child signaled:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child signaled:",
WTERMSIG(status));
} else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child died somehow:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child died somehow:",
status);
}
-
+
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "ssbsdsd",
+ log_error_write(srv, __FILE__, __LINE__, "ssdsbsdsd",
"--- fastcgi spawning",
- "\n\tsocket", proc->connection_name,
- "\n\tcurrent:", 1, "/", host->max_procs);
+ "\n\tport:", host->port,
+ "\n\tsocket", host->unixsocket,
+ "\n\tcurrent:", 1, "/", host->min_procs);
}
-
+
if (fcgi_spawn_connection(srv, p, host, proc)) {
- /* respawning failed, retry later */
+ /* child died */
proc->state = PROC_STATE_DIED;
-
- log_error_write(srv, __FILE__, __LINE__, "s",
- "respawning failed, will retry later");
+ } else {
+ fcgi_proclist_sort_down(srv, host, proc);
}
-
+
break;
}
}
if (con->file_started == 0) {
- /* nothing has been sent out yet, try to use another child */
-
+ /* nothing has been send out yet, try to use another child */
+
if (hctx->wb->bytes_out == 0 &&
hctx->reconnects < 5) {
fcgi_reconnect(srv, hctx);
-
- log_error_write(srv, __FILE__, __LINE__, "ssbsBSBs",
- "response not received, request not sent",
- "on socket:", proc->connection_name,
- "for", con->uri.path, "?", con->uri.query, ", reconnecting");
-
+
+ log_error_write(srv, __FILE__, __LINE__, "ssdsd",
+ "response not sent, request not sent, reconnection.",
+ "connection-fd:", con->fd,
+ "fcgi-fd:", hctx->fd);
+
return HANDLER_WAIT_FOR_FD;
}
-
- log_error_write(srv, __FILE__, __LINE__, "sosbsBSBs",
- "response not received, request sent:", hctx->wb->bytes_out,
- "on socket:", proc->connection_name,
- "for", con->uri.path, "?", con->uri.query, ", closing connection");
-
+
+ log_error_write(srv, __FILE__, __LINE__, "sosdsd",
+ "response not sent, request sent:", hctx->wb->bytes_out,
+ "connection-fd:", con->fd,
+ "fcgi-fd:", hctx->fd);
+
fcgi_connection_close(srv, hctx);
-
+
connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
buffer_reset(con->physical.path);
con->http_status = 500;
@@ -3340,72 +3075,76 @@ static handler_t fcgi_handle_fdevent(server *srv, void *ctx, int revents) {
} else {
/* response might have been already started, kill the connection */
fcgi_connection_close(srv, hctx);
-
- log_error_write(srv, __FILE__, __LINE__, "ssbsBSBs",
- "response already sent out, but backend returned error",
- "on socket:", proc->connection_name,
- "for", con->uri.path, "?", con->uri.query, ", terminating connection");
-
+
+ log_error_write(srv, __FILE__, __LINE__, "ssdsd",
+ "response already sent out, termination connection",
+ "connection-fd:", con->fd,
+ "fcgi-fd:", hctx->fd);
+
connection_set_state(srv, con, CON_STATE_ERROR);
}
/* */
-
-
+
+
joblist_append(srv, con);
return HANDLER_FINISHED;
}
}
-
+
if (revents & FDEVENT_OUT) {
- if (hctx->state == FCGI_STATE_CONNECT_DELAYED ||
+ if (hctx->state == FCGI_STATE_CONNECT ||
hctx->state == FCGI_STATE_WRITE) {
/* we are allowed to send something out
- *
- * 1. in an unfinished connect() call
- * 2. in an unfinished write() call (long POST request)
+ *
+ * 1. in a unfinished connect() call
+ * 2. in a unfinished write() call (long POST request)
*/
return mod_fastcgi_handle_subrequest(srv, con, p);
} else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "got a FDEVENT_OUT and didn't know why:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "got a FDEVENT_OUT and didn't know why:",
hctx->state);
}
}
-
+
/* perhaps this issue is already handled */
if (revents & FDEVENT_HUP) {
- if (hctx->state == FCGI_STATE_CONNECT_DELAYED) {
+ if (hctx->state == FCGI_STATE_CONNECT) {
/* getoptsock will catch this one (right ?)
- *
- * if we are in connect we might get an EINPROGRESS
- * in the first call and an FDEVENT_HUP in the
+ *
+ * if we are in connect we might get a EINPROGRESS
+ * in the first call and a FDEVENT_HUP in the
* second round
- *
+ *
* FIXME: as it is a bit ugly.
- *
+ *
*/
return mod_fastcgi_handle_subrequest(srv, con, p);
} else if (hctx->state == FCGI_STATE_READ &&
hctx->proc->port == 0) {
/* FIXME:
- *
+ *
* ioctl says 8192 bytes to read from PHP and we receive directly a HUP for the socket
* even if the FCGI_FIN packet is not received yet
*/
} else {
- log_error_write(srv, __FILE__, __LINE__, "sBSbsbsd",
- "error: unexpected close of fastcgi connection for",
- con->uri.path, "?", con->uri.query,
- "(no fastcgi process on socket:", proc->connection_name, "?)",
+ log_error_write(srv, __FILE__, __LINE__, "sbSBSDSd",
+ "error: unexpected close of fastcgi connection for",
+ con->uri.path,
+ "(no fastcgi process on host: ",
+ host->host,
+ ", port: ",
+ host->port,
+ " ?)",
hctx->state);
-
+
connection_set_state(srv, con, CON_STATE_ERROR);
fcgi_connection_close(srv, hctx);
joblist_append(srv, con);
}
} else if (revents & FDEVENT_ERR) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"fcgi: got a FDEVENT_ERR. Don't know why.");
/* kill all connections to the fastcgi process */
@@ -3414,7 +3153,7 @@ static handler_t fcgi_handle_fdevent(server *srv, void *ctx, int revents) {
fcgi_connection_close(srv, hctx);
joblist_append(srv, con);
}
-
+
return HANDLER_FINISHED;
}
#define PATCH(x) \
@@ -3422,33 +3161,30 @@ static handler_t fcgi_handle_fdevent(server *srv, void *ctx, int revents) {
static int fcgi_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(exts);
PATCH(debug);
- PATCH(ext_mapping);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("fastcgi.server"))) {
PATCH(exts);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("fastcgi.debug"))) {
PATCH(debug);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("fastcgi.map-extensions"))) {
- PATCH(ext_mapping);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -3457,226 +3193,168 @@ static int fcgi_patch_connection(server *srv, connection *con, plugin_data *p) {
static handler_t fcgi_check_extension(server *srv, connection *con, void *p_d, int uri_path_handler) {
plugin_data *p = p_d;
size_t s_len;
+ int used = -1;
+ int ndx;
size_t k;
buffer *fn;
fcgi_extension *extension = NULL;
- fcgi_extension_host *host = NULL;
-
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
+
/* Possibly, we processed already this request */
if (con->file_started == 1) return HANDLER_GO_ON;
+
+ fn = con->uri.path;
- fn = uri_path_handler ? con->uri.path : con->physical.path;
-
- if (buffer_is_empty(fn)) return HANDLER_GO_ON;
-
+ if (fn->used == 0) {
+ return HANDLER_ERROR;
+ }
+
s_len = fn->used - 1;
-
+
fcgi_patch_connection(srv, con, p);
-
- /* fastcgi.map-extensions maps extensions to existing fastcgi.server entries
- *
- * fastcgi.map-extensions = ( ".php3" => ".php" )
- *
- * fastcgi.server = ( ".php" => ... )
- *
- * */
-
- /* check if extension-mapping matches */
- for (k = 0; k < p->conf.ext_mapping->used; k++) {
- data_string *ds = (data_string *)p->conf.ext_mapping->data[k];
+
+ /* check if extension matches */
+ for (k = 0; k < p->conf.exts->used; k++) {
size_t ct_len; /* length of the config entry */
-
- if (ds->key->used == 0) continue;
-
- ct_len = ds->key->used - 1;
-
+
+ extension = p->conf.exts->exts[k];
+
+ if (extension->key->used == 0) continue;
+
+ ct_len = extension->key->used - 1;
+
if (s_len < ct_len) continue;
-
- /* found a mapping */
- if (0 == strncmp(fn->ptr + s_len - ct_len, ds->key->ptr, ct_len)) {
- /* check if we know the extension */
-
- /* we can reuse k here */
- for (k = 0; k < p->conf.exts->used; k++) {
- extension = p->conf.exts->exts[k];
-
- if (buffer_is_equal(ds->value, extension->key)) {
- break;
- }
- }
-
- if (k == p->conf.exts->used) {
- /* found nothign */
- extension = NULL;
- }
+
+ /* check extension in the form "/fcgi_pattern" */
+ if (*(extension->key->ptr) == '/' && strncmp(fn->ptr, extension->key->ptr, ct_len) == 0) {
+ break;
+ } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
+ /* check extension in the form ".fcg" */
break;
}
}
-
- if (extension == NULL) {
- /* check if extension matches */
- for (k = 0; k < p->conf.exts->used; k++) {
- size_t ct_len; /* length of the config entry */
- fcgi_extension *ext = p->conf.exts->exts[k];
-
- if (ext->key->used == 0) continue;
-
- ct_len = ext->key->used - 1;
-
- /* check _url_ in the form "/fcgi_pattern" */
- if (ext->key->ptr[0] == '/') {
- if ((ct_len <= con->uri.path->used -1) &&
- (strncmp(con->uri.path->ptr, ext->key->ptr, ct_len) == 0)) {
- extension = ext;
- break;
- }
- } else if ((ct_len <= s_len) && (0 == strncmp(fn->ptr + s_len - ct_len, ext->key->ptr, ct_len))) {
- /* check extension in the form ".fcg" */
- extension = ext;
- break;
- }
- }
- /* extension doesn't match */
- if (NULL == extension) {
- return HANDLER_GO_ON;
- }
- }
-
- /* check if we have at least one server for this extension up and running */
- for (k = 0; k < extension->used; k++) {
- fcgi_extension_host *h = extension->hosts[k];
-
- /* we should have at least one proc that can do something */
- if (h->active_procs == 0) {
- continue;
- }
-
- /* we found one host that is alive */
- host = h;
- break;
+
+ /* extension doesn't match */
+ if (k == p->conf.exts->used) {
+ return HANDLER_GO_ON;
}
+
+ /* get best server */
+ for (k = 0, ndx = -1; k < extension->used; k++) {
+ fcgi_extension_host *host = extension->hosts[k];
+
+ /* we should have at least one proc that can do somthing */
+ if (host->active_procs == 0) continue;
- if (!host) {
- /* sorry, we don't have a server alive for this ext */
- buffer_reset(con->physical.path);
- con->http_status = 500;
-
- /* only send the 'no handler' once */
- if (!extension->note_is_sent) {
- extension->note_is_sent = 1;
-
- log_error_write(srv, __FILE__, __LINE__, "sBSbsbs",
- "all handlers for", con->uri.path, "?", con->uri.query,
- "on", extension->key,
- "are down.");
+ if (used == -1 || host->load < used) {
+ used = host->load;
+
+ ndx = k;
}
-
- return HANDLER_FINISHED;
}
-
- /* a note about no handler is not sent yet */
- extension->note_is_sent = 0;
-
- /*
- * if check-local is disabled, use the uri.path handler
- *
- */
-
- /* init handler-context */
- if (uri_path_handler) {
- if (host->check_local == 0) {
+
+ /* found a server */
+ if (ndx != -1) {
+ fcgi_extension_host *host = extension->hosts[ndx];
+
+ /*
+ * if check-local is disabled, use the uri.path handler
+ *
+ */
+
+ /* init handler-context */
+ if (uri_path_handler) {
+ if (host->check_local == 0) {
+ handler_ctx *hctx;
+ char *pathinfo;
+
+ hctx = handler_ctx_init();
+
+ hctx->remote_conn = con;
+ hctx->plugin_data = p;
+ hctx->host = host;
+ hctx->proc = NULL;
+
+ hctx->conf.exts = p->conf.exts;
+ hctx->conf.debug = p->conf.debug;
+
+ con->plugin_ctx[p->id] = hctx;
+
+ host->load++;
+
+ con->mode = p->id;
+
+ if (con->conf.log_request_handling) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "handling it in mod_fastcgi");
+ }
+
+ /* the prefix is the SCRIPT_NAME,
+ * everthing from start to the next slash
+ * this is important for check-local = "disable"
+ *
+ * if prefix = /admin.fcgi
+ *
+ * /admin.fcgi/foo/bar
+ *
+ * SCRIPT_NAME = /admin.fcgi
+ * PATH_INFO = /foo/bar
+ *
+ * if prefix = /fcgi-bin/
+ *
+ * /fcgi-bin/foo/bar
+ *
+ * SCRIPT_NAME = /fcgi-bin/foo
+ * PATH_INFO = /bar
+ *
+ */
+
+ /* the rewrite is only done for /prefix/? matches */
+ if (extension->key->ptr[0] == '/' &&
+ con->uri.path->used > extension->key->used &&
+ NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
+ /* rewrite uri.path and pathinfo */
+
+ buffer_copy_string(con->request.pathinfo, pathinfo);
+
+ con->uri.path->used -= con->request.pathinfo->used - 1;
+ con->uri.path->ptr[con->uri.path->used - 1] = '\0';
+ }
+ }
+ return HANDLER_GO_ON;
+ } else {
handler_ctx *hctx;
- char *pathinfo;
-
hctx = handler_ctx_init();
-
+
hctx->remote_conn = con;
hctx->plugin_data = p;
- hctx->proc = NULL;
- hctx->ext = extension;
-
-
+ hctx->host = host;
+ hctx->proc = NULL;
+
hctx->conf.exts = p->conf.exts;
hctx->conf.debug = p->conf.debug;
-
+
con->plugin_ctx[p->id] = hctx;
-
+
+ host->load++;
+
con->mode = p->id;
-
+
if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "handling it in mod_fastcgi");
- }
-
- /* do not split path info for authorizer */
- if (host->mode != FCGI_AUTHORIZER) {
- /* the prefix is the SCRIPT_NAME,
- * everything from start to the next slash
- * this is important for check-local = "disable"
- *
- * if prefix = /admin.fcgi
- *
- * /admin.fcgi/foo/bar
- *
- * SCRIPT_NAME = /admin.fcgi
- * PATH_INFO = /foo/bar
- *
- * if prefix = /fcgi-bin/
- *
- * /fcgi-bin/foo/bar
- *
- * SCRIPT_NAME = /fcgi-bin/foo
- * PATH_INFO = /bar
- *
- * if prefix = /, and fix-root-path-name is enable
- *
- * /fcgi-bin/foo/bar
- *
- * SCRIPT_NAME = /fcgi-bin/foo
- * PATH_INFO = /bar
- *
- */
-
- /* the rewrite is only done for /prefix/? matches */
- if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
- buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
- con->uri.path->used = 1;
- con->uri.path->ptr[con->uri.path->used - 1] = '\0';
- } else if (extension->key->ptr[0] == '/' &&
- con->uri.path->used > extension->key->used &&
- NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
- /* rewrite uri.path and pathinfo */
-
- buffer_copy_string(con->request.pathinfo, pathinfo);
-
- con->uri.path->used -= con->request.pathinfo->used - 1;
- con->uri.path->ptr[con->uri.path->used - 1] = '\0';
- }
+ log_error_write(srv, __FILE__, __LINE__, "s", "handling it in mod_fastcgi");
}
+
+ return HANDLER_GO_ON;
}
} else {
- handler_ctx *hctx;
- hctx = handler_ctx_init();
-
- hctx->remote_conn = con;
- hctx->plugin_data = p;
- hctx->proc = NULL;
- hctx->ext = extension;
-
- hctx->conf.exts = p->conf.exts;
- hctx->conf.debug = p->conf.debug;
-
- con->plugin_ctx[p->id] = hctx;
-
- con->mode = p->id;
-
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s", "handling it in mod_fastcgi");
- }
+ /* no handler found */
+ buffer_reset(con->physical.path);
+ con->http_status = 500;
+
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "no fcgi-handler found for:",
+ fn);
+
+ return HANDLER_FINISHED;
}
-
return HANDLER_GO_ON;
}
@@ -3693,19 +3371,19 @@ static handler_t fcgi_check_extension_2(server *srv, connection *con, void *p_d)
JOBLIST_FUNC(mod_fastcgi_handle_joblist) {
plugin_data *p = p_d;
handler_ctx *hctx = con->plugin_ctx[p->id];
-
+
if (hctx == NULL) return HANDLER_GO_ON;
if (hctx->fd != -1) {
switch (hctx->state) {
case FCGI_STATE_READ:
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
-
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+
break;
- case FCGI_STATE_CONNECT_DELAYED:
+ case FCGI_STATE_CONNECT:
case FCGI_STATE_WRITE:
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
-
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+
break;
case FCGI_STATE_INIT:
/* at reconnect */
@@ -3722,7 +3400,7 @@ JOBLIST_FUNC(mod_fastcgi_handle_joblist) {
static handler_t fcgi_connection_close_callback(server *srv, connection *con, void *p_d) {
plugin_data *p = p_d;
-
+
fcgi_connection_close(srv, con->plugin_ctx[p->id]);
return HANDLER_GO_ON;
@@ -3731,17 +3409,17 @@ static handler_t fcgi_connection_close_callback(server *srv, connection *con, vo
TRIGGER_FUNC(mod_fastcgi_handle_trigger) {
plugin_data *p = p_d;
size_t i, j, n;
-
-
+
+
/* perhaps we should kill a connect attempt after 10-15 seconds
- *
- * currently we wait for the TCP timeout which is 180 seconds on Linux
- *
- *
- *
+ *
+ * currently we wait for the TCP timeout which is on Linux 180 seconds
+ *
+ *
+ *
*/
- /* check all children if they are still up */
+ /* check all childs if they are still up */
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *conf;
@@ -3755,21 +3433,118 @@ TRIGGER_FUNC(mod_fastcgi_handle_trigger) {
fcgi_extension *ex;
ex = exts->exts[j];
-
+
for (n = 0; n < ex->used; n++) {
-
+
fcgi_proc *proc;
+ unsigned long sum_load = 0;
fcgi_extension_host *host;
-
+
host = ex->hosts[n];
-
+
fcgi_restart_dead_procs(srv, p, host);
-
+
+ for (proc = host->first; proc; proc = proc->next) {
+ sum_load += proc->load;
+ }
+
+ if (host->num_procs &&
+ host->num_procs < host->max_procs &&
+ (sum_load / host->num_procs) > host->max_load_per_proc) {
+ /* overload, spawn new child */
+ fcgi_proc *fp = NULL;
+
+ if (p->conf.debug) {
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "overload detected, spawning a new child");
+ }
+
+ for (fp = host->unused_procs; fp && fp->pid != 0; fp = fp->next);
+
+ if (fp) {
+ if (fp == host->unused_procs) host->unused_procs = fp->next;
+
+ if (fp->next) fp->next->prev = NULL;
+
+ host->max_id++;
+ } else {
+ fp = fastcgi_process_init();
+ fp->id = host->max_id++;
+ }
+
+ host->num_procs++;
+
+ if (buffer_is_empty(host->unixsocket)) {
+ fp->port = host->port + fp->id;
+ } else {
+ buffer_copy_string_buffer(fp->socket, host->unixsocket);
+ buffer_append_string(fp->socket, "-");
+ buffer_append_long(fp->socket, fp->id);
+ }
+
+ if (fcgi_spawn_connection(srv, p, host, fp)) {
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "ERROR: spawning fcgi failed.");
+ return HANDLER_ERROR;
+ }
+
+ fp->prev = NULL;
+ fp->next = host->first;
+ if (host->first) {
+ host->first->prev = fp;
+ }
+ host->first = fp;
+ }
+
+ for (proc = host->first; proc; proc = proc->next) {
+ if (proc->load != 0) break;
+ if (host->num_procs <= host->min_procs) break;
+ if (proc->pid == 0) continue;
+
+ if (srv->cur_ts - proc->last_used > host->idle_timeout) {
+ /* a proc is idling for a long time now,
+ * terminated it */
+
+ if (p->conf.debug) {
+ log_error_write(srv, __FILE__, __LINE__, "ssbsd",
+ "idle-timeout reached, terminating child:",
+ "socket:", proc->socket,
+ "pid", proc->pid);
+ }
+
+
+ if (proc->next) proc->next->prev = proc->prev;
+ if (proc->prev) proc->prev->next = proc->next;
+
+ if (proc->prev == NULL) host->first = proc->next;
+
+ proc->prev = NULL;
+ proc->next = host->unused_procs;
+
+ if (host->unused_procs) host->unused_procs->prev = proc;
+ host->unused_procs = proc;
+
+ kill(proc->pid, SIGTERM);
+
+ proc->state = PROC_STATE_KILLED;
+
+ log_error_write(srv, __FILE__, __LINE__, "ssbsd",
+ "killed:",
+ "socket:", proc->socket,
+ "pid", proc->pid);
+
+ host->num_procs--;
+
+ /* proc is now in unused, let the next second handle the next process */
+ break;
+ }
+ }
+
for (proc = host->unused_procs; proc; proc = proc->next) {
int status;
-
+
if (proc->pid == 0) continue;
-
+
switch (waitpid(proc->pid, &status, WNOHANG)) {
case 0:
/* child still running after timeout, good */
@@ -3777,10 +3552,10 @@ TRIGGER_FUNC(mod_fastcgi_handle_trigger) {
case -1:
if (errno != EINTR) {
/* no PID found ? should never happen */
- log_error_write(srv, __FILE__, __LINE__, "sddss",
+ log_error_write(srv, __FILE__, __LINE__, "sddss",
"pid ", proc->pid, proc->state,
"not found:", strerror(errno));
-
+
#if 0
if (errno == ECHILD) {
/* someone else has cleaned up for us */
@@ -3794,23 +3569,22 @@ TRIGGER_FUNC(mod_fastcgi_handle_trigger) {
/* the child should not terminate at all */
if (WIFEXITED(status)) {
if (proc->state != PROC_STATE_KILLED) {
- log_error_write(srv, __FILE__, __LINE__, "sdb",
- "child exited:",
- WEXITSTATUS(status), proc->connection_name);
+ log_error_write(srv, __FILE__, __LINE__, "sdb",
+ "child exited:",
+ WEXITSTATUS(status), proc->socket);
}
} else if (WIFSIGNALED(status)) {
if (WTERMSIG(status) != SIGTERM) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child signaled:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child signaled:",
WTERMSIG(status));
}
} else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child died somehow:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child died somehow:",
status);
}
proc->pid = 0;
- if (proc->state == PROC_STATE_RUNNING) host->active_procs--;
proc->state = PROC_STATE_UNSET;
host->max_id--;
}
@@ -3823,9 +3597,8 @@ TRIGGER_FUNC(mod_fastcgi_handle_trigger) {
}
-int mod_fastcgi_plugin_init(plugin *p);
int mod_fastcgi_plugin_init(plugin *p) {
- p->version = LIGHTTPD_VERSION_ID;
+ p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("fastcgi");
p->init = mod_fastcgi_init;
@@ -3838,8 +3611,8 @@ int mod_fastcgi_plugin_init(plugin *p) {
p->handle_subrequest = mod_fastcgi_handle_subrequest;
p->handle_joblist = mod_fastcgi_handle_joblist;
p->handle_trigger = mod_fastcgi_handle_trigger;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_flv_streaming.c b/src/mod_flv_streaming.c
deleted file mode 100644
index 7a100db..0000000
--- a/src/mod_flv_streaming.c
+++ /dev/null
@@ -1,277 +0,0 @@
-#include "base.h"
-#include "log.h"
-#include "buffer.h"
-#include "response.h"
-#include "http_chunk.h"
-#include "stat_cache.h"
-
-#include "plugin.h"
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* plugin config for all request/connections */
-
-typedef struct {
- array *extensions;
-} plugin_config;
-
-typedef struct {
- PLUGIN_DATA;
-
- buffer *query_str;
- array *get_params;
-
- plugin_config **config_storage;
-
- plugin_config conf;
-} plugin_data;
-
-/* init the plugin data */
-INIT_FUNC(mod_flv_streaming_init) {
- plugin_data *p;
-
- p = calloc(1, sizeof(*p));
-
- p->query_str = buffer_init();
- p->get_params = array_init();
-
- return p;
-}
-
-/* detroy the plugin data */
-FREE_FUNC(mod_flv_streaming_free) {
- plugin_data *p = p_d;
-
- UNUSED(srv);
-
- if (!p) return HANDLER_GO_ON;
-
- if (p->config_storage) {
- size_t i;
-
- for (i = 0; i < srv->config_context->used; i++) {
- plugin_config *s = p->config_storage[i];
-
- if (!s) continue;
-
- array_free(s->extensions);
-
- free(s);
- }
- free(p->config_storage);
- }
-
- buffer_free(p->query_str);
- array_free(p->get_params);
-
- free(p);
-
- return HANDLER_GO_ON;
-}
-
-/* handle plugin config and check values */
-
-SETDEFAULTS_FUNC(mod_flv_streaming_set_defaults) {
- plugin_data *p = p_d;
- size_t i = 0;
-
- config_values_t cv[] = {
- { "flv-streaming.extensions", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
- };
-
- if (!p) return HANDLER_ERROR;
-
- p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
- for (i = 0; i < srv->config_context->used; i++) {
- plugin_config *s;
-
- s = calloc(1, sizeof(plugin_config));
- s->extensions = array_init();
-
- cv[0].destination = s->extensions;
-
- p->config_storage[i] = s;
-
- if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
- return HANDLER_ERROR;
- }
- }
-
- return HANDLER_GO_ON;
-}
-
-#define PATCH(x) \
- p->conf.x = s->x;
-static int mod_flv_streaming_patch_connection(server *srv, connection *con, plugin_data *p) {
- size_t i, j;
- plugin_config *s = p->config_storage[0];
-
- PATCH(extensions);
-
- /* skip the first, the global context */
- for (i = 1; i < srv->config_context->used; i++) {
- data_config *dc = (data_config *)srv->config_context->data[i];
- s = p->config_storage[i];
-
- /* condition didn't match */
- if (!config_check_cond(srv, con, dc)) continue;
-
- /* merge config */
- for (j = 0; j < dc->value->used; j++) {
- data_unset *du = dc->value->data[j];
-
- if (buffer_is_equal_string(du->key, CONST_STR_LEN("flv-streaming.extensions"))) {
- PATCH(extensions);
- }
- }
- }
-
- return 0;
-}
-#undef PATCH
-
-static int split_get_params(array *get_params, buffer *qrystr) {
- size_t is_key = 1;
- size_t i;
- char *key = NULL, *val = NULL;
-
- key = qrystr->ptr;
-
- /* we need the \0 */
- for (i = 0; i < qrystr->used; i++) {
- switch(qrystr->ptr[i]) {
- case '=':
- if (is_key) {
- val = qrystr->ptr + i + 1;
-
- qrystr->ptr[i] = '\0';
-
- is_key = 0;
- }
-
- break;
- case '&':
- case '\0': /* fin symbol */
- if (!is_key) {
- data_string *ds;
- /* we need at least a = since the last & */
-
- /* terminate the value */
- qrystr->ptr[i] = '\0';
-
- if (NULL == (ds = (data_string *)array_get_unused_element(get_params, TYPE_STRING))) {
- ds = data_string_init();
- }
- buffer_copy_string_len(ds->key, key, strlen(key));
- buffer_copy_string_len(ds->value, val, strlen(val));
-
- array_insert_unique(get_params, (data_unset *)ds);
- }
-
- key = qrystr->ptr + i + 1;
- val = NULL;
- is_key = 1;
- break;
- }
- }
-
- return 0;
-}
-
-URIHANDLER_FUNC(mod_flv_streaming_path_handler) {
- plugin_data *p = p_d;
- int s_len;
- size_t k;
-
- UNUSED(srv);
-
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
- if (buffer_is_empty(con->physical.path)) return HANDLER_GO_ON;
-
- mod_flv_streaming_patch_connection(srv, con, p);
-
- s_len = con->physical.path->used - 1;
-
- for (k = 0; k < p->conf.extensions->used; k++) {
- data_string *ds = (data_string *)p->conf.extensions->data[k];
- int ct_len = ds->value->used - 1;
-
- if (ct_len > s_len) continue;
- if (ds->value->used == 0) continue;
-
- if (0 == strncmp(con->physical.path->ptr + s_len - ct_len, ds->value->ptr, ct_len)) {
- data_string *get_param;
- stat_cache_entry *sce = NULL;
- buffer *b;
- int start;
- char *err = NULL;
- /* if there is a start=[0-9]+ in the header use it as start,
- * otherwise send the full file */
-
- array_reset(p->get_params);
- buffer_copy_string_buffer(p->query_str, con->uri.query);
- split_get_params(p->get_params, p->query_str);
-
- if (NULL == (get_param = (data_string *)array_get_element(p->get_params, "start"))) {
- return HANDLER_GO_ON;
- }
-
- /* too short */
- if (get_param->value->used < 2) return HANDLER_GO_ON;
-
- /* check if it is a number */
- start = strtol(get_param->value->ptr, &err, 10);
- if (*err != '\0') {
- return HANDLER_GO_ON;
- }
-
- if (start <= 0) return HANDLER_GO_ON;
-
- /* check if start is > filesize */
- if (HANDLER_GO_ON != stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
- return HANDLER_GO_ON;
- }
-
- if (start > sce->st.st_size) {
- return HANDLER_GO_ON;
- }
-
- /* we are safe now, let's build a flv header */
- b = chunkqueue_get_append_buffer(con->write_queue);
- buffer_copy_string_len(b, CONST_STR_LEN("FLV\x1\x1\0\0\0\x9\0\0\0\x9"));
-
- http_chunk_append_file(srv, con, con->physical.path, start, sce->st.st_size - start);
-
- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("video/x-flv"));
-
- con->file_finished = 1;
-
- return HANDLER_FINISHED;
- }
- }
-
- /* not found */
- return HANDLER_GO_ON;
-}
-
-/* this function is called at dlopen() time and inits the callbacks */
-
-int mod_flv_streaming_plugin_init(plugin *p);
-int mod_flv_streaming_plugin_init(plugin *p) {
- p->version = LIGHTTPD_VERSION_ID;
- p->name = buffer_init_string("flv_streaming");
-
- p->init = mod_flv_streaming_init;
- p->handle_physical = mod_flv_streaming_path_handler;
- p->set_defaults = mod_flv_streaming_set_defaults;
- p->cleanup = mod_flv_streaming_free;
-
- p->data = NULL;
-
- return 0;
-}
diff --git a/src/mod_indexfile.c b/src/mod_indexfile.c
index c01da2f..4a784c6 100644
--- a/src/mod_indexfile.c
+++ b/src/mod_indexfile.c
@@ -1,3 +1,9 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -6,11 +12,6 @@
#include "stat_cache.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
/* plugin config for all request/connections */
typedef struct {
@@ -19,51 +20,51 @@ typedef struct {
typedef struct {
PLUGIN_DATA;
-
+
buffer *tmp_buf;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
/* init the plugin data */
INIT_FUNC(mod_indexfile_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->tmp_buf = buffer_init();
-
+
return p;
}
/* detroy the plugin data */
FREE_FUNC(mod_indexfile_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
-
+
array_free(s->indexfiles);
-
+
free(s);
}
free(p->config_storage);
}
-
+
buffer_free(p->tmp_buf);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -72,33 +73,33 @@ FREE_FUNC(mod_indexfile_free) {
SETDEFAULTS_FUNC(mod_indexfile_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "index-file.names", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "server.indexfiles", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->indexfiles = array_init();
-
+
cv[0].destination = s->indexfiles;
cv[1].destination = s->indexfiles; /* old name for [0] */
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
}
-
+
return HANDLER_GO_ON;
}
@@ -107,21 +108,21 @@ SETDEFAULTS_FUNC(mod_indexfile_set_defaults) {
static int mod_indexfile_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(indexfiles);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.indexfiles"))) {
PATCH(indexfiles);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("index-file.names"))) {
@@ -129,7 +130,7 @@ static int mod_indexfile_patch_connection(server *srv, connection *con, plugin_d
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -138,84 +139,81 @@ URIHANDLER_FUNC(mod_indexfile_subrequest) {
plugin_data *p = p_d;
size_t k;
stat_cache_entry *sce = NULL;
-
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
+
if (con->uri.path->used == 0) return HANDLER_GO_ON;
if (con->uri.path->ptr[con->uri.path->used - 2] != '/') return HANDLER_GO_ON;
-
+
mod_indexfile_patch_connection(srv, con, p);
-
+
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- handling the request as Indexfile");
log_error_write(srv, __FILE__, __LINE__, "sb", "URI :", con->uri.path);
}
-
+
/* indexfile */
for (k = 0; k < p->conf.indexfiles->used; k++) {
data_string *ds = (data_string *)p->conf.indexfiles->data[k];
-
+
if (ds->value && ds->value->ptr[0] == '/') {
- /* if the index-file starts with a prefix as use this file as
+ /* if the index-file starts with a prefix as use this file as
* index-generator */
buffer_copy_string_buffer(p->tmp_buf, con->physical.doc_root);
} else {
buffer_copy_string_buffer(p->tmp_buf, con->physical.path);
}
buffer_append_string_buffer(p->tmp_buf, ds->value);
-
+
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, p->tmp_buf, &sce)) {
if (errno == EACCES) {
con->http_status = 403;
buffer_reset(con->physical.path);
-
+
return HANDLER_FINISHED;
}
-
+
if (errno != ENOENT &&
errno != ENOTDIR) {
/* we have no idea what happend. let's tell the user so. */
-
+
con->http_status = 500;
-
+
log_error_write(srv, __FILE__, __LINE__, "ssbsb",
"file not found ... or so: ", strerror(errno),
con->uri.path,
"->", con->physical.path);
-
+
buffer_reset(con->physical.path);
-
+
return HANDLER_FINISHED;
}
continue;
}
-
+
/* rewrite uri.path to the real path (/ -> /index.php) */
buffer_append_string_buffer(con->uri.path, ds->value);
buffer_copy_string_buffer(con->physical.path, p->tmp_buf);
-
+
/* fce is already set up a few lines above */
-
+
return HANDLER_GO_ON;
}
-
+
/* not found */
return HANDLER_GO_ON;
}
/* this function is called at dlopen() time and inits the callbacks */
-int mod_indexfile_plugin_init(plugin *p);
int mod_indexfile_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("indexfile");
-
+
p->init = mod_indexfile_init;
p->handle_subrequest_start = mod_indexfile_subrequest;
p->set_defaults = mod_indexfile_set_defaults;
p->cleanup = mod_indexfile_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_magnet.c b/src/mod_magnet.c
deleted file mode 100644
index d10e3ff..0000000
--- a/src/mod_magnet.c
+++ /dev/null
@@ -1,1110 +0,0 @@
-#include "base.h"
-#include "log.h"
-#include "buffer.h"
-
-#include "plugin.h"
-
-#include "mod_magnet_cache.h"
-#include "response.h"
-#include "stat_cache.h"
-#include "status_counter.h"
-#include "etag.h"
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <setjmp.h>
-
-#ifdef HAVE_LUA_H
-#include <lua.h>
-#include <lauxlib.h>
-
-#define MAGNET_CONFIG_RAW_URL "magnet.attract-raw-url-to"
-#define MAGNET_CONFIG_PHYSICAL_PATH "magnet.attract-physical-path-to"
-#define MAGNET_RESTART_REQUEST 99
-
-/* plugin config for all request/connections */
-
-static jmp_buf exceptionjmp;
-
-typedef struct {
- array *url_raw;
- array *physical_path;
-} plugin_config;
-
-typedef struct {
- PLUGIN_DATA;
-
- script_cache *cache;
-
- buffer *encode_buf;
-
- plugin_config **config_storage;
-
- plugin_config conf;
-} plugin_data;
-
-/* init the plugin data */
-INIT_FUNC(mod_magnet_init) {
- plugin_data *p;
-
- p = calloc(1, sizeof(*p));
-
- p->cache = script_cache_init();
- p->encode_buf = buffer_init();
-
- return p;
-}
-
-/* detroy the plugin data */
-FREE_FUNC(mod_magnet_free) {
- plugin_data *p = p_d;
-
- UNUSED(srv);
-
- if (!p) return HANDLER_GO_ON;
-
- if (p->config_storage) {
- size_t i;
-
- for (i = 0; i < srv->config_context->used; i++) {
- plugin_config *s = p->config_storage[i];
-
- if (!s) continue;
-
- array_free(s->url_raw);
- array_free(s->physical_path);
-
- free(s);
- }
- free(p->config_storage);
- }
-
- script_cache_free(p->cache);
- buffer_free(p->encode_buf);
-
- free(p);
-
- return HANDLER_GO_ON;
-}
-
-/* handle plugin config and check values */
-
-SETDEFAULTS_FUNC(mod_magnet_set_defaults) {
- plugin_data *p = p_d;
- size_t i = 0;
-
- config_values_t cv[] = {
- { MAGNET_CONFIG_RAW_URL, NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { MAGNET_CONFIG_PHYSICAL_PATH, NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
- { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
- };
-
- if (!p) return HANDLER_ERROR;
-
- p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
- for (i = 0; i < srv->config_context->used; i++) {
- plugin_config *s;
-
- s = calloc(1, sizeof(plugin_config));
- s->url_raw = array_init();
- s->physical_path = array_init();
-
- cv[0].destination = s->url_raw;
- cv[1].destination = s->physical_path;
-
- p->config_storage[i] = s;
-
- if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
- return HANDLER_ERROR;
- }
- }
-
- return HANDLER_GO_ON;
-}
-
-#define PATCH(x) \
- p->conf.x = s->x;
-static int mod_magnet_patch_connection(server *srv, connection *con, plugin_data *p) {
- size_t i, j;
- plugin_config *s = p->config_storage[0];
-
- PATCH(url_raw);
- PATCH(physical_path);
-
- /* skip the first, the global context */
- for (i = 1; i < srv->config_context->used; i++) {
- data_config *dc = (data_config *)srv->config_context->data[i];
- s = p->config_storage[i];
-
- /* condition didn't match */
- if (!config_check_cond(srv, con, dc)) continue;
-
- /* merge config */
- for (j = 0; j < dc->value->used; j++) {
- data_unset *du = dc->value->data[j];
-
- if (buffer_is_equal_string(du->key, CONST_STR_LEN(MAGNET_CONFIG_RAW_URL))) {
- PATCH(url_raw);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(MAGNET_CONFIG_PHYSICAL_PATH))) {
- PATCH(physical_path);
- }
- }
- }
-
- return 0;
-}
-#undef PATCH
-
-/* See http://lua-users.org/wiki/GeneralizedPairsAndIpairs for implementation details. */
-
-/* Override the default pairs() function to allow us to use a __pairs metakey */
-static int magnet_pairs(lua_State *L) {
- luaL_checkany(L, 1);
-
- if (luaL_getmetafield(L, 1, "__pairs")) {
- lua_insert(L, 1);
- lua_call(L, lua_gettop(L) - 1, LUA_MULTRET);
- return lua_gettop(L);
- } else {
- lua_pushvalue(L, lua_upvalueindex(1));
- lua_insert(L, 1);
- lua_call(L, lua_gettop(L) - 1, LUA_MULTRET);
- return lua_gettop(L);
- }
-}
-
-/* Define a function that will iterate over an array* (in upval 1) using current position (upval 2) */
-static int magnet_array_next(lua_State *L) {
- data_unset *du;
- data_string *ds;
- data_integer *di;
-
- size_t pos = lua_tointeger(L, lua_upvalueindex(1));
- array *a = lua_touserdata(L, lua_upvalueindex(2));
-
- lua_settop(L, 0);
-
- if (pos >= a->used) return 0;
- if (NULL != (du = a->data[pos])) {
- if (du->key->used) {
- lua_pushlstring(L, du->key->ptr, du->key->used - 1);
- }
- else {
- lua_pushlstring(L, "", 0);
- }
- switch (du->type) {
- case TYPE_STRING:
- ds = (data_string *)du;
- if (ds->value && ds->value->used) {
- lua_pushlstring(L, ds->value->ptr, ds->value->used - 1);
- } else {
- lua_pushnil(L);
- }
- break;
- case TYPE_COUNT:
- case TYPE_INTEGER:
- di = (data_integer *)du;
- lua_pushinteger(L, di->value);
- break;
- default:
- lua_pushnil(L);
- break;
- }
-
- /* Update our positional upval to reflect our new current position */
- pos++;
- lua_pushinteger(L, pos);
- lua_replace(L, lua_upvalueindex(1));
-
- /* Returning 2 items on the stack (key, value) */
- return 2;
- }
- return 0;
-}
-
-/* Create the closure necessary to iterate over the array *a with the above function */
-static int magnet_array_pairs(lua_State *L, array *a) {
- lua_pushinteger(L, 0); /* Push our current pos (the start) into upval 1 */
- lua_pushlightuserdata(L, a); /* Push our array *a into upval 2 */
- lua_pushcclosure(L, magnet_array_next, 2); /* Push our new closure with 2 upvals */
- return 1;
-}
-
-static int magnet_print(lua_State *L) {
- const char *s = luaL_checkstring(L, 1);
- server *srv;
-
- lua_pushstring(L, "lighty.srv");
- lua_gettable(L, LUA_REGISTRYINDEX);
- srv = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "(lua-print)", s);
-
- return 0;
-}
-
-static int magnet_stat(lua_State *L) {
- const char *s = luaL_checkstring(L, 1);
- server *srv;
- connection *con;
- buffer sb;
- stat_cache_entry *sce = NULL;
-
- lua_pushstring(L, "lighty.srv");
- lua_gettable(L, LUA_REGISTRYINDEX);
- srv = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- lua_pushstring(L, "lighty.con");
- lua_gettable(L, LUA_REGISTRYINDEX);
- con = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- sb.ptr = (char *)s;
- sb.used = sb.size = strlen(s) + 1;
-
- if (HANDLER_GO_ON != stat_cache_get_entry(srv, con, &sb, &sce)) {
- lua_pushnil(L);
-
- return 1;
- }
-
- lua_newtable(L);
-
- lua_pushboolean(L, S_ISREG(sce->st.st_mode));
- lua_setfield(L, -2, "is_file");
-
- lua_pushboolean(L, S_ISDIR(sce->st.st_mode));
- lua_setfield(L, -2, "is_dir");
-
- lua_pushboolean(L, S_ISCHR(sce->st.st_mode));
- lua_setfield(L, -2, "is_char");
-
- lua_pushboolean(L, S_ISBLK(sce->st.st_mode));
- lua_setfield(L, -2, "is_block");
-
- lua_pushboolean(L, S_ISSOCK(sce->st.st_mode));
- lua_setfield(L, -2, "is_socket");
-
- lua_pushboolean(L, S_ISLNK(sce->st.st_mode));
- lua_setfield(L, -2, "is_link");
-
- lua_pushboolean(L, S_ISFIFO(sce->st.st_mode));
- lua_setfield(L, -2, "is_fifo");
-
- lua_pushinteger(L, sce->st.st_mtime);
- lua_setfield(L, -2, "st_mtime");
-
- lua_pushinteger(L, sce->st.st_ctime);
- lua_setfield(L, -2, "st_ctime");
-
- lua_pushinteger(L, sce->st.st_atime);
- lua_setfield(L, -2, "st_atime");
-
- lua_pushinteger(L, sce->st.st_uid);
- lua_setfield(L, -2, "st_uid");
-
- lua_pushinteger(L, sce->st.st_gid);
- lua_setfield(L, -2, "st_gid");
-
- lua_pushinteger(L, sce->st.st_size);
- lua_setfield(L, -2, "st_size");
-
- lua_pushinteger(L, sce->st.st_ino);
- lua_setfield(L, -2, "st_ino");
-
-
- if (!buffer_is_empty(sce->etag)) {
- /* we have to mutate the etag */
- buffer *b = buffer_init();
- etag_mutate(b, sce->etag);
-
- lua_pushlstring(L, b->ptr, b->used - 1);
- buffer_free(b);
- } else {
- lua_pushnil(L);
- }
- lua_setfield(L, -2, "etag");
-
- if (!buffer_is_empty(sce->content_type)) {
- lua_pushlstring(L, sce->content_type->ptr, sce->content_type->used - 1);
- } else {
- lua_pushnil(L);
- }
- lua_setfield(L, -2, "content-type");
-
- return 1;
-}
-
-
-static int magnet_atpanic(lua_State *L) {
- const char *s = luaL_checkstring(L, 1);
- server *srv;
-
- lua_pushstring(L, "lighty.srv");
- lua_gettable(L, LUA_REGISTRYINDEX);
- srv = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "(lua-atpanic)", s);
-
- longjmp(exceptionjmp, 1);
-}
-
-static int magnet_reqhdr_get(lua_State *L) {
- connection *con;
- data_string *ds;
-
- const char *key = luaL_checkstring(L, 2);
-
- lua_pushstring(L, "lighty.con");
- lua_gettable(L, LUA_REGISTRYINDEX);
- con = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- if (NULL != (ds = (data_string *)array_get_element(con->request.headers, key))) {
- if (ds->value->used) {
- lua_pushlstring(L, ds->value->ptr, ds->value->used - 1);
- } else {
- lua_pushnil(L);
- }
- } else {
- lua_pushnil(L);
- }
- return 1;
-}
-
-static int magnet_reqhdr_pairs(lua_State *L) {
- connection *con;
-
- lua_pushstring(L, "lighty.con");
- lua_gettable(L, LUA_REGISTRYINDEX);
- con = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- return magnet_array_pairs(L, con->request.headers);
-}
-
-static int magnet_status_get(lua_State *L) {
- data_integer *di;
- server *srv;
- size_t key_len = 0;
-
- const char *key = luaL_checklstring(L, 2, &key_len);
-
- lua_pushstring(L, "lighty.srv");
- lua_gettable(L, LUA_REGISTRYINDEX);
- srv = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- di = status_counter_get_counter(srv, key, key_len);
-
- lua_pushnumber(L, (double)di->value);
-
- return 1;
-}
-
-static int magnet_status_set(lua_State *L) {
- size_t key_len = 0;
- server *srv;
-
- const char *key = luaL_checklstring(L, 2, &key_len);
- int counter = luaL_checkint(L, 3);
-
- lua_pushstring(L, "lighty.srv");
- lua_gettable(L, LUA_REGISTRYINDEX);
- srv = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- status_counter_set(srv, key, key_len, counter);
-
- return 0;
-}
-
-static int magnet_status_pairs(lua_State *L) {
- server *srv;
-
- lua_pushstring(L, "lighty.srv");
- lua_gettable(L, LUA_REGISTRYINDEX);
- srv = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- return magnet_array_pairs(L, srv->status);
-}
-
-typedef struct {
- const char *name;
- enum {
- MAGNET_ENV_UNSET,
-
- MAGNET_ENV_PHYICAL_PATH,
- MAGNET_ENV_PHYICAL_REL_PATH,
- MAGNET_ENV_PHYICAL_DOC_ROOT,
-
- MAGNET_ENV_URI_PATH,
- MAGNET_ENV_URI_PATH_RAW,
- MAGNET_ENV_URI_SCHEME,
- MAGNET_ENV_URI_AUTHORITY,
- MAGNET_ENV_URI_QUERY,
-
- MAGNET_ENV_REQUEST_METHOD,
- MAGNET_ENV_REQUEST_URI,
- MAGNET_ENV_REQUEST_ORIG_URI,
- MAGNET_ENV_REQUEST_PATH_INFO,
- MAGNET_ENV_REQUEST_REMOTE_IP,
- MAGNET_ENV_REQUEST_PROTOCOL
- } type;
-} magnet_env_t;
-
-static const magnet_env_t magnet_env[] = {
- { "physical.path", MAGNET_ENV_PHYICAL_PATH },
- { "physical.rel-path", MAGNET_ENV_PHYICAL_REL_PATH },
- { "physical.doc-root", MAGNET_ENV_PHYICAL_DOC_ROOT },
-
- { "uri.path", MAGNET_ENV_URI_PATH },
- { "uri.path-raw", MAGNET_ENV_URI_PATH_RAW },
- { "uri.scheme", MAGNET_ENV_URI_SCHEME },
- { "uri.authority", MAGNET_ENV_URI_AUTHORITY },
- { "uri.query", MAGNET_ENV_URI_QUERY },
-
- { "request.method", MAGNET_ENV_REQUEST_METHOD },
- { "request.uri", MAGNET_ENV_REQUEST_URI },
- { "request.orig-uri", MAGNET_ENV_REQUEST_ORIG_URI },
- { "request.path-info", MAGNET_ENV_REQUEST_PATH_INFO },
- { "request.remote-ip", MAGNET_ENV_REQUEST_REMOTE_IP },
- { "request.protocol", MAGNET_ENV_REQUEST_PROTOCOL },
-
- { NULL, MAGNET_ENV_UNSET }
-};
-
-static buffer *magnet_env_get_buffer_by_id(server *srv, connection *con, int id) {
- buffer *dest = NULL;
-
- UNUSED(srv);
-
- /**
- * map all internal variables to lua
- *
- */
-
- switch (id) {
- case MAGNET_ENV_PHYICAL_PATH: dest = con->physical.path; break;
- case MAGNET_ENV_PHYICAL_REL_PATH: dest = con->physical.rel_path; break;
- case MAGNET_ENV_PHYICAL_DOC_ROOT: dest = con->physical.doc_root; break;
-
- case MAGNET_ENV_URI_PATH: dest = con->uri.path; break;
- case MAGNET_ENV_URI_PATH_RAW: dest = con->uri.path_raw; break;
- case MAGNET_ENV_URI_SCHEME: dest = con->uri.scheme; break;
- case MAGNET_ENV_URI_AUTHORITY: dest = con->uri.authority; break;
- case MAGNET_ENV_URI_QUERY: dest = con->uri.query; break;
-
- case MAGNET_ENV_REQUEST_METHOD:
- buffer_copy_string(srv->tmp_buf, get_http_method_name(con->request.http_method));
- dest = srv->tmp_buf;
- break;
- case MAGNET_ENV_REQUEST_URI: dest = con->request.uri; break;
- case MAGNET_ENV_REQUEST_ORIG_URI: dest = con->request.orig_uri; break;
- case MAGNET_ENV_REQUEST_PATH_INFO: dest = con->request.pathinfo; break;
- case MAGNET_ENV_REQUEST_REMOTE_IP: dest = con->dst_addr_buf; break;
- case MAGNET_ENV_REQUEST_PROTOCOL:
- buffer_copy_string(srv->tmp_buf, get_http_version_name(con->request.http_version));
- dest = srv->tmp_buf;
- break;
-
- case MAGNET_ENV_UNSET: break;
- }
-
- return dest;
-}
-
-static buffer *magnet_env_get_buffer(server *srv, connection *con, const char *key) {
- size_t i;
-
- for (i = 0; magnet_env[i].name; i++) {
- if (0 == strcmp(key, magnet_env[i].name)) break;
- }
-
- return magnet_env_get_buffer_by_id(srv, con, magnet_env[i].type);
-}
-
-static int magnet_env_get(lua_State *L) {
- server *srv;
- connection *con;
-
- const char *key = luaL_checkstring(L, 2);
- buffer *dest = NULL;
-
- lua_pushstring(L, "lighty.srv");
- lua_gettable(L, LUA_REGISTRYINDEX);
- srv = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- lua_pushstring(L, "lighty.con");
- lua_gettable(L, LUA_REGISTRYINDEX);
- con = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- dest = magnet_env_get_buffer(srv, con, key);
-
- if (dest && dest->used) {
- lua_pushlstring(L, dest->ptr, dest->used - 1);
- } else {
- lua_pushnil(L);
- }
-
- return 1;
-}
-
-static int magnet_env_set(lua_State *L) {
- server *srv;
- connection *con;
-
- const char *key = luaL_checkstring(L, 2);
- const char *val = luaL_checkstring(L, 3);
- buffer *dest = NULL;
-
- lua_pushstring(L, "lighty.srv");
- lua_gettable(L, LUA_REGISTRYINDEX);
- srv = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- lua_pushstring(L, "lighty.con");
- lua_gettable(L, LUA_REGISTRYINDEX);
- con = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- if (NULL != (dest = magnet_env_get_buffer(srv, con, key))) {
- buffer_copy_string(dest, val);
- } else {
- /* couldn't save */
-
- return luaL_error(L, "couldn't store '%s' in lighty.env[]", key);
- }
-
- return 0;
-}
-
-static int magnet_env_next(lua_State *L) {
- server *srv;
- connection *con;
- int pos = lua_tointeger(L, lua_upvalueindex(1));
-
- buffer *dest;
-
- lua_pushstring(L, "lighty.srv");
- lua_gettable(L, LUA_REGISTRYINDEX);
- srv = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- lua_pushstring(L, "lighty.con");
- lua_gettable(L, LUA_REGISTRYINDEX);
- con = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- lua_settop(L, 0);
-
- if (NULL == magnet_env[pos].name) return 0; /* end of list */
-
- lua_pushstring(L, magnet_env[pos].name);
-
- dest = magnet_env_get_buffer_by_id(srv, con, magnet_env[pos].type);
- if (dest && dest->used) {
- lua_pushlstring(L, dest->ptr, dest->used - 1);
- } else {
- lua_pushnil(L);
- }
-
- /* Update our positional upval to reflect our new current position */
- pos++;
- lua_pushinteger(L, pos);
- lua_replace(L, lua_upvalueindex(1));
-
- /* Returning 2 items on the stack (key, value) */
- return 2;
-}
-
-static int magnet_env_pairs(lua_State *L) {
- lua_pushinteger(L, 0); /* Push our current pos (the start) into upval 1 */
- lua_pushcclosure(L, magnet_env_next, 1); /* Push our new closure with 1 upvals */
- return 1;
-}
-
-static int magnet_cgi_get(lua_State *L) {
- connection *con;
- data_string *ds;
-
- const char *key = luaL_checkstring(L, 2);
-
- lua_pushstring(L, "lighty.con");
- lua_gettable(L, LUA_REGISTRYINDEX);
- con = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- if (NULL != (ds = (data_string *)array_get_element(con->environment, key)) && ds->value->used)
- lua_pushlstring(L, CONST_BUF_LEN(ds->value));
- else
- lua_pushnil(L);
-
- return 1;
-}
-
-static int magnet_cgi_set(lua_State *L) {
- connection *con;
-
- const char *key = luaL_checkstring(L, 2);
- const char *val = luaL_checkstring(L, 3);
-
- lua_pushstring(L, "lighty.con");
- lua_gettable(L, LUA_REGISTRYINDEX);
- con = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- array_set_key_value(con->environment, key, strlen(key), val, strlen(val));
-
- return 0;
-}
-
-static int magnet_cgi_pairs(lua_State *L) {
- connection *con;
-
- lua_pushstring(L, "lighty.con");
- lua_gettable(L, LUA_REGISTRYINDEX);
- con = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
- return magnet_array_pairs(L, con->environment);
-}
-
-
-static int magnet_copy_response_header(server *srv, connection *con, plugin_data *p, lua_State *L) {
- UNUSED(p);
- /**
- * get the environment of the function
- */
-
- lua_getfenv(L, -1); /* -1 is the function */
-
- /* lighty.header */
-
- lua_getfield(L, -1, "lighty"); /* lighty.* from the env */
- assert(lua_istable(L, -1));
-
- lua_getfield(L, -1, "header"); /* lighty.header */
- if (lua_istable(L, -1)) {
- /* header is found, and is a table */
-
- lua_pushnil(L);
- while (lua_next(L, -2) != 0) {
- if (lua_isstring(L, -1) && lua_isstring(L, -2)) {
- const char *key, *val;
- size_t key_len, val_len;
-
- key = lua_tolstring(L, -2, &key_len);
- val = lua_tolstring(L, -1, &val_len);
-
- response_header_overwrite(srv, con, key, key_len, val, val_len);
- }
-
- lua_pop(L, 1);
- }
- }
-
- lua_pop(L, 1); /* pop the header-table */
- lua_pop(L, 1); /* pop the lighty-env */
- lua_pop(L, 1); /* pop the function env */
-
- return 0;
-}
-
-/**
- * walk through the content array
- *
- * content = { "<pre>", { file = "/content" } , "</pre>" }
- *
- * header["Content-Type"] = "text/html"
- *
- * return 200
- */
-static int magnet_attach_content(server *srv, connection *con, plugin_data *p, lua_State *L) {
- UNUSED(p);
- /**
- * get the environment of the function
- */
-
- assert(lua_isfunction(L, -1));
- lua_getfenv(L, -1); /* -1 is the function */
-
- lua_getfield(L, -1, "lighty"); /* lighty.* from the env */
- assert(lua_istable(L, -1));
-
- lua_getfield(L, -1, "content"); /* lighty.content */
- if (lua_istable(L, -1)) {
- int i;
- /* header is found, and is a table */
-
- for (i = 1; ; i++) {
- lua_rawgeti(L, -1, i);
-
- /* -1 is the value and should be the value ... aka a table */
- if (lua_isstring(L, -1)) {
- size_t s_len = 0;
- const char *s = lua_tolstring(L, -1, &s_len);
-
- chunkqueue_append_mem(con->write_queue, s, s_len + 1);
- } else if (lua_istable(L, -1)) {
- lua_getfield(L, -1, "filename");
- lua_getfield(L, -2, "length");
- lua_getfield(L, -3, "offset");
-
- if (lua_isstring(L, -3)) { /* filename has to be a string */
- buffer *fn = buffer_init();
- stat_cache_entry *sce;
-
- buffer_copy_string(fn, lua_tostring(L, -3));
-
- if (HANDLER_GO_ON == stat_cache_get_entry(srv, con, fn, &sce)) {
- off_t off = 0;
- off_t len = 0;
-
- if (lua_isnumber(L, -1)) {
- off = lua_tonumber(L, -1);
- }
-
- if (lua_isnumber(L, -2)) {
- len = lua_tonumber(L, -2);
- } else {
- len = sce->st.st_size;
- }
-
- if (off < 0) {
- return luaL_error(L, "offset for '%s' is negative", fn->ptr);
- }
-
- if (len < off) {
- return luaL_error(L, "offset > length for '%s'", fn->ptr);
- }
-
- chunkqueue_append_file(con->write_queue, fn, off, len - off);
- }
-
- buffer_free(fn);
- } else {
- lua_pop(L, 3 + 2); /* correct the stack */
-
- return luaL_error(L, "content[%d] is a table and requires the field \"filename\"", i);
- }
-
- lua_pop(L, 3);
- } else if (lua_isnil(L, -1)) {
- /* oops, end of list */
-
- lua_pop(L, 1);
-
- break;
- } else {
- lua_pop(L, 4);
-
- return luaL_error(L, "content[%d] is neither a string nor a table: ", i);
- }
-
- lua_pop(L, 1); /* pop the content[...] table */
- }
- } else {
- return luaL_error(L, "lighty.content has to be a table");
- }
- lua_pop(L, 1); /* pop the header-table */
- lua_pop(L, 1); /* pop the lighty-table */
- lua_pop(L, 1); /* php the function env */
-
- return 0;
-}
-
-static int traceback (lua_State *L) {
- if (!lua_isstring(L, 1)) /* 'message' not a string? */
- return 1; /* keep it intact */
- lua_getfield(L, LUA_GLOBALSINDEX, "debug");
- if (!lua_istable(L, -1)) {
- lua_pop(L, 1);
- return 1;
- }
- lua_getfield(L, -1, "traceback");
- if (!lua_isfunction(L, -1)) {
- lua_pop(L, 2);
- return 1;
- }
- lua_pushvalue(L, 1); /* pass error message */
- lua_pushinteger(L, 2); /* skip this function and traceback */
- lua_call(L, 2, 1); /* call debug.traceback */
- return 1;
-}
-
-static int push_traceback(lua_State *L, int narg) {
- int base = lua_gettop(L) - narg; /* function index */
- lua_pushcfunction(L, traceback);
- lua_insert(L, base);
- return base;
-}
-
-static handler_t magnet_attract(server *srv, connection *con, plugin_data *p, buffer *name) {
- lua_State *L;
- int lua_return_value = -1;
- int errfunc;
- /* get the script-context */
-
-
- L = script_cache_get_script(srv, con, p->cache, name);
-
- if (lua_isstring(L, -1)) {
- log_error_write(srv, __FILE__, __LINE__,
- "sbss",
- "loading script",
- name,
- "failed:",
- lua_tostring(L, -1));
-
- lua_pop(L, 1);
-
- assert(lua_gettop(L) == 0); /* only the function should be on the stack */
-
- con->http_status = 500;
- con->mode = DIRECT;
-
- return HANDLER_FINISHED;
- }
-
- lua_pushstring(L, "lighty.srv");
- lua_pushlightuserdata(L, srv);
- lua_settable(L, LUA_REGISTRYINDEX); /* registery[<id>] = srv */
-
- lua_pushstring(L, "lighty.con");
- lua_pushlightuserdata(L, con);
- lua_settable(L, LUA_REGISTRYINDEX); /* registery[<id>] = con */
-
- lua_atpanic(L, magnet_atpanic);
-
- /**
- * we want to create empty environment for our script
- *
- * setmetatable({}, {__index = _G})
- *
- * if a function, symbol is not defined in our env, __index will lookup
- * in the global env.
- *
- * all variables created in the script-env will be thrown
- * away at the end of the script run.
- */
- lua_newtable(L); /* my empty environment aka {} (sp += 1) */
-
- /* we have to overwrite the print function */
- lua_pushcfunction(L, magnet_print); /* (sp += 1) */
- lua_setfield(L, -2, "print"); /* -1 is the env we want to set(sp -= 1) */
-
- /**
- * lighty.request[] has the HTTP-request headers
- * lighty.content[] is a table of string/file
- * lighty.header[] is a array to set response headers
- */
-
- lua_newtable(L); /* lighty.* (sp += 1) */
-
- lua_newtable(L); /* {} (sp += 1) */
- lua_newtable(L); /* the meta-table for the request-table (sp += 1) */
- lua_pushcfunction(L, magnet_reqhdr_get); /* (sp += 1) */
- lua_setfield(L, -2, "__index"); /* (sp -= 1) */
- lua_pushcfunction(L, magnet_reqhdr_pairs); /* (sp += 1) */
- lua_setfield(L, -2, "__pairs"); /* (sp -= 1) */
- lua_setmetatable(L, -2); /* tie the metatable to request (sp -= 1) */
- lua_setfield(L, -2, "request"); /* content = {} (sp -= 1) */
-
- lua_newtable(L); /* {} (sp += 1) */
- lua_newtable(L); /* the meta-table for the request-table (sp += 1) */
- lua_pushcfunction(L, magnet_env_get); /* (sp += 1) */
- lua_setfield(L, -2, "__index"); /* (sp -= 1) */
- lua_pushcfunction(L, magnet_env_set); /* (sp += 1) */
- lua_setfield(L, -2, "__newindex"); /* (sp -= 1) */
- lua_pushcfunction(L, magnet_env_pairs); /* (sp += 1) */
- lua_setfield(L, -2, "__pairs"); /* (sp -= 1) */
- lua_setmetatable(L, -2); /* tie the metatable to request (sp -= 1) */
- lua_setfield(L, -2, "env"); /* content = {} (sp -= 1) */
-
- lua_newtable(L); /* {} (sp += 1) */
- lua_newtable(L); /* the meta-table for the request-table (sp += 1) */
- lua_pushcfunction(L, magnet_cgi_get); /* (sp += 1) */
- lua_setfield(L, -2, "__index"); /* (sp -= 1) */
- lua_pushcfunction(L, magnet_cgi_set); /* (sp += 1) */
- lua_setfield(L, -2, "__newindex"); /* (sp -= 1) */
- lua_pushcfunction(L, magnet_cgi_pairs); /* (sp += 1) */
- lua_setfield(L, -2, "__pairs"); /* (sp -= 1) */
- lua_setmetatable(L, -2); /* tie the metatable to req_env (sp -= 1) */
- lua_setfield(L, -2, "req_env"); /* content = {} (sp -= 1) */
-
- lua_newtable(L); /* {} (sp += 1) */
- lua_newtable(L); /* the meta-table for the request-table (sp += 1) */
- lua_pushcfunction(L, magnet_status_get); /* (sp += 1) */
- lua_setfield(L, -2, "__index"); /* (sp -= 1) */
- lua_pushcfunction(L, magnet_status_set); /* (sp += 1) */
- lua_setfield(L, -2, "__newindex"); /* (sp -= 1) */
- lua_pushcfunction(L, magnet_status_pairs); /* (sp += 1) */
- lua_setfield(L, -2, "__pairs"); /* (sp -= 1) */
- lua_setmetatable(L, -2); /* tie the metatable to request (sp -= 1) */
- lua_setfield(L, -2, "status"); /* content = {} (sp -= 1) */
-
- /* add empty 'content' and 'header' tables */
- lua_newtable(L); /* {} (sp += 1) */
- lua_setfield(L, -2, "content"); /* content = {} (sp -= 1) */
-
- lua_newtable(L); /* {} (sp += 1) */
- lua_setfield(L, -2, "header"); /* header = {} (sp -= 1) */
-
- lua_pushinteger(L, MAGNET_RESTART_REQUEST);
- lua_setfield(L, -2, "RESTART_REQUEST");
-
- lua_pushcfunction(L, magnet_stat); /* (sp += 1) */
- lua_setfield(L, -2, "stat"); /* -1 is the env we want to set (sp -= 1) */
-
- lua_setfield(L, -2, "lighty"); /* lighty.* (sp -= 1) */
-
- /* override the default pairs() function to our __pairs capable version */
- lua_getglobal(L, "pairs"); /* push original pairs() (sp += 1) */
- lua_pushcclosure(L, magnet_pairs, 1);
- lua_setfield(L, -2, "pairs"); /* (sp -= 1) */
-
- lua_newtable(L); /* the meta-table for the new env (sp += 1) */
- lua_pushvalue(L, LUA_GLOBALSINDEX); /* (sp += 1) */
- lua_setfield(L, -2, "__index"); /* { __index = _G } (sp -= 1) */
- lua_setmetatable(L, -2); /* setmetatable({}, {__index = _G}) (sp -= 1) */
-
-
- lua_setfenv(L, -2); /* on the stack should be a modified env (sp -= 1) */
-
- errfunc = push_traceback(L, 0);
- if (lua_pcall(L, 0, 1, errfunc)) {
- lua_remove(L, errfunc);
- log_error_write(srv, __FILE__, __LINE__,
- "ss",
- "lua_pcall():",
- lua_tostring(L, -1));
- lua_pop(L, 1); /* remove the error-msg and the function copy from the stack */
-
- assert(lua_gettop(L) == 1); /* only the function should be on the stack */
-
- con->http_status = 500;
- con->mode = DIRECT;
-
- return HANDLER_FINISHED;
- }
- lua_remove(L, errfunc);
-
- /* we should have the function-copy and the return value on the stack */
- assert(lua_gettop(L) == 2);
-
- if (lua_isnumber(L, -1)) {
- /* if the ret-value is a number, take it */
- lua_return_value = (int)lua_tonumber(L, -1);
- }
- lua_pop(L, 1); /* pop the ret-value */
-
- magnet_copy_response_header(srv, con, p, L);
-
- if (lua_return_value > 99) {
- con->http_status = lua_return_value;
- con->file_finished = 1;
-
- /* try { ...*/
- if (0 == setjmp(exceptionjmp)) {
- magnet_attach_content(srv, con, p, L);
- if (!chunkqueue_is_empty(con->write_queue)) {
- con->mode = p->id;
- }
- } else {
- /* } catch () { */
- con->http_status = 500;
- con->mode = DIRECT;
- }
-
- assert(lua_gettop(L) == 1); /* only the function should be on the stack */
-
- /* we are finished */
- return HANDLER_FINISHED;
- } else if (MAGNET_RESTART_REQUEST == lua_return_value) {
- assert(lua_gettop(L) == 1); /* only the function should be on the stack */
-
- return HANDLER_COMEBACK;
- } else {
- assert(lua_gettop(L) == 1); /* only the function should be on the stack */
-
- return HANDLER_GO_ON;
- }
-}
-
-static handler_t magnet_attract_array(server *srv, connection *con, plugin_data *p, array *files) {
- size_t i;
-
- /* no filename set */
- if (files->used == 0) return HANDLER_GO_ON;
-
- /**
- * execute all files and jump out on the first !HANDLER_GO_ON
- */
- for (i = 0; i < files->used; i++) {
- data_string *ds = (data_string *)files->data[i];
- handler_t ret;
-
- if (buffer_is_empty(ds->value)) continue;
-
- ret = magnet_attract(srv, con, p, ds->value);
-
- if (ret != HANDLER_GO_ON) return ret;
- }
-
- return HANDLER_GO_ON;
-}
-
-URIHANDLER_FUNC(mod_magnet_uri_handler) {
- plugin_data *p = p_d;
-
- mod_magnet_patch_connection(srv, con, p);
-
- return magnet_attract_array(srv, con, p, p->conf.url_raw);
-}
-
-URIHANDLER_FUNC(mod_magnet_physical) {
- plugin_data *p = p_d;
-
- mod_magnet_patch_connection(srv, con, p);
-
- return magnet_attract_array(srv, con, p, p->conf.physical_path);
-}
-
-
-/* this function is called at dlopen() time and inits the callbacks */
-
-int mod_magnet_plugin_init(plugin *p);
-int mod_magnet_plugin_init(plugin *p) {
- p->version = LIGHTTPD_VERSION_ID;
- p->name = buffer_init_string("magnet");
-
- p->init = mod_magnet_init;
- p->handle_uri_clean = mod_magnet_uri_handler;
- p->handle_physical = mod_magnet_physical;
- p->set_defaults = mod_magnet_set_defaults;
- p->cleanup = mod_magnet_free;
-
- p->data = NULL;
-
- return 0;
-}
-
-#else
-int mod_magnet_plugin_init(plugin *p);
-int mod_magnet_plugin_init(plugin *p) {
- UNUSED(p);
- return -1;
-}
-#endif
diff --git a/src/mod_magnet_cache.c b/src/mod_magnet_cache.c
deleted file mode 100644
index 50326cf..0000000
--- a/src/mod_magnet_cache.c
+++ /dev/null
@@ -1,137 +0,0 @@
-#include "mod_magnet_cache.h"
-#include "stat_cache.h"
-
-#include <stdlib.h>
-#include <time.h>
-#include <assert.h>
-
-#ifdef HAVE_LUA_H
-#include <lualib.h>
-#include <lauxlib.h>
-
-static script *script_init() {
- script *sc;
-
- sc = calloc(1, sizeof(*sc));
- sc->name = buffer_init();
- sc->etag = buffer_init();
-
- return sc;
-}
-
-static void script_free(script *sc) {
- if (!sc) return;
-
- lua_pop(sc->L, 1); /* the function copy */
-
- buffer_free(sc->name);
- buffer_free(sc->etag);
-
- lua_close(sc->L);
-
- free(sc);
-}
-
-script_cache *script_cache_init() {
- script_cache *p;
-
- p = calloc(1, sizeof(*p));
-
- return p;
-}
-
-void script_cache_free(script_cache *p) {
- size_t i;
-
- if (!p) return;
-
- for (i = 0; i < p->used; i++) {
- script_free(p->ptr[i]);
- }
-
- free(p->ptr);
-
- free(p);
-}
-
-lua_State *script_cache_get_script(server *srv, connection *con, script_cache *cache, buffer *name) {
- size_t i;
- script *sc = NULL;
- stat_cache_entry *sce;
-
- for (i = 0; i < cache->used; i++) {
- sc = cache->ptr[i];
-
- if (buffer_is_equal(name, sc->name)) {
- sc->last_used = time(NULL);
-
- /* oops, the script failed last time */
-
- if (lua_gettop(sc->L) == 0) break;
-
- if (HANDLER_ERROR == stat_cache_get_entry(srv, con, sc->name, &sce)) {
- lua_pop(sc->L, 1); /* pop the old function */
- break;
- }
-
- if (!buffer_is_equal(sce->etag, sc->etag)) {
- /* the etag is outdated, reload the function */
- lua_pop(sc->L, 1);
- break;
- }
-
- assert(lua_isfunction(sc->L, -1));
- lua_pushvalue(sc->L, -1); /* copy the function-reference */
-
- return sc->L;
- }
-
- sc = NULL;
- }
-
- /* if the script was script already loaded but either got changed or
- * failed to load last time */
- if (sc == NULL) {
- sc = script_init();
-
- if (cache->size == 0) {
- cache->size = 16;
- cache->ptr = malloc(cache->size * sizeof(*(cache->ptr)));
- } else if (cache->used == cache->size) {
- cache->size += 16;
- cache->ptr = realloc(cache->ptr, cache->size * sizeof(*(cache->ptr)));
- }
-
- cache->ptr[cache->used++] = sc;
-
- buffer_copy_string_buffer(sc->name, name);
-
- sc->L = luaL_newstate();
- luaL_openlibs(sc->L);
- }
-
- sc->last_used = time(NULL);
-
- if (0 != luaL_loadfile(sc->L, name->ptr)) {
- /* oops, an error, return it */
-
- return sc->L;
- }
-
- if (HANDLER_GO_ON == stat_cache_get_entry(srv, con, sc->name, &sce)) {
- buffer_copy_string_buffer(sc->etag, sce->etag);
- }
-
- /**
- * pcall() needs the function on the stack
- *
- * as pcall() will pop the script from the stack when done, we have to
- * duplicate it here
- */
- assert(lua_isfunction(sc->L, -1));
- lua_pushvalue(sc->L, -1); /* copy the function-reference */
-
- return sc->L;
-}
-
-#endif
diff --git a/src/mod_magnet_cache.h b/src/mod_magnet_cache.h
deleted file mode 100644
index 50c9e44..0000000
--- a/src/mod_magnet_cache.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef _MOD_MAGNET_CACHE_H_
-#define _MOD_MAGNET_CACHE_H_
-
-#include "buffer.h"
-#include "base.h"
-
-#ifdef HAVE_LUA_H
-#include <lua.h>
-
-typedef struct {
- buffer *name;
- buffer *etag;
-
- lua_State *L;
-
- time_t last_used; /* LRU */
-} script;
-
-typedef struct {
- script **ptr;
-
- size_t used;
- size_t size;
-} script_cache;
-
-script_cache *script_cache_init(void);
-void script_cache_free(script_cache *cache);
-
-lua_State *script_cache_get_script(server *srv, connection *con,
- script_cache *cache, buffer *name);
-
-#endif
-#endif
diff --git a/src/mod_mysql_vhost.c b/src/mod_mysql_vhost.c
index df29186..ebe7657 100644
--- a/src/mod_mysql_vhost.c
+++ b/src/mod_mysql_vhost.c
@@ -21,12 +21,12 @@
#endif
/*
- * Plugin for lighttpd to use MySQL
+ * Plugin for lighttpd to use MySQL
* for domain to directory lookups,
* i.e virtual hosts (vhosts).
- *
- * Optionally sets fcgi_offset and fcgi_arg
- * in preparation for fcgi.c to handle
+ *
+ * Optionally sets fcgi_offset and fcgi_arg
+ * in preparation for fcgi.c to handle
* per-user fcgi chroot jails.
*
* /ada@riksnet.se 2004-12-06
@@ -35,15 +35,15 @@
#ifdef HAVE_MYSQL
typedef struct {
MYSQL *mysql;
-
+
buffer *mydb;
buffer *myuser;
buffer *mypass;
buffer *mysock;
-
+
buffer *hostname;
unsigned short port;
-
+
buffer *mysql_pre;
buffer *mysql_post;
} plugin_config;
@@ -51,12 +51,12 @@ typedef struct {
/* global plugin data */
typedef struct {
PLUGIN_DATA;
-
+
buffer *tmp_buf;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
/* per connection plugin data */
@@ -70,7 +70,7 @@ typedef struct {
/* init the plugin data */
INIT_FUNC(mod_mysql_vhost_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
p->tmp_buf = buffer_init();
@@ -83,36 +83,35 @@ SERVER_FUNC(mod_mysql_vhost_cleanup) {
plugin_data *p = p_d;
UNUSED(srv);
-
+
#ifdef DEBUG
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"mod_mysql_vhost_cleanup", p ? "yes" : "NO");
#endif
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
-
+
mysql_close(s->mysql);
-
+
buffer_free(s->mydb);
buffer_free(s->myuser);
buffer_free(s->mypass);
buffer_free(s->mysock);
buffer_free(s->mysql_pre);
buffer_free(s->mysql_post);
- buffer_free(s->hostname);
-
+
free(s);
}
free(p->config_storage);
}
buffer_free(p->tmp_buf);
-
+
free(p);
return HANDLER_GO_ON;
@@ -127,7 +126,7 @@ static void* mod_mysql_vhost_connection_data(server *srv, connection *con, void
UNUSED(srv);
#ifdef DEBUG
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"mod_mysql_connection_data", c ? "old" : "NEW");
#endif
@@ -150,10 +149,10 @@ CONNECTION_FUNC(mod_mysql_vhost_handle_connection_close) {
UNUSED(srv);
#ifdef DEBUG
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"mod_mysql_vhost_handle_connection_close", c ? "yes" : "NO");
#endif
-
+
if (!c) return HANDLER_GO_ON;
buffer_free(c->server_name);
@@ -184,14 +183,14 @@ SERVER_FUNC(mod_mysql_vhost_set_defaults) {
{ "mysql-vhost.port", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_SERVER },
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
buffer *sel;
-
-
+
+
s = calloc(1, sizeof(plugin_config));
s->mydb = buffer_init();
s->myuser = buffer_init();
@@ -201,10 +200,10 @@ SERVER_FUNC(mod_mysql_vhost_set_defaults) {
s->port = 0; /* default port for mysql */
sel = buffer_init();
s->mysql = NULL;
-
+
s->mysql_pre = buffer_init();
s->mysql_post = buffer_init();
-
+
cv[0].destination = s->mydb;
cv[1].destination = s->myuser;
cv[2].destination = s->mypass;
@@ -212,87 +211,68 @@ SERVER_FUNC(mod_mysql_vhost_set_defaults) {
cv[4].destination = sel;
cv[5].destination = s->hostname;
cv[6].destination = &(s->port);
-
+
p->config_storage[i] = s;
-
- if (config_insert_values_global(srv,
+
+ if (config_insert_values_global(srv,
((data_config *)srv->config_context->data[i])->value,
cv)) return HANDLER_ERROR;
-
+
s->mysql_pre = buffer_init();
s->mysql_post = buffer_init();
-
- if (sel->used && (qmark = strchr(sel->ptr, '?'))) {
+
+ if (sel->used && (qmark = index(sel->ptr, '?'))) {
*qmark = '\0';
buffer_copy_string(s->mysql_pre, sel->ptr);
buffer_copy_string(s->mysql_post, qmark+1);
} else {
buffer_copy_string_buffer(s->mysql_pre, sel);
}
-
+
/* required:
* - username
- * - database
- *
+ * - database
+ *
* optional:
* - password, default: empty
* - socket, default: mysql default
* - hostname, if set overrides socket
* - port, default: 3306
*/
-
+
/* all have to be set */
if (!(buffer_is_empty(s->myuser) ||
buffer_is_empty(s->mydb))) {
- my_bool reconnect = 1;
+ int fd;
+
if (NULL == (s->mysql = mysql_init(NULL))) {
log_error_write(srv, __FILE__, __LINE__, "s", "mysql_init() failed, exiting...");
-
+
return HANDLER_ERROR;
}
-
-#if MYSQL_VERSION_ID >= 50013
- /* in mysql versions above 5.0.3 the reconnect flag is off by default */
- mysql_options(s->mysql, MYSQL_OPT_RECONNECT, &reconnect);
-#endif
-
#define FOO(x) (s->x->used ? s->x->ptr : NULL)
-
-#if MYSQL_VERSION_ID >= 40100
- /* CLIENT_MULTI_STATEMENTS first appeared in 4.1 */
- if (!mysql_real_connect(s->mysql, FOO(hostname), FOO(myuser), FOO(mypass),
- FOO(mydb), s->port, FOO(mysock), CLIENT_MULTI_STATEMENTS)) {
-#else
- if (!mysql_real_connect(s->mysql, FOO(hostname), FOO(myuser), FOO(mypass),
+
+ if (!mysql_real_connect(s->mysql, FOO(hostname), FOO(myuser), FOO(mypass),
FOO(mydb), s->port, FOO(mysock), 0)) {
-#endif
log_error_write(srv, __FILE__, __LINE__, "s", mysql_error(s->mysql));
-
+
return HANDLER_ERROR;
}
#undef FOO
-
-#if 0
/* set close_on_exec for mysql the hard way */
/* Note: this only works as it is done during startup, */
/* otherwise we cannot be sure that mysql is fd i-1 */
- { int fd;
- if (-1 != (fd = open("/dev/null", 0))) {
+ if (-1 == (fd = open("/dev/null", 0))) {
close(fd);
-#ifdef FD_CLOEXEC
- fcntl(fd-1, F_SETFD, FD_CLOEXEC);
-#endif
- } }
-#else
-#ifdef FD_CLOEXEC
- fcntl(s->mysql->net.fd, F_SETFD, FD_CLOEXEC);
-#endif
-#endif
+ fcntl(fd-1, F_SETFD, FD_CLOEXEC);
+ }
}
}
+
+
- return HANDLER_GO_ON;
+ return HANDLER_GO_ON;
}
#define PATCH(x) \
@@ -300,36 +280,36 @@ SERVER_FUNC(mod_mysql_vhost_set_defaults) {
static int mod_mysql_vhost_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(mysql_pre);
PATCH(mysql_post);
#ifdef HAVE_MYSQL
PATCH(mysql);
#endif
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("mysql-vhost.sql"))) {
PATCH(mysql_pre);
PATCH(mysql_post);
}
}
-
+
if (s->mysql) {
PATCH(mysql);
}
}
-
+
return 0;
}
#undef PATCH
@@ -375,9 +355,6 @@ CONNECTION_FUNC(mod_mysql_vhost_handle_docroot) {
if (!row || cols < 1) {
/* no such virtual host */
mysql_free_result(result);
-#if MYSQL_VERSION_ID >= 40100
- while (mysql_next_result(p->conf.mysql) == 0);
-#endif
return HANDLER_GO_ON;
}
@@ -401,7 +378,7 @@ CONNECTION_FUNC(mod_mysql_vhost_handle_docroot) {
/* fcgi_offset and fcgi_arg are optional */
if (cols > 1 && row[1]) {
c->fcgi_offset = atoi(row[1]);
-
+
if (cols > 2 && row[2]) {
buffer_copy_string(c->fcgi_arg, row[2]);
} else {
@@ -411,52 +388,43 @@ CONNECTION_FUNC(mod_mysql_vhost_handle_docroot) {
c->fcgi_offset = c->fcgi_arg->used = 0;
}
mysql_free_result(result);
-#if MYSQL_VERSION_ID >= 40100
- while (mysql_next_result(p->conf.mysql) == 0);
-#endif
/* fix virtual server and docroot */
GO_ON: buffer_copy_string_buffer(con->server_name, c->server_name);
buffer_copy_string_buffer(con->physical.doc_root, c->document_root);
#ifdef DEBUG
- log_error_write(srv, __FILE__, __LINE__, "sbbdb",
- result ? "NOT CACHED" : "cached",
+ log_error_write(srv, __FILE__, __LINE__, "sbbdb",
+ result ? "NOT CACHED" : "cached",
con->server_name, con->physical.doc_root,
c->fcgi_offset, c->fcgi_arg);
#endif
- return HANDLER_GO_ON;
+ return HANDLER_GO_ON;
ERR500: if (result) mysql_free_result(result);
-#if MYSQL_VERSION_ID >= 40100
- while (mysql_next_result(p->conf.mysql) == 0);
-#endif
con->http_status = 500; /* Internal Error */
- con->mode = DIRECT;
return HANDLER_FINISHED;
}
/* this function is called at dlopen() time and inits the callbacks */
-int mod_mysql_vhost_plugin_init(plugin *p);
int mod_mysql_vhost_plugin_init(plugin *p) {
- p->version = LIGHTTPD_VERSION_ID;
- p->name = buffer_init_string("mysql_vhost");
-
- p->init = mod_mysql_vhost_init;
- p->cleanup = mod_mysql_vhost_cleanup;
- p->connection_reset = mod_mysql_vhost_handle_connection_close;
+ p->version = LIGHTTPD_VERSION_ID;
+ p->name = buffer_init_string("mysql_vhost");
- p->set_defaults = mod_mysql_vhost_set_defaults;
- p->handle_docroot = mod_mysql_vhost_handle_docroot;
+ p->init = mod_mysql_vhost_init;
+ p->cleanup = mod_mysql_vhost_cleanup;
+ p->handle_connection_close = mod_mysql_vhost_handle_connection_close;
+ p->set_defaults = mod_mysql_vhost_set_defaults;
+ p->handle_docroot = mod_mysql_vhost_handle_docroot;
+
return 0;
}
#else
/* we don't have mysql support, this plugin does nothing */
-int mod_mysql_vhost_plugin_init(plugin *p);
int mod_mysql_vhost_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
- p->name = buffer_init_string("mysql_vhost");
+ p->name = buffer_init_string("mysql_vhost");
return 0;
}
diff --git a/src/mod_proxy.c b/src/mod_proxy.c
index 06fe3db..c6a4660 100644
--- a/src/mod_proxy.c
+++ b/src/mod_proxy.c
@@ -1,3 +1,13 @@
+#include <sys/types.h>
+
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <assert.h>
+
#include "buffer.h"
#include "server.h"
#include "keyvalue.h"
@@ -14,16 +24,6 @@
#include "inet_ntop_cache.h"
#include "crc32.h"
-#include <sys/types.h>
-
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <assert.h>
-
#include <stdio.h>
#ifdef HAVE_SYS_FILIO_H
@@ -38,16 +38,16 @@
#define PROXY_RETRY_TIMEOUT 60
/**
- *
- * the proxy module is based on the fastcgi module
- *
+ *
+ * the proxy module is based on the fastcgi module
+ *
* 28.06.2004 Jan Kneschke The first release
* 01.07.2004 Evgeny Rodichev Several bugfixes and cleanups
* - co-ordinate up- and downstream flows correctly (proxy_demux_response
* and proxy_handle_fdevent)
* - correctly transfer upstream http_response_status;
* - some unused structures removed.
- *
+ *
* TODO: - delay upstream read if write_queue is too large
* (to prevent memory eating, like in apache). Shoud be
* configurable).
@@ -63,29 +63,29 @@ typedef enum {
typedef struct {
array *extensions;
- unsigned short debug;
+ int debug;
proxy_balance_t balance;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
buffer *parse_response;
buffer *balance_buf;
-
+
plugin_config **config_storage;
-
+
plugin_config conf;
} plugin_data;
-typedef enum {
- PROXY_STATE_INIT,
- PROXY_STATE_CONNECT,
- PROXY_STATE_PREPARE_WRITE,
- PROXY_STATE_WRITE,
- PROXY_STATE_READ,
- PROXY_STATE_ERROR
+typedef enum {
+ PROXY_STATE_INIT,
+ PROXY_STATE_CONNECT,
+ PROXY_STATE_PREPARE_WRITE,
+ PROXY_STATE_WRITE,
+ PROXY_STATE_READ,
+ PROXY_STATE_ERROR
} proxy_connection_state_t;
enum { PROXY_STDOUT, PROXY_END_REQUEST };
@@ -93,36 +93,36 @@ enum { PROXY_STDOUT, PROXY_END_REQUEST };
typedef struct {
proxy_connection_state_t state;
time_t state_timestamp;
-
+
data_proxy *host;
-
+
buffer *response;
buffer *response_header;
chunkqueue *wb;
-
+
int fd; /* fd to the proxy process */
int fde_ndx; /* index into the fd-event buffer */
size_t path_info_offset; /* start of path_info in uri.path */
-
+
connection *remote_conn; /* dump pointer */
plugin_data *plugin_data; /* dump pointer */
} handler_ctx;
/* ok, we need a prototype */
-static handler_t proxy_handle_fdevent(server *srv, void *ctx, int revents);
+static handler_t proxy_handle_fdevent(void *s, void *ctx, int revents);
static handler_ctx * handler_ctx_init() {
handler_ctx * hctx;
-
+
hctx = calloc(1, sizeof(*hctx));
-
+
hctx->state = PROXY_STATE_INIT;
hctx->host = NULL;
-
+
hctx->response = buffer_init();
hctx->response_header = buffer_init();
@@ -130,7 +130,7 @@ static handler_ctx * handler_ctx_init() {
hctx->fd = -1;
hctx->fde_ndx = -1;
-
+
return hctx;
}
@@ -138,47 +138,47 @@ static void handler_ctx_free(handler_ctx *hctx) {
buffer_free(hctx->response);
buffer_free(hctx->response_header);
chunkqueue_free(hctx->wb);
-
+
free(hctx);
}
INIT_FUNC(mod_proxy_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->parse_response = buffer_init();
p->balance_buf = buffer_init();
-
+
return p;
}
FREE_FUNC(mod_proxy_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
buffer_free(p->parse_response);
buffer_free(p->balance_buf);
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
if (s) {
-
+
array_free(s->extensions);
-
+
free(s);
}
}
free(p->config_storage);
}
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -186,37 +186,37 @@ SETDEFAULTS_FUNC(mod_proxy_set_defaults) {
plugin_data *p = p_d;
data_unset *du;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "proxy.server", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "proxy.debug", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ "proxy.balance", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
array *ca;
-
+
s = malloc(sizeof(plugin_config));
s->extensions = array_init();
s->debug = 0;
-
+
cv[0].destination = s->extensions;
cv[1].destination = &(s->debug);
cv[2].destination = p->balance_buf;
buffer_reset(p->balance_buf);
-
+
p->config_storage[i] = s;
ca = ((data_config *)srv->config_context->data[i])->value;
-
+
if (0 != config_insert_values_global(srv, ca, cv)) {
return HANDLER_ERROR;
}
-
+
if (buffer_is_empty(p->balance_buf)) {
s->balance = PROXY_BALANCE_FAIR;
} else if (buffer_is_equal_string(p->balance_buf, CONST_STR_LEN("fair"))) {
@@ -226,7 +226,7 @@ SETDEFAULTS_FUNC(mod_proxy_set_defaults) {
} else if (buffer_is_equal_string(p->balance_buf, CONST_STR_LEN("hash"))) {
s->balance = PROXY_BALANCE_HASH;
} else {
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"proxy.balance has to be one of: fair, round-robin, hash, but not:", p->balance_buf);
return HANDLER_ERROR;
}
@@ -234,91 +234,92 @@ SETDEFAULTS_FUNC(mod_proxy_set_defaults) {
if (NULL != (du = array_get_element(ca, "proxy.server"))) {
size_t j;
data_array *da = (data_array *)du;
-
+
if (du->type != TYPE_ARRAY) {
- log_error_write(srv, __FILE__, __LINE__, "sss",
+ log_error_write(srv, __FILE__, __LINE__, "sss",
"unexpected type for key: ", "proxy.server", "array of strings");
-
+
return HANDLER_ERROR;
}
-
- /*
+
+ /*
* proxy.server = ( "<ext>" => ...,
* "<ext>" => ... )
*/
-
+
for (j = 0; j < da->value->used; j++) {
data_array *da_ext = (data_array *)da->value->data[j];
size_t n;
-
+
if (da_ext->type != TYPE_ARRAY) {
- log_error_write(srv, __FILE__, __LINE__, "sssbs",
- "unexpected type for key: ", "proxy.server",
+ log_error_write(srv, __FILE__, __LINE__, "sssbs",
+ "unexpected type for key: ", "proxy.server",
"[", da->value->data[j]->key, "](string)");
-
+
return HANDLER_ERROR;
}
-
- /*
- * proxy.server = ( "<ext>" =>
- * ( "<host>" => ( ... ),
+
+ /*
+ * proxy.server = ( "<ext>" =>
+ * ( "<host>" => ( ... ),
* "<host>" => ( ... )
- * ),
+ * ),
* "<ext>" => ... )
*/
-
+
for (n = 0; n < da_ext->value->used; n++) {
data_array *da_host = (data_array *)da_ext->value->data[n];
-
+
data_proxy *df;
data_array *dfa;
-
- config_values_t pcv[] = {
+
+ config_values_t pcv[] = {
{ "host", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "port", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
+ { "balance", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (da_host->type != TYPE_ARRAY) {
- log_error_write(srv, __FILE__, __LINE__, "ssSBS",
- "unexpected type for key:",
- "proxy.server",
+ log_error_write(srv, __FILE__, __LINE__, "ssSBS",
+ "unexpected type for key:",
+ "proxy.server",
"[", da_ext->value->data[n]->key, "](string)");
-
+
return HANDLER_ERROR;
}
-
+
df = data_proxy_init();
-
+
df->port = 80;
-
+
buffer_copy_string_buffer(df->key, da_host->key);
-
+
pcv[0].destination = df->host;
pcv[1].destination = &(df->port);
-
+
if (0 != config_insert_values_internal(srv, da_host->value, pcv)) {
return HANDLER_ERROR;
}
-
+
if (buffer_is_empty(df->host)) {
- log_error_write(srv, __FILE__, __LINE__, "sbbbs",
- "missing key (string):",
+ log_error_write(srv, __FILE__, __LINE__, "sbbbs",
+ "missing key (string):",
da->key,
da_ext->key,
da_host->key,
"host");
-
+
return HANDLER_ERROR;
}
-
+
/* if extension already exists, take it */
-
+
if (NULL == (dfa = (data_array *)array_get_element(s->extensions, da_ext->key->ptr))) {
dfa = data_array_init();
-
+
buffer_copy_string_buffer(dfa->key, da_ext->key);
-
+
array_insert_unique(dfa->value, (data_unset *)df);
array_insert_unique(s->extensions, (data_unset *)dfa);
} else {
@@ -328,19 +329,19 @@ SETDEFAULTS_FUNC(mod_proxy_set_defaults) {
}
}
}
-
+
return HANDLER_GO_ON;
}
-static void proxy_connection_close(server *srv, handler_ctx *hctx) {
+void proxy_connection_close(server *srv, handler_ctx *hctx) {
plugin_data *p;
connection *con;
-
+
if (NULL == hctx) return;
-
+
p = hctx->plugin_data;
con = hctx->remote_conn;
-
+
if (hctx->fd != -1) {
fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
fdevent_unregister(srv->ev, hctx->fd);
@@ -348,73 +349,54 @@ static void proxy_connection_close(server *srv, handler_ctx *hctx) {
close(hctx->fd);
srv->cur_fds--;
}
-
- if (hctx->host) {
- hctx->host->usage--;
- }
-
+
handler_ctx_free(hctx);
- con->plugin_ctx[p->id] = NULL;
+ con->plugin_ctx[p->id] = NULL;
}
static int proxy_establish_connection(server *srv, handler_ctx *hctx) {
struct sockaddr *proxy_addr;
struct sockaddr_in proxy_addr_in;
-#if defined(HAVE_IPV6) && defined(HAVE_INET_PTON)
- struct sockaddr_in6 proxy_addr_in6;
-#endif
socklen_t servlen;
-
+
plugin_data *p = hctx->plugin_data;
data_proxy *host= hctx->host;
int proxy_fd = hctx->fd;
-
-
-#if defined(HAVE_IPV6) && defined(HAVE_INET_PTON)
- if (strstr(host->host->ptr, ":")) {
- memset(&proxy_addr_in6, 0, sizeof(proxy_addr_in6));
- proxy_addr_in6.sin6_family = AF_INET6;
- inet_pton(AF_INET6, host->host->ptr, (char *) &proxy_addr_in6.sin6_addr);
- proxy_addr_in6.sin6_port = htons(host->port);
- servlen = sizeof(proxy_addr_in6);
- proxy_addr = (struct sockaddr *) &proxy_addr_in6;
- } else
-#endif
- {
- memset(&proxy_addr_in, 0, sizeof(proxy_addr_in));
- proxy_addr_in.sin_family = AF_INET;
- proxy_addr_in.sin_addr.s_addr = inet_addr(host->host->ptr);
- proxy_addr_in.sin_port = htons(host->port);
- servlen = sizeof(proxy_addr_in);
- proxy_addr = (struct sockaddr *) &proxy_addr_in;
- }
-
-
+
+ memset(&proxy_addr, 0, sizeof(proxy_addr));
+
+ proxy_addr_in.sin_family = AF_INET;
+ proxy_addr_in.sin_addr.s_addr = inet_addr(host->host->ptr);
+ proxy_addr_in.sin_port = htons(host->port);
+ servlen = sizeof(proxy_addr_in);
+
+ proxy_addr = (struct sockaddr *) &proxy_addr_in;
+
if (-1 == connect(proxy_fd, proxy_addr, servlen)) {
if (errno == EINPROGRESS || errno == EALREADY) {
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"connect delayed:", proxy_fd);
}
-
+
return 1;
} else {
-
- log_error_write(srv, __FILE__, __LINE__, "sdsd",
+
+ log_error_write(srv, __FILE__, __LINE__, "sdsd",
"connect failed:", proxy_fd, strerror(errno), errno);
-
+
return -1;
}
}
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"connect succeeded: ", proxy_fd);
}
return 0;
}
-static void proxy_set_header(connection *con, const char *key, const char *value) {
+void proxy_set_header(connection *con, const char *key, const char *value) {
data_string *ds_dst;
if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
@@ -426,7 +408,7 @@ static void proxy_set_header(connection *con, const char *key, const char *value
array_insert_unique(con->request.headers, (data_unset *)ds_dst);
}
-static void proxy_append_header(connection *con, const char *key, const char *value) {
+void proxy_append_header(connection *con, const char *key, const char *value) {
data_string *ds_dst;
if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
@@ -441,52 +423,46 @@ static void proxy_append_header(connection *con, const char *key, const char *va
static int proxy_create_env(server *srv, handler_ctx *hctx) {
size_t i;
-
+
connection *con = hctx->remote_conn;
buffer *b;
-
+
/* build header */
b = chunkqueue_get_append_buffer(hctx->wb);
-
+
/* request line */
buffer_copy_string(b, get_http_method_name(con->request.http_method));
- buffer_append_string_len(b, CONST_STR_LEN(" "));
-
+ BUFFER_APPEND_STRING_CONST(b, " ");
+
buffer_append_string_buffer(b, con->request.uri);
- buffer_append_string_len(b, CONST_STR_LEN(" HTTP/1.0\r\n"));
+ BUFFER_APPEND_STRING_CONST(b, " HTTP/1.0\r\n");
proxy_append_header(con, "X-Forwarded-For", (char *)inet_ntop_cache_get_ip(srv, &(con->dst_addr)));
- /* http_host is NOT is just a pointer to a buffer
- * which is NULL if it is not set */
- if (con->request.http_host &&
- !buffer_is_empty(con->request.http_host)) {
- proxy_set_header(con, "X-Host", con->request.http_host->ptr);
- }
+ proxy_set_header(con, "X-Host", con->request.http_host->ptr);
proxy_set_header(con, "X-Forwarded-Proto", con->conf.is_ssl ? "https" : "http");
/* request header */
for (i = 0; i < con->request.headers->used; i++) {
data_string *ds;
-
+
ds = (data_string *)con->request.headers->data[i];
-
+
if (ds->value->used && ds->key->used) {
if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Connection"))) continue;
- if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Proxy-Connection"))) continue;
-
+
buffer_append_string_buffer(b, ds->key);
- buffer_append_string_len(b, CONST_STR_LEN(": "));
+ BUFFER_APPEND_STRING_CONST(b, ": ");
buffer_append_string_buffer(b, ds->value);
- buffer_append_string_len(b, CONST_STR_LEN("\r\n"));
+ BUFFER_APPEND_STRING_CONST(b, "\r\n");
}
}
-
- buffer_append_string_len(b, CONST_STR_LEN("\r\n"));
-
+
+ BUFFER_APPEND_STRING_CONST(b, "\r\n");
+
hctx->wb->bytes_in += b->used - 1;
/* body */
-
+
if (con->request.content_length) {
chunkqueue *req_cq = con->request_content_queue;
chunk *req_c;
@@ -499,7 +475,7 @@ static int proxy_create_env(server *srv, handler_ctx *hctx) {
/* we announce toWrite octects
* now take all the request_content chunk that we need to fill this request
- * */
+ * */
switch (req_c->type) {
case FILE_CHUNK:
@@ -527,26 +503,26 @@ static int proxy_create_env(server *srv, handler_ctx *hctx) {
req_c->offset += weHave;
req_cq->bytes_out += weHave;
-
+
hctx->wb->bytes_in += weHave;
break;
default:
break;
}
-
+
offset += weHave;
}
}
-
+
return 0;
}
static int proxy_set_state(server *srv, handler_ctx *hctx, proxy_connection_state_t state) {
hctx->state = state;
hctx->state_timestamp = srv->cur_ts;
-
+
return 0;
}
@@ -554,19 +530,19 @@ static int proxy_set_state(server *srv, handler_ctx *hctx, proxy_connection_stat
static int proxy_response_parse(server *srv, connection *con, plugin_data *p, buffer *in) {
char *s, *ns;
int http_response_status = -1;
-
+
UNUSED(srv);
/* \r\n -> \0\0 */
-
+
buffer_copy_string_buffer(p->parse_response, in);
-
+
for (s = p->parse_response->ptr; NULL != (ns = strstr(s, "\r\n")); s = ns + 2) {
char *key, *value;
int key_len;
data_string *ds;
int copy_header;
-
+
ns[0] = '\0';
ns[1] = '\0';
@@ -586,7 +562,7 @@ static int proxy_response_parse(server *srv, connection *con, plugin_data *p, bu
con->parsed_response |= HTTP_STATUS;
continue;
}
-
+
if (NULL == (value = strchr(s, ':'))) {
/* now we expect: "<key>: <value>\n" */
@@ -595,13 +571,13 @@ static int proxy_response_parse(server *srv, connection *con, plugin_data *p, bu
key = s;
key_len = value - key;
-
+
value++;
/* strip WS */
while (*value == ' ' || *value == '\t') value++;
-
+
copy_header = 1;
-
+
switch(key_len) {
case 4:
if (0 == strncasecmp(key, "Date", key_len)) {
@@ -634,11 +610,11 @@ static int proxy_response_parse(server *srv, connection *con, plugin_data *p, bu
}
buffer_copy_string_len(ds->key, key, key_len);
buffer_copy_string(ds->value, value);
-
+
array_insert_unique(con->response.headers, (data_unset *)ds);
}
}
-
+
return 0;
}
@@ -647,14 +623,14 @@ static int proxy_demux_response(server *srv, handler_ctx *hctx) {
int fin = 0;
int b;
ssize_t r;
-
+
plugin_data *p = hctx->plugin_data;
connection *con = hctx->remote_conn;
int proxy_fd = hctx->fd;
-
+
/* check how much we have to read */
if (ioctl(hctx->fd, FIONREAD, &b)) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"ioctl failed: ",
proxy_fd);
return -1;
@@ -672,25 +648,24 @@ static int proxy_demux_response(server *srv, handler_ctx *hctx) {
buffer_prepare_append(hctx->response, b + 1);
hctx->response->used = 1;
} else {
- buffer_prepare_append(hctx->response, b);
+ buffer_prepare_append(hctx->response, hctx->response->used + b);
}
-
+
if (-1 == (r = read(hctx->fd, hctx->response->ptr + hctx->response->used - 1, b))) {
- if (errno == EAGAIN) return 0;
- log_error_write(srv, __FILE__, __LINE__, "sds",
+ log_error_write(srv, __FILE__, __LINE__, "sds",
"unexpected end-of-file (perhaps the proxy process died):",
proxy_fd, strerror(errno));
return -1;
}
-
+
/* this should be catched by the b > 0 above */
assert(r);
-
+
hctx->response->used += r;
hctx->response->ptr[hctx->response->used - 1] = '\0';
#if 0
- log_error_write(srv, __FILE__, __LINE__, "sdsbs",
+ log_error_write(srv, __FILE__, __LINE__, "sdsbs",
"demux: Response buffer len", hctx->response->used, ":", hctx->response, ":");
#endif
@@ -698,158 +673,171 @@ static int proxy_demux_response(server *srv, handler_ctx *hctx) {
con->got_response = 1;
buffer_prepare_copy(hctx->response_header, 128);
}
-
+
if (0 == con->file_started) {
char *c;
-
+
/* search for the \r\n\r\n in the string */
if (NULL != (c = buffer_search_string_len(hctx->response, "\r\n\r\n", 4))) {
size_t hlen = c - hctx->response->ptr + 4;
size_t blen = hctx->response->used - hlen - 1;
/* found */
-
+
buffer_append_string_len(hctx->response_header, hctx->response->ptr, c - hctx->response->ptr + 4);
#if 0
log_error_write(srv, __FILE__, __LINE__, "sb", "Header:", hctx->response_header);
#endif
/* parse the response header */
proxy_response_parse(srv, con, p, hctx->response_header);
-
+
/* enable chunked-transfer-encoding */
if (con->request.http_version == HTTP_VERSION_1_1 &&
!(con->parsed_response & HTTP_CONTENT_LENGTH)) {
con->response.transfer_encoding = HTTP_TRANSFER_ENCODING_CHUNKED;
}
-
+
con->file_started = 1;
if (blen) {
http_chunk_append_mem(srv, con, c + 4, blen + 1);
+ joblist_append(srv, con);
}
hctx->response->used = 0;
- joblist_append(srv, con);
}
} else {
http_chunk_append_mem(srv, con, hctx->response->ptr, hctx->response->used);
joblist_append(srv, con);
hctx->response->used = 0;
}
-
+
} else {
/* reading from upstream done */
con->file_finished = 1;
-
+
http_chunk_append_mem(srv, con, NULL, 0);
joblist_append(srv, con);
-
+
fin = 1;
}
-
+
return fin;
}
static handler_t proxy_write_request(server *srv, handler_ctx *hctx) {
data_proxy *host= hctx->host;
+ plugin_data *p = hctx->plugin_data;
connection *con = hctx->remote_conn;
-
+
int ret;
-
- if (!host ||
+
+ if (!host ||
(!host->host->used || !host->port)) return -1;
-
+
switch(hctx->state) {
- case PROXY_STATE_CONNECT:
- /* wait for the connect() to finish */
-
- /* connect failed ? */
- if (-1 == hctx->fde_ndx) return HANDLER_ERROR;
-
- /* wait */
- return HANDLER_WAIT_FOR_EVENT;
-
- break;
-
case PROXY_STATE_INIT:
-#if defined(HAVE_IPV6) && defined(HAVE_INET_PTON)
- if (strstr(host->host->ptr,":")) {
- if (-1 == (hctx->fd = socket(AF_INET6, SOCK_STREAM, 0))) {
+ if (-1 == (hctx->fd = socket(AF_INET, SOCK_STREAM, 0))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
return HANDLER_ERROR;
- }
- } else
-#endif
- {
- if (-1 == (hctx->fd = socket(AF_INET, SOCK_STREAM, 0))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
- return HANDLER_ERROR;
- }
}
hctx->fde_ndx = -1;
-
+
srv->cur_fds++;
-
+
fdevent_register(srv->ev, hctx->fd, proxy_handle_fdevent, hctx);
-
+
if (-1 == fdevent_fcntl_set(srv->ev, hctx->fd)) {
log_error_write(srv, __FILE__, __LINE__, "ss", "fcntl failed: ", strerror(errno));
-
+
return HANDLER_ERROR;
}
+
+ /* fall through */
+
+ case PROXY_STATE_CONNECT:
+ /* try to finish the connect() */
+ if (hctx->state == PROXY_STATE_INIT) {
+ /* first round */
+ switch (proxy_establish_connection(srv, hctx)) {
+ case 1:
+ proxy_set_state(srv, hctx, PROXY_STATE_CONNECT);
+
+ /* connection is in progress, wait for an event and call getsockopt() below */
+
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+
+ return HANDLER_WAIT_FOR_EVENT;
+ case -1:
+ /* if ECONNREFUSED choose another connection -> FIXME */
+ hctx->fde_ndx = -1;
+
+ return HANDLER_ERROR;
+ default:
+ /* everything is ok, go on */
+ break;
+ }
+ } else {
+ int socket_error;
+ socklen_t socket_error_len = sizeof(socket_error);
+
+ /* we don't need it anymore */
+ fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
- switch (proxy_establish_connection(srv, hctx)) {
- case 1:
- proxy_set_state(srv, hctx, PROXY_STATE_CONNECT);
-
- /* connection is in progress, wait for an event and call getsockopt() below */
-
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
-
- return HANDLER_WAIT_FOR_EVENT;
- case -1:
- /* if ECONNREFUSED choose another connection -> FIXME */
- hctx->fde_ndx = -1;
-
- return HANDLER_ERROR;
- default:
- /* everything is ok, go on */
- proxy_set_state(srv, hctx, PROXY_STATE_PREPARE_WRITE);
- break;
+ /* try to finish the connect() */
+ if (0 != getsockopt(hctx->fd, SOL_SOCKET, SO_ERROR, &socket_error, &socket_error_len)) {
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "getsockopt failed:", strerror(errno));
+
+ return HANDLER_ERROR;
+ }
+ if (socket_error != 0) {
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "establishing connection failed:", strerror(socket_error),
+ "port:", hctx->host->port);
+
+ return HANDLER_ERROR;
+ }
+ if (p->conf.debug) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "proxy - connect - delayed success");
+ }
}
-
+
+ proxy_set_state(srv, hctx, PROXY_STATE_PREPARE_WRITE);
/* fall through */
-
case PROXY_STATE_PREPARE_WRITE:
proxy_create_env(srv, hctx);
-
+
proxy_set_state(srv, hctx, PROXY_STATE_WRITE);
-
+
/* fall through */
case PROXY_STATE_WRITE:;
- ret = srv->network_backend_write(srv, con, hctx->fd, hctx->wb, MAX_WRITE_LIMIT);
+ ret = srv->network_backend_write(srv, con, hctx->fd, hctx->wb);
chunkqueue_remove_finished_chunks(hctx->wb);
- if (-1 == ret) { /* error on our side */
- log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed:", strerror(errno), errno);
-
- return HANDLER_ERROR;
- } else if (-2 == ret) { /* remote close */
- log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed, remote connection close:", strerror(errno), errno);
+ if (-1 == ret) {
+ if (errno != EAGAIN &&
+ errno != EINTR) {
+ log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed:", strerror(errno), errno);
+
+ return HANDLER_ERROR;
+ } else {
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
- return HANDLER_ERROR;
+ return HANDLER_WAIT_FOR_EVENT;
+ }
}
if (hctx->wb->bytes_out == hctx->wb->bytes_in) {
proxy_set_state(srv, hctx, PROXY_STATE_READ);
fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
} else {
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
-
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+
return HANDLER_WAIT_FOR_EVENT;
}
-
+
return HANDLER_WAIT_FOR_EVENT;
case PROXY_STATE_READ:
/* waiting for a response */
@@ -858,7 +846,7 @@ static handler_t proxy_write_request(server *srv, handler_ctx *hctx) {
log_error_write(srv, __FILE__, __LINE__, "s", "(debug) unknown state");
return HANDLER_ERROR;
}
-
+
return HANDLER_GO_ON;
}
@@ -867,23 +855,23 @@ static handler_t proxy_write_request(server *srv, handler_ctx *hctx) {
static int mod_proxy_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(extensions);
PATCH(debug);
PATCH(balance);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("proxy.server"))) {
PATCH(extensions);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("proxy.debug"))) {
@@ -893,60 +881,60 @@ static int mod_proxy_patch_connection(server *srv, connection *con, plugin_data
}
}
}
-
+
return 0;
}
#undef PATCH
SUBREQUEST_FUNC(mod_proxy_handle_subrequest) {
plugin_data *p = p_d;
-
+
handler_ctx *hctx = con->plugin_ctx[p->id];
data_proxy *host;
-
+
if (NULL == hctx) return HANDLER_GO_ON;
mod_proxy_patch_connection(srv, con, p);
-
+
host = hctx->host;
-
+
/* not my job */
if (con->mode != p->id) return HANDLER_GO_ON;
-
+
/* ok, create the request */
switch(proxy_write_request(srv, hctx)) {
case HANDLER_ERROR:
- log_error_write(srv, __FILE__, __LINE__, "sbdd", "proxy-server disabled:",
+ log_error_write(srv, __FILE__, __LINE__, "sbdd", "proxy-server disabled:",
host->host,
host->port,
hctx->fd);
-
+
/* disable this server */
host->is_disabled = 1;
host->disable_ts = srv->cur_ts;
-
+
proxy_connection_close(srv, hctx);
-
- /* reset the enviroment and restart the sub-request */
+
+ /* reset the enviroment and restart the sub-request */
buffer_reset(con->physical.path);
con->mode = DIRECT;
joblist_append(srv, con);
- /* mis-using HANDLER_WAIT_FOR_FD to break out of the loop
- * and hope that the childs will be restarted
- *
+ /* mis-using HANDLER_WAIT_FOR_FD to break out of the loop
+ * and hope that the childs will be restarted
+ *
*/
return HANDLER_WAIT_FOR_FD;
case HANDLER_WAIT_FOR_EVENT:
- break;
+ return HANDLER_WAIT_FOR_EVENT;
case HANDLER_WAIT_FOR_FD:
return HANDLER_WAIT_FOR_FD;
default:
break;
}
-
+
if (con->file_started == 1) {
return HANDLER_FINISHED;
} else {
@@ -954,17 +942,18 @@ SUBREQUEST_FUNC(mod_proxy_handle_subrequest) {
}
}
-static handler_t proxy_handle_fdevent(server *srv, void *ctx, int revents) {
+static handler_t proxy_handle_fdevent(void *s, void *ctx, int revents) {
+ server *srv = (server *)s;
handler_ctx *hctx = ctx;
connection *con = hctx->remote_conn;
plugin_data *p = hctx->plugin_data;
-
-
+
+
if ((revents & FDEVENT_IN) &&
hctx->state == PROXY_STATE_READ) {
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"proxy: fdevent-in", hctx->state);
}
@@ -972,9 +961,11 @@ static handler_t proxy_handle_fdevent(server *srv, void *ctx, int revents) {
case 0:
break;
case 1:
+ hctx->host->usage--;
+
/* we are done */
proxy_connection_close(srv, hctx);
-
+
joblist_append(srv, con);
return HANDLER_FINISHED;
case -1:
@@ -987,125 +978,69 @@ static handler_t proxy_handle_fdevent(server *srv, void *ctx, int revents) {
/* response might have been already started, kill the connection */
connection_set_state(srv, con, CON_STATE_ERROR);
}
-
+
joblist_append(srv, con);
return HANDLER_FINISHED;
}
}
-
+
if (revents & FDEVENT_OUT) {
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"proxy: fdevent-out", hctx->state);
}
- if (hctx->state == PROXY_STATE_CONNECT) {
- int socket_error;
- socklen_t socket_error_len = sizeof(socket_error);
-
- /* we don't need it anymore */
- fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
- hctx->fde_ndx = -1;
-
- /* try to finish the connect() */
- if (0 != getsockopt(hctx->fd, SOL_SOCKET, SO_ERROR, &socket_error, &socket_error_len)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "getsockopt failed:", strerror(errno));
-
- joblist_append(srv, con);
- return HANDLER_FINISHED;
- }
- if (socket_error != 0) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "establishing connection failed:", strerror(socket_error),
- "port:", hctx->host->port);
-
- joblist_append(srv, con);
- return HANDLER_FINISHED;
- }
- if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "s", "proxy - connect - delayed success");
- }
-
- proxy_set_state(srv, hctx, PROXY_STATE_PREPARE_WRITE);
- }
-
- if (hctx->state == PROXY_STATE_PREPARE_WRITE ||
+ if (hctx->state == PROXY_STATE_CONNECT ||
hctx->state == PROXY_STATE_WRITE) {
/* we are allowed to send something out
- *
- * 1. after a just finished connect() call
+ *
+ * 1. in a unfinished connect() call
* 2. in a unfinished write() call (long POST request)
*/
return mod_proxy_handle_subrequest(srv, con, p);
} else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"proxy: out", hctx->state);
}
}
-
+
/* perhaps this issue is already handled */
if (revents & FDEVENT_HUP) {
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"proxy: fdevent-hup", hctx->state);
}
-
+
if (hctx->state == PROXY_STATE_CONNECT) {
/* connect() -> EINPROGRESS -> HUP */
-
+
/**
- * what is proxy is doing if it can't reach the next hop ?
- *
+ * what is proxy is doing if it can't reach the next hop ?
+ *
*/
-
- if (hctx->host) {
- hctx->host->is_disabled = 1;
- hctx->host->disable_ts = srv->cur_ts;
- log_error_write(srv, __FILE__, __LINE__, "sbdd", "proxy-server disabled:",
- hctx->host->host,
- hctx->host->port,
- hctx->fd);
-
- /* disable this server */
- hctx->host->is_disabled = 1;
- hctx->host->disable_ts = srv->cur_ts;
-
- proxy_connection_close(srv, hctx);
-
- /* reset the enviroment and restart the sub-request */
- buffer_reset(con->physical.path);
- con->mode = DIRECT;
-
- joblist_append(srv, con);
- } else {
- proxy_connection_close(srv, hctx);
- joblist_append(srv, con);
-
- con->mode = DIRECT;
- con->http_status = 503;
- }
-
+
+ proxy_connection_close(srv, hctx);
+ joblist_append(srv, con);
+
+ con->http_status = 503;
+ con->mode = DIRECT;
+
return HANDLER_FINISHED;
}
- if (!con->file_finished) {
- http_chunk_append_mem(srv, con, NULL, 0);
- }
-
con->file_finished = 1;
+
proxy_connection_close(srv, hctx);
joblist_append(srv, con);
} else if (revents & FDEVENT_ERR) {
/* kill all connections to the proxy process */
-
+
log_error_write(srv, __FILE__, __LINE__, "sd", "proxy-FDEVENT_ERR, but no HUP", revents);
- con->file_finished = 1;
joblist_append(srv, con);
proxy_connection_close(srv, hctx);
}
-
+
return HANDLER_FINISHED;
}
@@ -1119,82 +1054,69 @@ static handler_t mod_proxy_check_extension(server *srv, connection *con, void *p
buffer *fn;
data_array *extension = NULL;
size_t path_info_offset;
-
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
+
/* Possibly, we processed already this request */
if (con->file_started == 1) return HANDLER_GO_ON;
-
+
mod_proxy_patch_connection(srv, con, p);
-
+
fn = con->uri.path;
if (fn->used == 0) {
return HANDLER_ERROR;
}
-
+
s_len = fn->used - 1;
-
-
+
+
path_info_offset = 0;
- if (p->conf.debug) {
+ if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "s", "proxy - start");
}
/* check if extension matches */
for (k = 0; k < p->conf.extensions->used; k++) {
- data_array *ext = NULL;
size_t ct_len;
-
- ext = (data_array *)p->conf.extensions->data[k];
-
- if (ext->key->used == 0) continue;
-
- ct_len = ext->key->used - 1;
-
+
+ extension = (data_array *)p->conf.extensions->data[k];
+
+ if (extension->key->used == 0) continue;
+
+ ct_len = extension->key->used - 1;
+
if (s_len < ct_len) continue;
-
+
/* check extension in the form "/proxy_pattern" */
- if (*(ext->key->ptr) == '/') {
- if (strncmp(fn->ptr, ext->key->ptr, ct_len) == 0) {
- if (s_len > ct_len + 1) {
- char *pi_offset;
-
- if (0 != (pi_offset = strchr(fn->ptr + ct_len + 1, '/'))) {
- path_info_offset = pi_offset - fn->ptr;
- }
+ if (*(extension->key->ptr) == '/' && strncmp(fn->ptr, extension->key->ptr, ct_len) == 0) {
+ if (s_len > ct_len + 1) {
+ char *pi_offset;
+
+ if (0 != (pi_offset = strchr(fn->ptr + ct_len + 1, '/'))) {
+ path_info_offset = pi_offset - fn->ptr;
}
- extension = ext;
- break;
}
- } else if (0 == strncmp(fn->ptr + s_len - ct_len, ext->key->ptr, ct_len)) {
+ break;
+ } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
/* check extension in the form ".fcg" */
- extension = ext;
break;
}
}
-
- if (NULL == extension) {
+
+ if (k == p->conf.extensions->used) {
return HANDLER_GO_ON;
}
- if (p->conf.debug) {
+ if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "s", "proxy - ext found");
}
- if (extension->value->used == 1) {
- if ( ((data_proxy *)extension->value->data[0])->is_disabled ) {
- ndx = -1;
- } else {
- ndx = 0;
- }
- } else if (extension->value->used != 0) switch(p->conf.balance) {
+ switch(p->conf.balance) {
case PROXY_BALANCE_HASH:
/* hash balancing */
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"proxy - used hash balancing, hosts:", extension->value->used);
}
@@ -1203,13 +1125,13 @@ static handler_t mod_proxy_check_extension(server *srv, connection *con, void *p
unsigned long cur_max;
if (host->is_disabled) continue;
-
+
cur_max = generate_crc32c(CONST_BUF_LEN(con->uri.path)) +
generate_crc32c(CONST_BUF_LEN(host->host)) + /* we can cache this */
generate_crc32c(CONST_BUF_LEN(con->uri.authority));
-
+
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sbbbd",
+ log_error_write(srv, __FILE__, __LINE__, "sbbbd",
"proxy - election:",
con->uri.path,
host->host,
@@ -1229,92 +1151,88 @@ static handler_t mod_proxy_check_extension(server *srv, connection *con, void *p
case PROXY_BALANCE_FAIR:
/* fair balancing */
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"proxy - used fair balancing");
}
for (k = 0, ndx = -1, max_usage = INT_MAX; k < extension->value->used; k++) {
data_proxy *host = (data_proxy *)extension->value->data[k];
-
+
if (host->is_disabled) continue;
if (host->usage < max_usage) {
max_usage = host->usage;
-
+
ndx = k;
}
}
break;
- case PROXY_BALANCE_RR: {
- data_proxy *host;
-
+ case PROXY_BALANCE_RR:
/* round robin */
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"proxy - used round-robin balancing");
}
/* just to be sure */
assert(extension->value->used < INT_MAX);
+
+ for (k = 0, ndx = -1, max_usage = INT_MAX; k < extension->value->used; k++) {
+ data_proxy *host = (data_proxy *)extension->value->data[k];
+
+ if (host->is_disabled) continue;
- host = (data_proxy *)extension->value->data[0];
-
- /* Use last_used_ndx from first host in list */
- k = host->last_used_ndx;
- ndx = k + 1; /* use next host after the last one */
- if (ndx < 0) ndx = 0;
+ /* first usable ndx */
+ if (max_usage == INT_MAX) {
+ max_usage = k;
+ }
- /* Search first active host after last_used_ndx */
- while ( ndx < (int) extension->value->used
- && (host = (data_proxy *)extension->value->data[ndx])->is_disabled ) ndx++;
+ /* get next ndx */
+ if ((int)k > host->last_used_ndx) {
+ ndx = k;
+ host->last_used_ndx = k;
- if (ndx >= (int) extension->value->used) {
- /* didn't found a higher id, wrap to the start */
- for (ndx = 0; ndx <= (int) k; ndx++) {
- host = (data_proxy *)extension->value->data[ndx];
- if (!host->is_disabled) break;
+ break;
}
-
- /* No active host found */
- if (host->is_disabled) ndx = -1;
}
-
- /* Save new index for next round */
- ((data_proxy *)extension->value->data[0])->last_used_ndx = ndx;
+
+ /* didn't found a higher id, wrap to the start */
+ if (ndx != -1 && max_usage != INT_MAX) {
+ ndx = max_usage;
+ }
break;
- }
default:
break;
}
-
+
/* found a server */
if (ndx != -1) {
data_proxy *host = (data_proxy *)extension->value->data[ndx];
-
- /*
- * if check-local is disabled, use the uri.path handler
- *
+
+ /*
+ * if check-local is disabled, use the uri.path handler
+ *
*/
-
+
/* init handler-context */
handler_ctx *hctx;
hctx = handler_ctx_init();
-
+
hctx->path_info_offset = path_info_offset;
hctx->remote_conn = con;
hctx->plugin_data = p;
hctx->host = host;
-
+
con->plugin_ctx[p->id] = hctx;
-
+
host->usage++;
-
+
con->mode = p->id;
-
+
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sbd",
+ log_error_write(srv, __FILE__, __LINE__, "sbd",
"proxy - found a host",
host->host, host->port);
}
@@ -1323,11 +1241,11 @@ static handler_t mod_proxy_check_extension(server *srv, connection *con, void *p
} else {
/* no handler found */
con->http_status = 500;
-
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "no proxy-handler found for:",
+
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "no proxy-handler found for:",
fn);
-
+
return HANDLER_FINISHED;
}
return HANDLER_GO_ON;
@@ -1335,7 +1253,7 @@ static handler_t mod_proxy_check_extension(server *srv, connection *con, void *p
static handler_t mod_proxy_connection_close_callback(server *srv, connection *con, void *p_d) {
plugin_data *p = p_d;
-
+
proxy_connection_close(srv, con->plugin_ctx[p->id]);
return HANDLER_GO_ON;
@@ -1354,11 +1272,11 @@ TRIGGER_FUNC(mod_proxy_trigger) {
size_t i, n, k;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
- if (!s) continue;
+
+ if (!s) continue;
/* get the extensions for all configs */
-
+
for (k = 0; k < s->extensions->used; k++) {
data_array *extension = (data_array *)s->extensions->data[k];
@@ -1368,8 +1286,8 @@ TRIGGER_FUNC(mod_proxy_trigger) {
if (!host->is_disabled ||
srv->cur_ts - host->disable_ts < 5) continue;
-
- log_error_write(srv, __FILE__, __LINE__, "sbd",
+
+ log_error_write(srv, __FILE__, __LINE__, "sbd",
"proxy - re-enabled:",
host->host, host->port);
@@ -1383,7 +1301,6 @@ TRIGGER_FUNC(mod_proxy_trigger) {
}
-int mod_proxy_plugin_init(plugin *p);
int mod_proxy_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("proxy");
@@ -1396,8 +1313,8 @@ int mod_proxy_plugin_init(plugin *p) {
p->handle_uri_clean = mod_proxy_check_extension;
p->handle_subrequest = mod_proxy_handle_subrequest;
p->handle_trigger = mod_proxy_trigger;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_redirect.c b/src/mod_redirect.c
index 5d51b86..6040631 100644
--- a/src/mod_redirect.c
+++ b/src/mod_redirect.c
@@ -1,3 +1,7 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -5,50 +9,48 @@
#include "plugin.h"
#include "response.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
typedef struct {
pcre_keyvalue_buffer *redirect;
data_config *context; /* to which apply me */
-
- unsigned short redirect_code;
} plugin_config;
typedef struct {
PLUGIN_DATA;
buffer *match_buf;
buffer *location;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
INIT_FUNC(mod_redirect_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->match_buf = buffer_init();
p->location = buffer_init();
-
+
return p;
}
FREE_FUNC(mod_redirect_free) {
plugin_data *p = p_d;
-
+
if (!p) return HANDLER_GO_ON;
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
pcre_keyvalue_buffer_free(s->redirect);
-
+
free(s);
}
free(p->config_storage);
@@ -57,9 +59,9 @@ FREE_FUNC(mod_redirect_free) {
buffer_free(p->match_buf);
buffer_free(p->location);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -67,104 +69,97 @@ SETDEFAULTS_FUNC(mod_redirect_set_defaults) {
plugin_data *p = p_d;
data_unset *du;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "url.redirect", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { "url.redirect-code", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
/* 0 */
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
size_t j;
array *ca;
data_array *da = (data_array *)du;
-
+
s = calloc(1, sizeof(plugin_config));
s->redirect = pcre_keyvalue_buffer_init();
- s->redirect_code = 301;
-
+
cv[0].destination = s->redirect;
- cv[1].destination = &(s->redirect_code);
-
+
p->config_storage[i] = s;
ca = ((data_config *)srv->config_context->data[i])->value;
-
+
if (0 != config_insert_values_global(srv, ca, cv)) {
return HANDLER_ERROR;
}
-
+
if (NULL == (du = array_get_element(ca, "url.redirect"))) {
/* no url.redirect defined */
continue;
}
-
+
if (du->type != TYPE_ARRAY) {
- log_error_write(srv, __FILE__, __LINE__, "sss",
+ log_error_write(srv, __FILE__, __LINE__, "sss",
"unexpected type for key: ", "url.redirect", "array of strings");
-
+
return HANDLER_ERROR;
}
-
+
da = (data_array *)du;
-
+
for (j = 0; j < da->value->used; j++) {
if (da->value->data[j]->type != TYPE_STRING) {
- log_error_write(srv, __FILE__, __LINE__, "sssbs",
- "unexpected type for key: ",
- "url.redirect",
+ log_error_write(srv, __FILE__, __LINE__, "sssbs",
+ "unexpected type for key: ",
+ "url.redirect",
"[", da->value->data[j]->key, "](string)");
-
+
return HANDLER_ERROR;
}
-
- if (0 != pcre_keyvalue_buffer_append(srv, s->redirect,
+
+ if (0 != pcre_keyvalue_buffer_append(s->redirect,
((data_string *)(da->value->data[j]))->key->ptr,
((data_string *)(da->value->data[j]))->value->ptr)) {
-
- log_error_write(srv, __FILE__, __LINE__, "sb",
+
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"pcre-compile failed for", da->value->data[j]->key);
}
}
}
-
+
return HANDLER_GO_ON;
}
#ifdef HAVE_PCRE_H
static int mod_redirect_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
p->conf.redirect = s->redirect;
- p->conf.redirect_code = s->redirect_code;
- p->conf.context = NULL;
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (0 == strcmp(du->key->ptr, "url.redirect")) {
p->conf.redirect = s->redirect;
p->conf.context = dc;
- } else if (0 == strcmp(du->key->ptr, "url.redirect-code")) {
- p->conf.redirect_code = s->redirect_code;
}
}
}
-
+
return 0;
}
#endif
@@ -173,17 +168,17 @@ static handler_t mod_redirect_uri_handler(server *srv, connection *con, void *p_
plugin_data *p = p_data;
size_t i;
- /*
+ /*
* REWRITE URL
- *
+ *
* e.g. redirect /base/ to /index.php?section=base
- *
+ *
*/
-
+
mod_redirect_patch_connection(srv, con, p);
-
+
buffer_copy_string_buffer(p->match_buf, con->request.uri);
-
+
for (i = 0; i < p->conf.redirect->used; i++) {
pcre *match;
pcre_extra *extra;
@@ -193,12 +188,12 @@ static handler_t mod_redirect_uri_handler(server *srv, connection *con, void *p_
pcre_keyvalue *kv = p->conf.redirect->kv[i];
# define N 10
int ovec[N * 3];
-
+
match = kv->key;
extra = kv->key_extra;
pattern = kv->value->ptr;
pattern_len = kv->value->used - 1;
-
+
if ((n = pcre_exec(match, extra, p->match_buf->ptr, p->match_buf->used - 1, 0, 0, ovec, 3 * N)) < 0) {
if (n != PCRE_ERROR_NOMATCH) {
log_error_write(srv, __FILE__, __LINE__, "sd",
@@ -207,83 +202,75 @@ static handler_t mod_redirect_uri_handler(server *srv, connection *con, void *p_
}
} else {
const char **list;
- size_t start;
+ size_t start, end;
size_t k;
-
+
/* it matched */
pcre_get_substring_list(p->match_buf->ptr, ovec, n, &list);
-
+
/* search for $[0-9] */
-
+
buffer_reset(p->location);
-
- start = 0;
- for (k = 0; k + 1 < pattern_len; k++) {
- if (pattern[k] == '$' || pattern[k] == '%') {
+
+ start = 0; end = pattern_len;
+ for (k = 0; k < pattern_len; k++) {
+ if ((pattern[k] == '$' || pattern[k] == '%') &&
+ isdigit((unsigned char)pattern[k + 1])) {
/* got one */
-
+
size_t num = pattern[k + 1] - '0';
-
- buffer_append_string_len(p->location, pattern + start, k - start);
-
- if (!isdigit((unsigned char)pattern[k + 1])) {
- /* enable escape: "%%" => "%", "%a" => "%a", "$$" => "$" */
- buffer_append_string_len(p->location, pattern+k, pattern[k] == pattern[k+1] ? 1 : 2);
- } else if (pattern[k] == '$') {
+
+ end = k;
+
+ buffer_append_string_len(p->location, pattern + start, end - start);
+
+ if (pattern[k] == '$') {
/* n is always > 0 */
if (num < (size_t)n) {
buffer_append_string(p->location, list[num]);
}
- } else if (p->conf.context == NULL) {
- /* we have no context, we are global */
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "used a rewrite containing a %[0-9]+ in the global scope, ignored:",
- kv->value);
} else {
config_append_cond_match_buffer(con, p->conf.context, p->location, num);
}
-
+
k++;
start = k + 1;
- }
+ }
}
-
+
buffer_append_string_len(p->location, pattern + start, pattern_len - start);
-
+
pcre_free(list);
-
+
response_header_insert(srv, con, CONST_STR_LEN("Location"), CONST_BUF_LEN(p->location));
-
- con->http_status = p->conf.redirect_code > 99 && p->conf.redirect_code < 1000 ? p->conf.redirect_code : 301;
- con->mode = DIRECT;
- con->file_finished = 1;
-
+
+ con->http_status = 301;
+
return HANDLER_FINISHED;
}
}
#undef N
-
+
#else
UNUSED(srv);
UNUSED(con);
UNUSED(p_data);
#endif
-
+
return HANDLER_GO_ON;
}
-int mod_redirect_plugin_init(plugin *p);
int mod_redirect_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("redirect");
-
+
p->init = mod_redirect_init;
p->handle_uri_clean = mod_redirect_uri_handler;
p->set_defaults = mod_redirect_set_defaults;
p->cleanup = mod_redirect_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_rewrite.c b/src/mod_rewrite.c
index 058e756..ff152a9 100644
--- a/src/mod_rewrite.c
+++ b/src/mod_rewrite.c
@@ -1,34 +1,37 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
#include "plugin.h"
-#include "stat_cache.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
-#ifdef HAVE_PCRE_H
typedef struct {
+#ifdef HAVE_PCRE_H
pcre *key;
-
+#endif
+
buffer *value;
-
+
int once;
} rewrite_rule;
typedef struct {
rewrite_rule **ptr;
-
+
size_t used;
size_t size;
} rewrite_rule_buffer;
typedef struct {
rewrite_rule_buffer *rewrite;
- rewrite_rule_buffer *rewrite_NF;
- data_config *context, *context_NF; /* to which apply me */
+ data_config *context; /* to which apply me */
} plugin_config;
typedef struct {
@@ -39,20 +42,20 @@ typedef struct {
typedef struct {
PLUGIN_DATA;
buffer *match_buf;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
static handler_ctx * handler_ctx_init() {
handler_ctx * hctx;
-
+
hctx = calloc(1, sizeof(*hctx));
-
+
hctx->state = REWRITE_STATE_UNSET;
hctx->loops = 0;
-
+
return hctx;
}
@@ -60,56 +63,66 @@ static void handler_ctx_free(handler_ctx *hctx) {
free(hctx);
}
-static rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
+rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
rewrite_rule_buffer *kvb;
-
+
kvb = calloc(1, sizeof(*kvb));
-
+
return kvb;
}
-static int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) {
+int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) {
+#ifdef HAVE_PCRE_H
size_t i;
const char *errptr;
int erroff;
-
+
if (!key) return -1;
if (kvb->size == 0) {
kvb->size = 4;
kvb->used = 0;
-
+
kvb->ptr = malloc(kvb->size * sizeof(*kvb->ptr));
-
+
for(i = 0; i < kvb->size; i++) {
kvb->ptr[i] = calloc(1, sizeof(**kvb->ptr));
}
} else if (kvb->used == kvb->size) {
kvb->size += 4;
-
+
kvb->ptr = realloc(kvb->ptr, kvb->size * sizeof(*kvb->ptr));
-
+
for(i = kvb->used; i < kvb->size; i++) {
kvb->ptr[i] = calloc(1, sizeof(**kvb->ptr));
}
}
-
+
if (NULL == (kvb->ptr[kvb->used]->key = pcre_compile(key->ptr,
0, &errptr, &erroff, NULL))) {
-
+
return -1;
}
-
+
kvb->ptr[kvb->used]->value = buffer_init();
buffer_copy_string_buffer(kvb->ptr[kvb->used]->value, value);
kvb->ptr[kvb->used]->once = once;
-
+
kvb->used++;
-
+
return 0;
+#else
+ UNUSED(kvb);
+ UNUSED(value);
+ UNUSED(once);
+ UNUSED(key);
+
+ return -1;
+#endif
}
-static void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
+void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
+#ifdef HAVE_PCRE_H
size_t i;
for (i = 0; i < kvb->size; i++) {
@@ -117,264 +130,239 @@ static void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
if (kvb->ptr[i]->value) buffer_free(kvb->ptr[i]->value);
free(kvb->ptr[i]);
}
-
+
if (kvb->ptr) free(kvb->ptr);
-
+#endif
+
free(kvb);
}
INIT_FUNC(mod_rewrite_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->match_buf = buffer_init();
-
+
return p;
}
FREE_FUNC(mod_rewrite_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
buffer_free(p->match_buf);
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
rewrite_rule_buffer_free(s->rewrite);
- rewrite_rule_buffer_free(s->rewrite_NF);
-
+
free(s);
}
free(p->config_storage);
}
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
-static int parse_config_entry(server *srv, array *ca, rewrite_rule_buffer *kvb, const char *option, int once) {
+static int parse_config_entry(server *srv, plugin_config *s, array *ca, const char *option, int once) {
data_unset *du;
-
+
if (NULL != (du = array_get_element(ca, option))) {
- data_array *da;
+ data_array *da = (data_array *)du;
size_t j;
-
+
if (du->type != TYPE_ARRAY) {
- log_error_write(srv, __FILE__, __LINE__, "sss",
+ log_error_write(srv, __FILE__, __LINE__, "sss",
"unexpected type for key: ", option, "array of strings");
-
+
return HANDLER_ERROR;
}
-
+
da = (data_array *)du;
-
+
for (j = 0; j < da->value->used; j++) {
if (da->value->data[j]->type != TYPE_STRING) {
- log_error_write(srv, __FILE__, __LINE__, "sssbs",
- "unexpected type for key: ",
- option,
+ log_error_write(srv, __FILE__, __LINE__, "sssbs",
+ "unexpected type for key: ",
+ option,
"[", da->value->data[j]->key, "](string)");
-
+
return HANDLER_ERROR;
}
-
- if (0 != rewrite_rule_buffer_append(kvb,
+
+ if (0 != rewrite_rule_buffer_append(s->rewrite,
((data_string *)(da->value->data[j]))->key,
((data_string *)(da->value->data[j]))->value,
once)) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
+#ifdef HAVE_PCRE_H
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"pcre-compile failed for", da->value->data[j]->key);
+#else
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "pcre support is missing, please install libpcre and the headers");
+#endif
}
}
}
-
- return 0;
-}
-#else
-static int parse_config_entry(server *srv, array *ca, const char *option) {
- static int logged_message = 0;
- if (logged_message) return 0;
- if (NULL != array_get_element(ca, option)) {
- logged_message = 1;
- log_error_write(srv, __FILE__, __LINE__, "s",
- "pcre support is missing, please install libpcre and the headers");
- }
+
return 0;
}
-#endif
SETDEFAULTS_FUNC(mod_rewrite_set_defaults) {
+ plugin_data *p = p_d;
size_t i = 0;
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "url.rewrite-repeat", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "url.rewrite-once", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
-
- /* these functions only rewrite if the target is not already in the filestore
- *
- * url.rewrite-repeat-if-not-file is the equivalent of url.rewrite-repeat
- * url.rewrite-if-not-file is the equivalent of url.rewrite-once
- *
- */
- { "url.rewrite-repeat-if-not-file", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
- { "url.rewrite-if-not-file", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
-
- /* old names, still supported
- *
+
+ /* old names, still supported
+ *
* url.rewrite remapped to url.rewrite-once
* url.rewrite-final is url.rewrite-once
- *
+ *
*/
- { "url.rewrite", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 4 */
- { "url.rewrite-final", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
+ { "url.rewrite", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
+ { "url.rewrite-final", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
-#ifdef HAVE_PCRE_H
- plugin_data *p = p_d;
-
+
if (!p) return HANDLER_ERROR;
-
+
/* 0 */
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-#else
- UNUSED(p_d);
-#endif
-
+
for (i = 0; i < srv->config_context->used; i++) {
- array *ca;
-#ifdef HAVE_PCRE_H
plugin_config *s;
-
+ array *ca;
+
s = calloc(1, sizeof(plugin_config));
- s->rewrite = rewrite_rule_buffer_init();
- s->rewrite_NF = rewrite_rule_buffer_init();
+ s->rewrite = rewrite_rule_buffer_init();
+
+ cv[0].destination = s->rewrite;
+ cv[1].destination = s->rewrite;
+ cv[2].destination = s->rewrite;
+
p->config_storage[i] = s;
-#endif
-
ca = ((data_config *)srv->config_context->data[i])->value;
-
+
if (0 != config_insert_values_global(srv, ca, cv)) {
return HANDLER_ERROR;
}
-
-#ifndef HAVE_PCRE_H
-# define parse_config_entry(srv, ca, x, option, y) parse_config_entry(srv, ca, option)
-#endif
- parse_config_entry(srv, ca, s->rewrite, "url.rewrite-once", 1);
- parse_config_entry(srv, ca, s->rewrite, "url.rewrite-final", 1);
- parse_config_entry(srv, ca, s->rewrite_NF, "url.rewrite-if-not-file", 1);
- parse_config_entry(srv, ca, s->rewrite_NF, "url.rewrite-repeat-if-not-file", 0);
- parse_config_entry(srv, ca, s->rewrite, "url.rewrite", 1);
- parse_config_entry(srv, ca, s->rewrite, "url.rewrite-repeat", 0);
+
+ parse_config_entry(srv, s, ca, "url.rewrite-once", 1);
+ parse_config_entry(srv, s, ca, "url.rewrite-final", 1);
+ parse_config_entry(srv, s, ca, "url.rewrite", 1);
+ parse_config_entry(srv, s, ca, "url.rewrite-repeat", 0);
}
-
+
return HANDLER_GO_ON;
}
-
#ifdef HAVE_PCRE_H
-
-#define PATCH(x) \
- p->conf.x = s->x;
static int mod_rewrite_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
- PATCH(rewrite);
- PATCH(rewrite_NF);
- p->conf.context = NULL;
- p->conf.context_NF = NULL;
-
+ p->conf.rewrite = s->rewrite;
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
if (COMP_HTTP_URL == dc->comp) continue;
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.rewrite"))) {
- PATCH(rewrite);
+ p->conf.rewrite = s->rewrite;
p->conf.context = dc;
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.rewrite-once"))) {
- PATCH(rewrite);
+ p->conf.rewrite = s->rewrite;
p->conf.context = dc;
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.rewrite-repeat"))) {
- PATCH(rewrite);
+ p->conf.rewrite = s->rewrite;
p->conf.context = dc;
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.rewrite-if-not-file"))) {
- PATCH(rewrite_NF);
- p->conf.context_NF = dc;
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.rewrite-repeat-if-not-file"))) {
- PATCH(rewrite_NF);
- p->conf.context_NF = dc;
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.rewrite-final"))) {
- PATCH(rewrite);
+ p->conf.rewrite = s->rewrite;
p->conf.context = dc;
}
}
}
-
+
return 0;
}
-
+#endif
URIHANDLER_FUNC(mod_rewrite_con_reset) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
-
+
if (con->plugin_ctx[p->id]) {
handler_ctx_free(con->plugin_ctx[p->id]);
con->plugin_ctx[p->id] = NULL;
}
-
+
return HANDLER_GO_ON;
}
-static int process_rewrite_rules(server *srv, connection *con, plugin_data *p, rewrite_rule_buffer *kvb) {
+URIHANDLER_FUNC(mod_rewrite_uri_handler) {
+#ifdef HAVE_PCRE_H
+ plugin_data *p = p_d;
size_t i;
handler_ctx *hctx;
+ /*
+ * REWRITE URL
+ *
+ * e.g. rewrite /base/ to /index.php?section=base
+ *
+ */
+
if (con->plugin_ctx[p->id]) {
hctx = con->plugin_ctx[p->id];
-
+
if (hctx->loops++ > 100) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"ENDLESS LOOP IN rewrite-rule DETECTED ... aborting request, perhaps you want to use url.rewrite-once instead of url.rewrite-repeat");
-
+
return HANDLER_ERROR;
}
-
+
if (hctx->state == REWRITE_STATE_FINISHED) return HANDLER_GO_ON;
}
+
+ mod_rewrite_patch_connection(srv, con, p);
+ if (!p->conf.rewrite) return HANDLER_GO_ON;
+
buffer_copy_string_buffer(p->match_buf, con->request.uri);
-
- for (i = 0; i < kvb->used; i++) {
+
+ for (i = 0; i < p->conf.rewrite->used; i++) {
pcre *match;
const char *pattern;
size_t pattern_len;
int n;
- rewrite_rule *rule = kvb->ptr[i];
+ rewrite_rule *rule = p->conf.rewrite->ptr[i];
# define N 10
int ovec[N * 3];
-
+
match = rule->key;
pattern = rule->value->ptr;
pattern_len = rule->value->used - 1;
-
+
if ((n = pcre_exec(match, NULL, p->match_buf->ptr, p->match_buf->used - 1, 0, 0, ovec, 3 * N)) < 0) {
if (n != PCRE_ERROR_NOMATCH) {
log_error_write(srv, __FILE__, __LINE__, "sd",
@@ -383,128 +371,80 @@ static int process_rewrite_rules(server *srv, connection *con, plugin_data *p, r
}
} else {
const char **list;
- size_t start;
+ size_t start, end;
size_t k;
-
+
/* it matched */
pcre_get_substring_list(p->match_buf->ptr, ovec, n, &list);
-
+
/* search for $[0-9] */
-
+
buffer_reset(con->request.uri);
-
- start = 0;
- for (k = 0; k+1 < pattern_len; k++) {
- if (pattern[k] == '$' || pattern[k] == '%') {
+
+ start = 0; end = pattern_len;
+ for (k = 0; k < pattern_len; k++) {
+ if ((pattern[k] == '$' || pattern[k] == '%') &&
+ isdigit((unsigned char)pattern[k + 1])) {
/* got one */
-
+
size_t num = pattern[k + 1] - '0';
-
- buffer_append_string_len(con->request.uri, pattern + start, k - start);
-
- if (!isdigit((unsigned char)pattern[k + 1])) {
- /* enable escape: "%%" => "%", "%a" => "%a", "$$" => "$" */
- buffer_append_string_len(con->request.uri, pattern+k, pattern[k] == pattern[k+1] ? 1 : 2);
- } else if (pattern[k] == '$') {
+
+ end = k;
+
+ buffer_append_string_len(con->request.uri, pattern + start, end - start);
+
+ if (pattern[k] == '$') {
/* n is always > 0 */
if (num < (size_t)n) {
buffer_append_string(con->request.uri, list[num]);
}
- } else if (p->conf.context == NULL) {
- /* we have no context, we are global */
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "used a redirect containing a %[0-9]+ in the global scope, ignored:",
- rule->value);
-
} else {
config_append_cond_match_buffer(con, p->conf.context, con->request.uri, num);
}
-
+
k++;
start = k + 1;
- }
+ }
}
-
+
buffer_append_string_len(con->request.uri, pattern + start, pattern_len - start);
-
+
pcre_free(list);
-
- if (con->plugin_ctx[p->id] == NULL) {
- hctx = handler_ctx_init();
- con->plugin_ctx[p->id] = hctx;
- } else {
- hctx = con->plugin_ctx[p->id];
- }
-
+
+ hctx = handler_ctx_init();
+
+ con->plugin_ctx[p->id] = hctx;
+
if (rule->once) hctx->state = REWRITE_STATE_FINISHED;
-
+
return HANDLER_COMEBACK;
}
-#undef N
}
+#undef N
+
+#else
+ UNUSED(srv);
+ UNUSED(con);
+ UNUSED(p_d);
+#endif
return HANDLER_GO_ON;
}
-URIHANDLER_FUNC(mod_rewrite_physical) {
- plugin_data *p = p_d;
- handler_t r;
- stat_cache_entry *sce;
-
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
- mod_rewrite_patch_connection(srv, con, p);
- p->conf.context = p->conf.context_NF;
-
- if (!p->conf.rewrite_NF) return HANDLER_GO_ON;
-
- /* skip if physical.path is a regular file */
- sce = NULL;
- if (HANDLER_ERROR != stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
- if (S_ISREG(sce->st.st_mode)) return HANDLER_GO_ON;
- }
-
- switch(r = process_rewrite_rules(srv, con, p, p->conf.rewrite_NF)) {
- case HANDLER_COMEBACK:
- buffer_reset(con->physical.path);
- default:
- return r;
- }
-
- return HANDLER_GO_ON;
-}
-
-URIHANDLER_FUNC(mod_rewrite_uri_handler) {
- plugin_data *p = p_d;
-
- mod_rewrite_patch_connection(srv, con, p);
-
- if (!p->conf.rewrite) return HANDLER_GO_ON;
-
- return process_rewrite_rules(srv, con, p, p->conf.rewrite);
-
- return HANDLER_GO_ON;
-}
-#endif
-
-int mod_rewrite_plugin_init(plugin *p);
int mod_rewrite_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("rewrite");
-
-#ifdef HAVE_PCRE_H
+
p->init = mod_rewrite_init;
/* it has to stay _raw as we are matching on uri + querystring
*/
-
+
p->handle_uri_raw = mod_rewrite_uri_handler;
- p->handle_physical = mod_rewrite_physical;
+ p->set_defaults = mod_rewrite_set_defaults;
p->cleanup = mod_rewrite_free;
p->connection_reset = mod_rewrite_con_reset;
-#endif
- p->set_defaults = mod_rewrite_set_defaults;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_rrdtool.c b/src/mod_rrdtool.c
index 67a0215..c7b897a 100644
--- a/src/mod_rrdtool.c
+++ b/src/mod_rrdtool.c
@@ -1,10 +1,4 @@
-#include "server.h"
-#include "connections.h"
-#include "response.h"
-#include "connections.h"
-#include "log.h"
-
-#include "plugin.h"
+#define _GNU_SOURCE
#include <sys/types.h>
#include <fcntl.h>
@@ -15,6 +9,13 @@
#include <errno.h>
#include <time.h>
+#include "server.h"
+#include "connections.h"
+#include "response.h"
+#include "connections.h"
+#include "log.h"
+
+#include "plugin.h"
#ifdef HAVE_FORK
/* no need for waitpid if we don't have fork */
#include <sys/wait.h>
@@ -22,7 +23,7 @@
typedef struct {
buffer *path_rrdtool_bin;
buffer *path_rrd;
-
+
double requests, *requests_ptr;
double bytes_written, *bytes_written_ptr;
double bytes_read, *bytes_read_ptr;
@@ -30,84 +31,84 @@ typedef struct {
typedef struct {
PLUGIN_DATA;
-
+
buffer *cmd;
buffer *resp;
-
+
int read_fd, write_fd;
pid_t rrdtool_pid;
-
+
int rrdtool_running;
-
+
plugin_config **config_storage;
plugin_config conf;
} plugin_data;
INIT_FUNC(mod_rrd_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->resp = buffer_init();
p->cmd = buffer_init();
-
+
return p;
}
FREE_FUNC(mod_rrd_free) {
plugin_data *p = p_d;
size_t i;
-
+
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
buffer_free(s->path_rrdtool_bin);
buffer_free(s->path_rrd);
-
+
free(s);
}
}
buffer_free(p->cmd);
buffer_free(p->resp);
-
+
free(p->config_storage);
-
+
if (p->rrdtool_pid) {
int status;
close(p->read_fd);
close(p->write_fd);
-#ifdef HAVE_FORK
+#ifdef HAVE_FORK
/* collect status */
waitpid(p->rrdtool_pid, &status, 0);
#endif
}
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
-static int mod_rrd_create_pipe(server *srv, plugin_data *p) {
-#ifdef HAVE_FORK
+int mod_rrd_create_pipe(server *srv, plugin_data *p) {
pid_t pid;
-
+
int to_rrdtool_fds[2];
int from_rrdtool_fds[2];
+#ifdef HAVE_FORK
if (pipe(to_rrdtool_fds)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"pipe failed: ", strerror(errno));
return -1;
}
-
+
if (pipe(from_rrdtool_fds)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"pipe failed: ", strerror(errno));
return -1;
}
-
+
/* fork, execve */
switch (pid = fork()) {
case 0: {
@@ -116,40 +117,47 @@ static int mod_rrd_create_pipe(server *srv, plugin_data *p) {
int argc;
int i = 0;
char *dash = "-";
-
+
/* move stdout to from_rrdtool_fd[1] */
close(STDOUT_FILENO);
dup2(from_rrdtool_fds[1], STDOUT_FILENO);
close(from_rrdtool_fds[1]);
/* not needed */
close(from_rrdtool_fds[0]);
-
+
/* move the stdin to to_rrdtool_fd[0] */
close(STDIN_FILENO);
dup2(to_rrdtool_fds[0], STDIN_FILENO);
close(to_rrdtool_fds[0]);
/* not needed */
close(to_rrdtool_fds[1]);
-
+
+ close(STDERR_FILENO);
+
+ if (srv->errorlog_mode == ERRORLOG_FILE) {
+ dup2(srv->errorlog_fd, STDERR_FILENO);
+ close(srv->errorlog_fd);
+ }
+
/* set up args */
argc = 3;
args = malloc(sizeof(*args) * argc);
i = 0;
-
+
args[i++] = p->conf.path_rrdtool_bin->ptr;
args[i++] = dash;
- args[i ] = NULL;
+ args[i++] = NULL;
/* we don't need the client socket */
for (i = 3; i < 256; i++) {
close(i);
}
-
+
/* exec the cgi */
execv(args[0], args);
-
- /* log_error_write(srv, __FILE__, __LINE__, "sss", "spawing rrdtool failed: ", strerror(errno), args[0]); */
-
+
+ log_error_write(srv, __FILE__, __LINE__, "sss", "spawing rrdtool failed: ", strerror(errno), args[0]);
+
/* */
SEGFAULT();
break;
@@ -160,136 +168,85 @@ static int mod_rrd_create_pipe(server *srv, plugin_data *p) {
break;
default: {
/* father */
-
+
close(from_rrdtool_fds[1]);
close(to_rrdtool_fds[0]);
-
+
/* register PID and wait for them asyncronously */
p->write_fd = to_rrdtool_fds[1];
p->read_fd = from_rrdtool_fds[0];
p->rrdtool_pid = pid;
-
-#ifdef FD_CLOEXEC
- fcntl(p->write_fd, F_SETFD, FD_CLOEXEC);
- fcntl(p->read_fd, F_SETFD, FD_CLOEXEC);
-#endif
-
+
break;
}
}
-
+
return 0;
#else
return -1;
#endif
}
-/* read/write wrappers to catch EINTR */
-
-/* write to blocking socket; blocks until all data is sent, write returns 0 or an error (apart from EINTR) occurs. */
-static ssize_t safe_write(int fd, const void *buf, size_t count) {
- ssize_t res, sum = 0;
-
- for (;;) {
- res = write(fd, buf, count);
- if (res >= 0) {
- sum += res;
- /* do not try again if res == 0 */
- if (res == 0 || (size_t) res == count) return sum;
- count -= res;
- buf = (const char*) buf + res;
- continue;
- }
- switch (errno) {
- case EINTR:
- continue;
- default:
- return -1;
- }
- }
-}
-
-/* this assumes we get enough data on a successful read */
-static ssize_t safe_read(int fd, void *buf, size_t count) {
- ssize_t res;
-
- for (;;) {
- res = read(fd, buf, count);
- if (res >= 0) return res;
- switch (errno) {
- case EINTR:
- continue;
- default:
- return -1;
- }
- }
-}
-
static int mod_rrdtool_create_rrd(server *srv, plugin_data *p, plugin_config *s) {
struct stat st;
- int r;
-
+
/* check if DB already exists */
if (0 == stat(s->path_rrd->ptr, &st)) {
/* check if it is plain file */
if (!S_ISREG(st.st_mode)) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"not a regular file:", s->path_rrd);
return HANDLER_ERROR;
}
-
- /* still create DB if it's empty file */
- if (st.st_size > 0) {
- return HANDLER_GO_ON;
+ } else {
+ int r ;
+ /* create a new one */
+
+ BUFFER_COPY_STRING_CONST(p->cmd, "create ");
+ buffer_append_string_buffer(p->cmd, s->path_rrd);
+ buffer_append_string(p->cmd, " --step 60 ");
+ buffer_append_string(p->cmd, "DS:InOctets:ABSOLUTE:600:U:U ");
+ buffer_append_string(p->cmd, "DS:OutOctets:ABSOLUTE:600:U:U ");
+ buffer_append_string(p->cmd, "DS:Requests:ABSOLUTE:600:U:U ");
+ buffer_append_string(p->cmd, "RRA:AVERAGE:0.5:1:600 ");
+ buffer_append_string(p->cmd, "RRA:AVERAGE:0.5:6:700 ");
+ buffer_append_string(p->cmd, "RRA:AVERAGE:0.5:24:775 ");
+ buffer_append_string(p->cmd, "RRA:AVERAGE:0.5:288:797 ");
+ buffer_append_string(p->cmd, "RRA:MAX:0.5:1:600 ");
+ buffer_append_string(p->cmd, "RRA:MAX:0.5:6:700 ");
+ buffer_append_string(p->cmd, "RRA:MAX:0.5:24:775 ");
+ buffer_append_string(p->cmd, "RRA:MAX:0.5:288:797 ");
+ buffer_append_string(p->cmd, "RRA:MIN:0.5:1:600 ");
+ buffer_append_string(p->cmd, "RRA:MIN:0.5:6:700 ");
+ buffer_append_string(p->cmd, "RRA:MIN:0.5:24:775 ");
+ buffer_append_string(p->cmd, "RRA:MIN:0.5:288:797\n");
+
+ if (-1 == (r = write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "rrdtool-write: failed", strerror(errno));
+
+ return HANDLER_ERROR;
+ }
+
+ buffer_prepare_copy(p->resp, 4096);
+ if (-1 == (r = read(p->read_fd, p->resp->ptr, p->resp->size))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "rrdtool-read: failed", strerror(errno));
+
+ return HANDLER_ERROR;
+ }
+
+ p->resp->used = r;
+
+ if (p->resp->ptr[0] != 'O' ||
+ p->resp->ptr[1] != 'K') {
+ log_error_write(srv, __FILE__, __LINE__, "sbb",
+ "rrdtool-response:", p->cmd, p->resp);
+
+ return HANDLER_ERROR;
}
}
-
- /* create a new one */
- buffer_copy_string_len(p->cmd, CONST_STR_LEN("create "));
- buffer_append_string_buffer(p->cmd, s->path_rrd);
- buffer_append_string_len(p->cmd, CONST_STR_LEN(
- " --step 60 "
- "DS:InOctets:ABSOLUTE:600:U:U "
- "DS:OutOctets:ABSOLUTE:600:U:U "
- "DS:Requests:ABSOLUTE:600:U:U "
- "RRA:AVERAGE:0.5:1:600 "
- "RRA:AVERAGE:0.5:6:700 "
- "RRA:AVERAGE:0.5:24:775 "
- "RRA:AVERAGE:0.5:288:797 "
- "RRA:MAX:0.5:1:600 "
- "RRA:MAX:0.5:6:700 "
- "RRA:MAX:0.5:24:775 "
- "RRA:MAX:0.5:288:797 "
- "RRA:MIN:0.5:1:600 "
- "RRA:MIN:0.5:6:700 "
- "RRA:MIN:0.5:24:775 "
- "RRA:MIN:0.5:288:797\n"));
-
- if (-1 == (safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "rrdtool-write: failed", strerror(errno));
-
- return HANDLER_ERROR;
- }
-
- buffer_prepare_copy(p->resp, 4096);
- if (-1 == (r = safe_read(p->read_fd, p->resp->ptr, p->resp->size))) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "rrdtool-read: failed", strerror(errno));
-
- return HANDLER_ERROR;
- }
-
- p->resp->used = r;
-
- if (p->resp->ptr[0] != 'O' ||
- p->resp->ptr[1] != 'K') {
- log_error_write(srv, __FILE__, __LINE__, "sbb",
- "rrdtool-response:", p->cmd, p->resp);
-
- return HANDLER_ERROR;
- }
-
+
return HANDLER_GO_ON;
}
@@ -298,37 +255,37 @@ static int mod_rrdtool_create_rrd(server *srv, plugin_data *p, plugin_config *s)
static int mod_rrd_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(path_rrdtool_bin);
PATCH(path_rrd);
-
+
p->conf.bytes_written_ptr = &(s->bytes_written);
p->conf.bytes_read_ptr = &(s->bytes_read);
p->conf.requests_ptr = &(s->requests);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("rrdtool.db-name"))) {
PATCH(path_rrd);
/* get pointers to double values */
-
+
p->conf.bytes_written_ptr = &(s->bytes_written);
p->conf.bytes_read_ptr = &(s->bytes_read);
p->conf.requests_ptr = &(s->requests);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -336,161 +293,157 @@ static int mod_rrd_patch_connection(server *srv, connection *con, plugin_data *p
SETDEFAULTS_FUNC(mod_rrd_set_defaults) {
plugin_data *p = p_d;
size_t i;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "rrdtool.binary", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER },
{ "rrdtool.db-name", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->path_rrdtool_bin = buffer_init();
s->path_rrd = buffer_init();
s->requests = 0;
s->bytes_written = 0;
s->bytes_read = 0;
-
+
cv[0].destination = s->path_rrdtool_bin;
cv[1].destination = s->path_rrd;
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
-
+
if (i > 0 && !buffer_is_empty(s->path_rrdtool_bin)) {
/* path_rrdtool_bin is a global option */
-
- log_error_write(srv, __FILE__, __LINE__, "s",
+
+ log_error_write(srv, __FILE__, __LINE__, "s",
"rrdtool.binary can only be set as a global option.");
-
+
return HANDLER_ERROR;
}
-
+
}
-
+
p->conf.path_rrdtool_bin = p->config_storage[0]->path_rrdtool_bin;
p->rrdtool_running = 0;
-
+
/* check for dir */
-
+
if (buffer_is_empty(p->conf.path_rrdtool_bin)) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"rrdtool.binary has to be set");
return HANDLER_ERROR;
}
-
+
/* open the pipe to rrdtool */
if (mod_rrd_create_pipe(srv, p)) {
return HANDLER_ERROR;
}
-
+
p->rrdtool_running = 1;
-
+
return HANDLER_GO_ON;
}
TRIGGER_FUNC(mod_rrd_trigger) {
plugin_data *p = p_d;
size_t i;
-
+
if (!p->rrdtool_running) return HANDLER_GO_ON;
if ((srv->cur_ts % 60) != 0) return HANDLER_GO_ON;
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
int r;
-
+
if (buffer_is_empty(s->path_rrd)) continue;
-
+
/* write the data down every minute */
-
+
if (HANDLER_GO_ON != mod_rrdtool_create_rrd(srv, p, s)) return HANDLER_ERROR;
-
- buffer_copy_string_len(p->cmd, CONST_STR_LEN("update "));
+
+ BUFFER_COPY_STRING_CONST(p->cmd, "update ");
buffer_append_string_buffer(p->cmd, s->path_rrd);
- buffer_append_string_len(p->cmd, CONST_STR_LEN(" N:"));
+ BUFFER_APPEND_STRING_CONST(p->cmd, " N:");
buffer_append_off_t(p->cmd, s->bytes_read);
- buffer_append_string_len(p->cmd, CONST_STR_LEN(":"));
+ BUFFER_APPEND_STRING_CONST(p->cmd, ":");
buffer_append_off_t(p->cmd, s->bytes_written);
- buffer_append_string_len(p->cmd, CONST_STR_LEN(":"));
+ BUFFER_APPEND_STRING_CONST(p->cmd, ":");
buffer_append_long(p->cmd, s->requests);
- buffer_append_string_len(p->cmd, CONST_STR_LEN("\n"));
-
- if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
+ BUFFER_APPEND_STRING_CONST(p->cmd, "\n");
+
+ if (-1 == (r = write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
p->rrdtool_running = 0;
-
- log_error_write(srv, __FILE__, __LINE__, "ss",
+
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"rrdtool-write: failed", strerror(errno));
-
+
return HANDLER_ERROR;
}
-
+
buffer_prepare_copy(p->resp, 4096);
- if (-1 == (r = safe_read(p->read_fd, p->resp->ptr, p->resp->size))) {
+ if (-1 == (r = read(p->read_fd, p->resp->ptr, p->resp->size))) {
p->rrdtool_running = 0;
-
- log_error_write(srv, __FILE__, __LINE__, "ss",
+
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"rrdtool-read: failed", strerror(errno));
-
+
return HANDLER_ERROR;
}
-
+
p->resp->used = r;
-
+
if (p->resp->ptr[0] != 'O' ||
p->resp->ptr[1] != 'K') {
- /* don't fail on this error if we just started (graceful restart, the old one might have just updated too) */
- if (!(strstr(p->resp->ptr, "(minimum one second step)") && (srv->cur_ts - srv->startup_ts < 3))) {
- p->rrdtool_running = 0;
-
- log_error_write(srv, __FILE__, __LINE__, "sbb",
+ p->rrdtool_running = 0;
+
+ log_error_write(srv, __FILE__, __LINE__, "sbb",
"rrdtool-response:", p->cmd, p->resp);
-
- return HANDLER_ERROR;
- }
+
+ return HANDLER_ERROR;
}
s->requests = 0;
s->bytes_written = 0;
s->bytes_read = 0;
}
-
+
return HANDLER_GO_ON;
}
REQUESTDONE_FUNC(mod_rrd_account) {
plugin_data *p = p_d;
-
+
mod_rrd_patch_connection(srv, con, p);
-
+
*(p->conf.requests_ptr) += 1;
*(p->conf.bytes_written_ptr) += con->bytes_written;
*(p->conf.bytes_read_ptr) += con->bytes_read;
-
+
return HANDLER_GO_ON;
}
-int mod_rrdtool_plugin_init(plugin *p);
int mod_rrdtool_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("rrd");
-
+
p->init = mod_rrd_init;
p->cleanup = mod_rrd_free;
p->set_defaults= mod_rrd_set_defaults;
-
+
p->handle_trigger = mod_rrd_trigger;
p->handle_request_done = mod_rrd_account;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_scgi.c b/src/mod_scgi.c
index b13dbf4..06713e9 100644
--- a/src/mod_scgi.c
+++ b/src/mod_scgi.c
@@ -1,3 +1,13 @@
+#include <sys/types.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <assert.h>
+#include <signal.h>
+
#include "buffer.h"
#include "server.h"
#include "keyvalue.h"
@@ -13,16 +23,6 @@
#include "inet_ntop_cache.h"
-#include <sys/types.h>
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <assert.h>
-#include <signal.h>
-
#include <stdio.h>
#ifdef HAVE_SYS_FILIO_H
@@ -31,32 +31,34 @@
#include "sys-socket.h"
-#ifdef HAVE_SYS_UIO_H
-# include <sys/uio.h>
+
+#ifndef UNIX_PATH_MAX
+# define UNIX_PATH_MAX 108
#endif
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
+#include <sys/wait.h>
#endif
-#include "version.h"
-
enum {EOL_UNSET, EOL_N, EOL_RN};
/*
- *
+ *
* TODO:
- *
+ *
* - add timeout for a connect to a non-scgi process
* (use state_timestamp + state)
- *
+ *
*/
typedef struct scgi_proc {
size_t id; /* id will be between 1 and max_procs */
buffer *socket; /* config.socket + "-" + id */
unsigned port; /* config.port + pno */
-
+
pid_t pid; /* PID of the spawned process (0 if not spawned locally) */
@@ -65,9 +67,9 @@ typedef struct scgi_proc {
time_t last_used; /* see idle_timeout */
size_t requests; /* see max_requests */
struct scgi_proc *prev, *next; /* see first */
-
+
time_t disable_ts; /* replace by host->something */
-
+
int is_local;
enum { PROC_STATE_UNSET, /* init-phase */
@@ -76,7 +78,7 @@ typedef struct scgi_proc {
PROC_STATE_KILLED, /* was killed as we don't have the load anymore */
PROC_STATE_DIED, /* marked as dead, should be restarted */
PROC_STATE_DISABLED /* proc disabled as it resulted in an error */
- } state;
+ } state;
} scgi_proc;
typedef struct {
@@ -84,20 +86,20 @@ typedef struct {
* sorted by lowest load
*
* whenever a job is done move it up in the list
- * until it is sorted, move it down as soon as the
+ * until it is sorted, move it down as soon as the
* job is started
*/
- scgi_proc *first;
- scgi_proc *unused_procs;
+ scgi_proc *first;
+ scgi_proc *unused_procs;
- /*
+ /*
* spawn at least min_procs, at max_procs.
*
- * as soon as the load of the first entry
+ * as soon as the load of the first entry
* is max_load_per_proc we spawn a new one
- * and add it to the first entry and give it
+ * and add it to the first entry and give it
* the load
- *
+ *
*/
unsigned short min_procs;
@@ -109,44 +111,44 @@ typedef struct {
/*
* kick the process from the list if it was not
- * used for idle_timeout until min_procs is
+ * used for idle_timeout until min_procs is
* reached. this helps to get the processlist
* small again we had a small peak load.
*
*/
-
+
unsigned short idle_timeout;
-
+
/*
* time after a disabled remote connection is tried to be re-enabled
- *
- *
+ *
+ *
*/
-
+
unsigned short disable_time;
/*
* same scgi processes get a little bit larger
- * than wanted. max_requests_per_proc kills a
+ * than wanted. max_requests_per_proc kills a
* process after a number of handled requests.
*
*/
size_t max_requests_per_proc;
-
+
/* config */
- /*
- * host:port
+ /*
+ * host:port
*
- * if host is one of the local IP adresses the
+ * if host is one of the local IP adresses the
* whole connection is local
*
* if tcp/ip should be used host AND port have
- * to be specified
- *
- */
- buffer *host;
+ * to be specified
+ *
+ */
+ buffer *host;
unsigned short port;
/*
@@ -159,7 +161,7 @@ typedef struct {
*/
buffer *unixsocket;
- /* if socket is local we can start the scgi
+ /* if socket is local we can start the scgi
* process ourself
*
* bin-path is the path to the binary
@@ -167,19 +169,19 @@ typedef struct {
* check min_procs and max_procs for the number
* of process to start-up
*/
- buffer *bin_path;
-
- /* bin-path is set bin-environment is taken to
+ buffer *bin_path;
+
+ /* bin-path is set bin-environment is taken to
* create the environement before starting the
* FastCGI process
- *
+ *
*/
array *bin_env;
-
+
array *bin_env_copy;
-
+
/*
- * docroot-translation between URL->phys and the
+ * docroot-translation between URL->phys and the
* remote host
*
* reasons:
@@ -190,7 +192,7 @@ typedef struct {
buffer *docroot;
/*
- * check_local tell you if the phys file is stat()ed
+ * check_local tell you if the phys file is stat()ed
* or not. FastCGI doesn't care if the service is
* remote. If the web-server side doesn't contain
* the scgi-files we should not stat() for them
@@ -200,42 +202,33 @@ typedef struct {
/*
* append PATH_INFO to SCRIPT_FILENAME
- *
+ *
* php needs this if cgi.fix_pathinfo is provied
- *
+ *
*/
-
- /*
- * workaround for program when prefix="/"
- *
- * rule to build PATH_INFO is hardcoded for when check_local is disabled
- * enable this option to use the workaround
- *
- */
-
- unsigned short fix_root_path_name;
+
ssize_t load; /* replace by host->load */
size_t max_id; /* corresponds most of the time to
num_procs.
-
+
only if a process is killed max_id waits for the process itself
to die and decrements its afterwards */
} scgi_extension_host;
/*
* one extension can have multiple hosts assigned
- * one host can spawn additional processes on the same
+ * one host can spawn additional processes on the same
* socket (if we control it)
*
* ext -> host -> procs
* 1:n 1:n
*
- * if the scgi process is remote that whole goes down
+ * if the scgi process is remote that whole goes down
* to
*
* ext -> host -> procs
- * 1:n 1:1
+ * 1:n 1:1
*
* in case of PHP and FCGI_CHILDREN we have again a procs
* but we don't control it directly.
@@ -245,9 +238,8 @@ typedef struct {
typedef struct {
buffer *key; /* like .php */
- int note_is_sent;
scgi_extension_host **hosts;
-
+
size_t used;
size_t size;
} scgi_extension;
@@ -261,14 +253,14 @@ typedef struct {
typedef struct {
- scgi_exts *exts;
-
+ scgi_exts *exts;
+
int debug;
} plugin_config;
typedef struct {
char **ptr;
-
+
size_t size;
size_t used;
} char_array;
@@ -276,101 +268,88 @@ typedef struct {
/* generic plugin data, shared between all connections */
typedef struct {
PLUGIN_DATA;
-
+
buffer *scgi_env;
-
+
buffer *path;
buffer *parse_response;
-
+
plugin_config **config_storage;
-
+
plugin_config conf; /* this is only used as long as no handler_ctx is setup */
} plugin_data;
/* connection specific data */
-typedef enum { FCGI_STATE_INIT, FCGI_STATE_CONNECT, FCGI_STATE_PREPARE_WRITE,
- FCGI_STATE_WRITE, FCGI_STATE_READ
+typedef enum { FCGI_STATE_INIT, FCGI_STATE_CONNECT, FCGI_STATE_PREPARE_WRITE,
+ FCGI_STATE_WRITE, FCGI_STATE_READ
} scgi_connection_state_t;
typedef struct {
- buffer *response;
+ buffer *response;
size_t response_len;
int response_type;
int response_padding;
-
+
scgi_proc *proc;
scgi_extension_host *host;
-
+
scgi_connection_state_t state;
time_t state_timestamp;
-
+
int reconnects; /* number of reconnect attempts */
-
+
read_buffer *rb;
chunkqueue *wb;
-
+
buffer *response_header;
-
+
int delayed; /* flag to mark that the connect() is delayed */
-
+
size_t request_id;
int fd; /* fd to the scgi process */
int fde_ndx; /* index into the fd-event buffer */
pid_t pid;
int got_proc;
-
+
plugin_config conf;
-
+
connection *remote_conn; /* dumb pointer */
plugin_data *plugin_data; /* dumb pointer */
} handler_ctx;
/* ok, we need a prototype */
-static handler_t scgi_handle_fdevent(server *srv, void *ctx, int revents);
+static handler_t scgi_handle_fdevent(void *s, void *ctx, int revents);
int scgi_proclist_sort_down(server *srv, scgi_extension_host *host, scgi_proc *proc);
-static void reset_signals(void) {
-#ifdef SIGTTOU
- signal(SIGTTOU, SIG_DFL);
-#endif
-#ifdef SIGTTIN
- signal(SIGTTIN, SIG_DFL);
-#endif
-#ifdef SIGTSTP
- signal(SIGTSTP, SIG_DFL);
-#endif
- signal(SIGHUP, SIG_DFL);
- signal(SIGPIPE, SIG_DFL);
- signal(SIGUSR1, SIG_DFL);
-}
+
static handler_ctx * handler_ctx_init() {
handler_ctx * hctx;
-
+
hctx = calloc(1, sizeof(*hctx));
assert(hctx);
-
+
hctx->fde_ndx = -1;
-
+
hctx->response = buffer_init();
hctx->response_header = buffer_init();
-
+
hctx->request_id = 0;
hctx->state = FCGI_STATE_INIT;
hctx->proc = NULL;
-
+
hctx->response_len = 0;
hctx->response_type = 0;
hctx->response_padding = 0;
hctx->fd = -1;
-
+
hctx->reconnects = 0;
hctx->wb = chunkqueue_init();
-
+
return hctx;
}
@@ -379,38 +358,38 @@ static void handler_ctx_free(handler_ctx *hctx) {
buffer_free(hctx->response_header);
chunkqueue_free(hctx->wb);
-
+
if (hctx->rb) {
if (hctx->rb->ptr) free(hctx->rb->ptr);
free(hctx->rb);
}
-
+
free(hctx);
}
-static scgi_proc *scgi_process_init() {
+scgi_proc *scgi_process_init() {
scgi_proc *f;
f = calloc(1, sizeof(*f));
f->socket = buffer_init();
-
+
f->prev = NULL;
f->next = NULL;
-
+
return f;
}
-static void scgi_process_free(scgi_proc *f) {
+void scgi_process_free(scgi_proc *f) {
if (!f) return;
-
+
scgi_process_free(f->next);
-
+
buffer_free(f->socket);
-
+
free(f);
}
-static scgi_extension_host *scgi_host_init() {
+scgi_extension_host *scgi_host_init() {
scgi_extension_host *f;
f = calloc(1, sizeof(*f));
@@ -421,66 +400,66 @@ static scgi_extension_host *scgi_host_init() {
f->bin_path = buffer_init();
f->bin_env = array_init();
f->bin_env_copy = array_init();
-
+
return f;
}
-static void scgi_host_free(scgi_extension_host *h) {
+void scgi_host_free(scgi_extension_host *h) {
if (!h) return;
-
+
buffer_free(h->host);
buffer_free(h->unixsocket);
buffer_free(h->docroot);
buffer_free(h->bin_path);
array_free(h->bin_env);
array_free(h->bin_env_copy);
-
+
scgi_process_free(h->first);
scgi_process_free(h->unused_procs);
-
+
free(h);
-
+
}
-static scgi_exts *scgi_extensions_init() {
+scgi_exts *scgi_extensions_init() {
scgi_exts *f;
f = calloc(1, sizeof(*f));
-
+
return f;
}
-static void scgi_extensions_free(scgi_exts *f) {
+void scgi_extensions_free(scgi_exts *f) {
size_t i;
-
+
if (!f) return;
-
+
for (i = 0; i < f->used; i++) {
scgi_extension *fe;
size_t j;
-
+
fe = f->exts[i];
-
+
for (j = 0; j < fe->used; j++) {
scgi_extension_host *h;
-
+
h = fe->hosts[j];
-
+
scgi_host_free(h);
}
-
+
buffer_free(fe->key);
free(fe->hosts);
-
+
free(fe);
}
-
+
free(f->exts);
-
+
free(f);
}
-static int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_host *fh) {
+int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_host *fh) {
scgi_extension *fe;
size_t i;
@@ -525,109 +504,99 @@ static int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_hos
assert(fe->hosts);
}
- fe->hosts[fe->used++] = fh;
+ fe->hosts[fe->used++] = fh;
return 0;
-
+
}
INIT_FUNC(mod_scgi_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->scgi_env = buffer_init();
-
+
p->path = buffer_init();
p->parse_response = buffer_init();
-
+
return p;
}
FREE_FUNC(mod_scgi_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
buffer_free(p->scgi_env);
buffer_free(p->path);
buffer_free(p->parse_response);
-
+
if (p->config_storage) {
size_t i, j, n;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
scgi_exts *exts;
-
+
if (!s) continue;
-
+
exts = s->exts;
for (j = 0; j < exts->used; j++) {
scgi_extension *ex;
-
+
ex = exts->exts[j];
-
+
for (n = 0; n < ex->used; n++) {
scgi_proc *proc;
scgi_extension_host *host;
-
+
host = ex->hosts[n];
-
+
for (proc = host->first; proc; proc = proc->next) {
if (proc->pid != 0) kill(proc->pid, SIGTERM);
-
- if (proc->is_local &&
+
+ if (proc->is_local &&
!buffer_is_empty(proc->socket)) {
unlink(proc->socket->ptr);
}
}
-
+
for (proc = host->unused_procs; proc; proc = proc->next) {
if (proc->pid != 0) kill(proc->pid, SIGTERM);
-
- if (proc->is_local &&
+
+ if (proc->is_local &&
!buffer_is_empty(proc->socket)) {
unlink(proc->socket->ptr);
}
}
}
}
-
+
scgi_extensions_free(s->exts);
-
+
free(s);
}
free(p->config_storage);
}
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
static int env_add(char_array *env, const char *key, size_t key_len, const char *val, size_t val_len) {
char *dst;
- size_t i;
-
+
if (!key || !val) return -1;
-
+
dst = malloc(key_len + val_len + 3);
memcpy(dst, key, key_len);
dst[key_len] = '=';
/* add the \0 from the value */
memcpy(dst + key_len + 1, val, val_len + 1);
-
- for (i = 0; i < env->used; i++) {
- if (0 == strncmp(dst, env->ptr[i], key_len + 1)) {
- /* don't care about free as we are in a forked child which is going to exec(...) */
- /* free(env->ptr[i]); */
- env->ptr[i] = dst;
- return 0;
- }
- }
-
+
if (env->size == 0) {
env->size = 16;
env->ptr = malloc(env->size * sizeof(*env->ptr));
@@ -635,13 +604,13 @@ static int env_add(char_array *env, const char *key, size_t key_len, const char
env->size += 16;
env->ptr = realloc(env->ptr, env->size * sizeof(*env->ptr));
}
-
+
env->ptr[env->used++] = dst;
-
+
return 0;
}
-static int scgi_spawn_connection(server *srv,
+static int scgi_spawn_connection(server *srv,
plugin_data *p,
scgi_extension_host *host,
scgi_proc *proc) {
@@ -653,30 +622,30 @@ static int scgi_spawn_connection(server *srv,
#endif
struct sockaddr_in scgi_addr_in;
struct sockaddr *scgi_addr;
-
+
socklen_t servlen;
-
+
#ifndef HAVE_FORK
return -1;
#endif
-
+
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "sdb",
"new proc, socket:", proc->port, proc->socket);
}
-
+
if (!buffer_is_empty(proc->socket)) {
memset(&scgi_addr, 0, sizeof(scgi_addr));
-
+
#ifdef HAVE_SYS_UN_H
scgi_addr_un.sun_family = AF_UNIX;
strcpy(scgi_addr_un.sun_path, proc->socket->ptr);
-
+
#ifdef SUN_LEN
servlen = SUN_LEN(&scgi_addr_un);
#else
/* stevens says: */
- servlen = proc->socket->used + sizeof(scgi_addr_un.sun_family);
+ servlen = proc->socket->used - 1 + sizeof(scgi_addr_un.sun_family);
#endif
socket_type = AF_UNIX;
scgi_addr = (struct sockaddr *) &scgi_addr_un;
@@ -687,120 +656,115 @@ static int scgi_spawn_connection(server *srv,
#endif
} else {
scgi_addr_in.sin_family = AF_INET;
-
+
if (buffer_is_empty(host->host)) {
scgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
} else {
struct hostent *he;
-
+
/* set a usefull default */
scgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
-
-
+
+
if (NULL == (he = gethostbyname(host->host->ptr))) {
- log_error_write(srv, __FILE__, __LINE__,
- "sdb", "gethostbyname failed: ",
+ log_error_write(srv, __FILE__, __LINE__,
+ "sdb", "gethostbyname failed: ",
h_errno, host->host);
return -1;
}
-
+
if (he->h_addrtype != AF_INET) {
log_error_write(srv, __FILE__, __LINE__, "sd", "addr-type != AF_INET: ", he->h_addrtype);
return -1;
}
-
+
if (he->h_length != sizeof(struct in_addr)) {
log_error_write(srv, __FILE__, __LINE__, "sd", "addr-length != sizeof(in_addr): ", he->h_length);
return -1;
}
-
+
memcpy(&(scgi_addr_in.sin_addr.s_addr), he->h_addr_list[0], he->h_length);
-
+
}
scgi_addr_in.sin_port = htons(proc->port);
servlen = sizeof(scgi_addr_in);
-
+
socket_type = AF_INET;
scgi_addr = (struct sockaddr *) &scgi_addr_in;
}
-
+
if (-1 == (scgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"failed:", strerror(errno));
return -1;
}
-
+
if (-1 == connect(scgi_fd, scgi_addr, servlen)) {
/* server is not up, spawn in */
pid_t child;
int val;
-
+
if (!buffer_is_empty(proc->socket)) {
unlink(proc->socket->ptr);
}
-
+
close(scgi_fd);
-
+
/* reopen socket */
if (-1 == (scgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"socket failed:", strerror(errno));
return -1;
}
-
+
val = 1;
if (setsockopt(scgi_fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"socketsockopt failed:", strerror(errno));
return -1;
}
-
+
/* create socket */
if (-1 == bind(scgi_fd, scgi_addr, servlen)) {
- log_error_write(srv, __FILE__, __LINE__, "sbds",
- "bind failed for:",
- proc->socket,
- proc->port,
+ log_error_write(srv, __FILE__, __LINE__, "sbds",
+ "bind failed for:",
+ proc->socket,
+ proc->port,
strerror(errno));
return -1;
}
-
+
if (-1 == listen(scgi_fd, 1024)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"listen failed:", strerror(errno));
return -1;
}
-
-#ifdef HAVE_FORK
+
+#ifdef HAVE_FORK
switch ((child = fork())) {
case 0: {
buffer *b;
size_t i = 0;
int fd = 0;
char_array env;
-
-
+
+
/* create environment */
env.ptr = NULL;
env.size = 0;
env.used = 0;
-
- if (scgi_fd != 0) {
- dup2(scgi_fd, 0);
- close(scgi_fd);
- }
-
+
/* we don't need the client socket */
for (fd = 3; fd < 256; fd++) {
- close(fd);
+ if (fd != 2 && fd != scgi_fd) close(fd);
}
-
+
/* build clean environment */
if (host->bin_env_copy->used) {
for (i = 0; i < host->bin_env_copy->used; i++) {
data_string *ds = (data_string *)host->bin_env_copy->data[i];
char *ge;
-
+
if (NULL != (ge = getenv(ds->value->ptr))) {
env_add(&env, CONST_BUF_LEN(ds->value), ge, strlen(ge));
}
@@ -808,46 +772,44 @@ static int scgi_spawn_connection(server *srv,
} else {
for (i = 0; environ[i]; i++) {
char *eq;
-
+
if (NULL != (eq = strchr(environ[i], '='))) {
env_add(&env, environ[i], eq - environ[i], eq+1, strlen(eq+1));
}
}
}
-
+
/* create environment */
for (i = 0; i < host->bin_env->used; i++) {
data_string *ds = (data_string *)host->bin_env->data[i];
-
+
env_add(&env, CONST_BUF_LEN(ds->key), CONST_BUF_LEN(ds->value));
}
-
+
for (i = 0; i < env.used; i++) {
/* search for PHP_FCGI_CHILDREN */
if (0 == strncmp(env.ptr[i], "PHP_FCGI_CHILDREN=", sizeof("PHP_FCGI_CHILDREN=") - 1)) break;
}
-
+
/* not found, add a default */
if (i == env.used) {
env_add(&env, CONST_STR_LEN("PHP_FCGI_CHILDREN"), CONST_STR_LEN("1"));
}
-
+
env.ptr[env.used] = NULL;
-
+
b = buffer_init();
- buffer_copy_string_len(b, CONST_STR_LEN("exec "));
+ buffer_copy_string(b, "exec ");
buffer_append_string_buffer(b, host->bin_path);
-
- reset_signals();
-
+
/* exec the cgi */
- execle("/bin/sh", "sh", "-c", b->ptr, (char *)NULL, env.ptr);
-
- log_error_write(srv, __FILE__, __LINE__, "sbs",
+ execle("/bin/sh", "sh", "-c", b->ptr, NULL, env.ptr);
+
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
"execl failed for:", host->bin_path, strerror(errno));
-
+
exit(errno);
-
+
break;
}
case -1:
@@ -855,32 +817,32 @@ static int scgi_spawn_connection(server *srv,
break;
default:
/* father */
-
+
/* wait */
select(0, NULL, NULL, NULL, &tv);
-
+
switch (waitpid(child, &status, WNOHANG)) {
case 0:
/* child still running after timeout, good */
break;
case -1:
/* no PID found ? should never happen */
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"pid not found:", strerror(errno));
return -1;
default:
/* the child should not terminate at all */
if (WIFEXITED(status)) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child exited (is this a SCGI binary ?):",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child exited (is this a SCGI binary ?):",
WEXITSTATUS(status));
} else if (WIFSIGNALED(status)) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child signaled:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child signaled:",
WTERMSIG(status));
} else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child died somehow:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child died somehow:",
status);
}
return -1;
@@ -890,26 +852,26 @@ static int scgi_spawn_connection(server *srv,
proc->pid = child;
proc->last_used = srv->cur_ts;
proc->is_local = 1;
-
+
break;
}
#endif
} else {
proc->is_local = 0;
proc->pid = 0;
-
+
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "sb",
"(debug) socket is already used, won't spawn:",
proc->socket);
}
}
-
+
proc->state = PROC_STATE_RUNNING;
host->active_procs++;
-
+
close(scgi_fd);
-
+
return 0;
}
@@ -918,89 +880,89 @@ SETDEFAULTS_FUNC(mod_scgi_set_defaults) {
plugin_data *p = p_d;
data_unset *du;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "scgi.server", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "scgi.debug", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
array *ca;
-
+
s = malloc(sizeof(plugin_config));
s->exts = scgi_extensions_init();
s->debug = 0;
-
+
cv[0].destination = s->exts;
cv[1].destination = &(s->debug);
-
+
p->config_storage[i] = s;
ca = ((data_config *)srv->config_context->data[i])->value;
-
+
if (0 != config_insert_values_global(srv, ca, cv)) {
return HANDLER_ERROR;
}
-
- /*
+
+ /*
* <key> = ( ... )
*/
-
+
if (NULL != (du = array_get_element(ca, "scgi.server"))) {
size_t j;
data_array *da = (data_array *)du;
-
+
if (du->type != TYPE_ARRAY) {
- log_error_write(srv, __FILE__, __LINE__, "sss",
+ log_error_write(srv, __FILE__, __LINE__, "sss",
"unexpected type for key: ", "scgi.server", "array of strings");
-
+
return HANDLER_ERROR;
}
-
-
- /*
- * scgi.server = ( "<ext>" => ( ... ),
+
+
+ /*
+ * scgi.server = ( "<ext>" => ( ... ),
* "<ext>" => ( ... ) )
*/
-
+
for (j = 0; j < da->value->used; j++) {
size_t n;
data_array *da_ext = (data_array *)da->value->data[j];
-
+
if (da->value->data[j]->type != TYPE_ARRAY) {
- log_error_write(srv, __FILE__, __LINE__, "sssbs",
- "unexpected type for key: ", "scgi.server",
+ log_error_write(srv, __FILE__, __LINE__, "sssbs",
+ "unexpected type for key: ", "scgi.server",
"[", da->value->data[j]->key, "](string)");
-
+
return HANDLER_ERROR;
}
-
- /*
- * da_ext->key == name of the extension
+
+ /*
+ * da_ext->key == name of the extension
*/
-
- /*
- * scgi.server = ( "<ext>" =>
- * ( "<host>" => ( ... ),
+
+ /*
+ * scgi.server = ( "<ext>" =>
+ * ( "<host>" => ( ... ),
* "<host>" => ( ... )
- * ),
+ * ),
* "<ext>" => ... )
*/
-
+
for (n = 0; n < da_ext->value->used; n++) {
data_array *da_host = (data_array *)da_ext->value->data[n];
-
+
scgi_extension_host *df;
-
- config_values_t fcv[] = {
+
+ config_values_t fcv[] = {
{ "host", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "docroot", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ "socket", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
{ "bin-path", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
-
+
{ "check-local", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 4 */
{ "port", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
{ "min-procs-not-working", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 7 this is broken for now */
@@ -1008,39 +970,37 @@ SETDEFAULTS_FUNC(mod_scgi_set_defaults) {
{ "max-load-per-proc", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
{ "idle-timeout", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
{ "disable-time", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
-
+
{ "bin-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
{ "bin-copy-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
- { "fix-root-scriptname", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
-
-
+
+
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (da_host->type != TYPE_ARRAY) {
- log_error_write(srv, __FILE__, __LINE__, "ssSBS",
- "unexpected type for key:",
- "scgi.server",
+ log_error_write(srv, __FILE__, __LINE__, "ssSBS",
+ "unexpected type for key:",
+ "scgi.server",
"[", da_host->key, "](string)");
-
+
return HANDLER_ERROR;
}
-
+
df = scgi_host_init();
-
+
df->check_local = 1;
df->min_procs = 4;
df->max_procs = 4;
df->max_load_per_proc = 1;
df->idle_timeout = 60;
df->disable_time = 60;
- df->fix_root_path_name = 0;
-
+
fcv[0].destination = df->host;
fcv[1].destination = df->docroot;
fcv[2].destination = df->unixsocket;
fcv[3].destination = df->bin_path;
-
+
fcv[4].destination = &(df->check_local);
fcv[5].destination = &(df->port);
fcv[6].destination = &(df->min_procs);
@@ -1048,49 +1008,47 @@ SETDEFAULTS_FUNC(mod_scgi_set_defaults) {
fcv[8].destination = &(df->max_load_per_proc);
fcv[9].destination = &(df->idle_timeout);
fcv[10].destination = &(df->disable_time);
-
+
fcv[11].destination = df->bin_env;
fcv[12].destination = df->bin_env_copy;
- fcv[13].destination = &(df->fix_root_path_name);
-
-
+
+
if (0 != config_insert_values_internal(srv, da_host->value, fcv)) {
return HANDLER_ERROR;
}
-
- if ((!buffer_is_empty(df->host) || df->port) &&
+
+ if ((!buffer_is_empty(df->host) || df->port) &&
!buffer_is_empty(df->unixsocket)) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"either host+port or socket");
-
+
return HANDLER_ERROR;
}
-
+
if (!buffer_is_empty(df->unixsocket)) {
/* unix domain socket */
- struct sockaddr_un un;
-
- if (df->unixsocket->used > sizeof(un.sun_path) - 2) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+
+ if (df->unixsocket->used > UNIX_PATH_MAX - 2) {
+ log_error_write(srv, __FILE__, __LINE__, "s",
"path of the unixdomain socket is too large");
return HANDLER_ERROR;
}
} else {
/* tcp/ip */
-
- if (buffer_is_empty(df->host) &&
+
+ if (buffer_is_empty(df->host) &&
buffer_is_empty(df->bin_path)) {
- log_error_write(srv, __FILE__, __LINE__, "sbbbs",
- "missing key (string):",
+ log_error_write(srv, __FILE__, __LINE__, "sbbbs",
+ "missing key (string):",
da->key,
da_ext->key,
da_host->key,
"host");
-
+
return HANDLER_ERROR;
} else if (df->port == 0) {
- log_error_write(srv, __FILE__, __LINE__, "sbbbs",
- "missing key (short):",
+ log_error_write(srv, __FILE__, __LINE__, "sbbbs",
+ "missing key (short):",
da->key,
da_ext->key,
da_host->key,
@@ -1098,17 +1056,14 @@ SETDEFAULTS_FUNC(mod_scgi_set_defaults) {
return HANDLER_ERROR;
}
}
-
- if (!buffer_is_empty(df->bin_path)) {
+
+ if (!buffer_is_empty(df->bin_path)) {
/* a local socket + self spawning */
size_t pno;
-
- /* HACK: just to make sure the adaptive spawing is disabled */
- df->min_procs = df->max_procs;
-
+
if (df->min_procs > df->max_procs) df->max_procs = df->min_procs;
if (df->max_load_per_proc < 1) df->max_load_per_proc = 0;
-
+
if (s->debug) {
log_error_write(srv, __FILE__, __LINE__, "ssbsdsbsdsd",
"--- scgi spawning local",
@@ -1118,7 +1073,7 @@ SETDEFAULTS_FUNC(mod_scgi_set_defaults) {
"\n\tmin-procs:", df->min_procs,
"\n\tmax-procs:", df->max_procs);
}
-
+
for (pno = 0; pno < df->min_procs; pno++) {
scgi_proc *proc;
@@ -1130,10 +1085,10 @@ SETDEFAULTS_FUNC(mod_scgi_set_defaults) {
proc->port = df->port + pno;
} else {
buffer_copy_string_buffer(proc->socket, df->unixsocket);
- buffer_append_string_len(proc->socket, CONST_STR_LEN("-"));
+ buffer_append_string(proc->socket, "-");
buffer_append_long(proc->socket, pno);
}
-
+
if (s->debug) {
log_error_write(srv, __FILE__, __LINE__, "ssdsbsdsd",
"--- scgi spawning",
@@ -1141,83 +1096,88 @@ SETDEFAULTS_FUNC(mod_scgi_set_defaults) {
"\n\tsocket", df->unixsocket,
"\n\tcurrent:", pno, "/", df->min_procs);
}
-
+
if (scgi_spawn_connection(srv, p, df, proc)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"[ERROR]: spawning fcgi failed.");
return HANDLER_ERROR;
}
-
+
proc->next = df->first;
if (df->first) df->first->prev = proc;
-
+
df->first = proc;
}
} else {
scgi_proc *fp;
-
+
fp = scgi_process_init();
fp->id = df->num_procs++;
df->max_id++;
df->active_procs++;
fp->state = PROC_STATE_RUNNING;
-
+
if (buffer_is_empty(df->unixsocket)) {
fp->port = df->port;
} else {
buffer_copy_string_buffer(fp->socket, df->unixsocket);
}
-
+
df->first = fp;
-
+
df->min_procs = 1;
df->max_procs = 1;
}
-
+
/* if extension already exists, take it */
scgi_extension_insert(s->exts, da_ext->key, df);
}
}
}
}
-
+
return HANDLER_GO_ON;
}
static int scgi_set_state(server *srv, handler_ctx *hctx, scgi_connection_state_t state) {
hctx->state = state;
hctx->state_timestamp = srv->cur_ts;
-
+
return 0;
}
-static void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
+void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
plugin_data *p;
connection *con;
-
+
if (NULL == hctx) return;
-
+
p = hctx->plugin_data;
con = hctx->remote_conn;
-
+
+ if (con->mode != p->id) {
+ WP();
+ return;
+ }
+
if (hctx->fd != -1) {
fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
fdevent_unregister(srv->ev, hctx->fd);
close(hctx->fd);
srv->cur_fds--;
}
-
+
if (hctx->host && hctx->proc) {
hctx->host->load--;
-
+
if (hctx->got_proc) {
/* after the connect the process gets a load */
hctx->proc->load--;
-
+
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "sddb",
- "release proc:",
+ "release proc:",
hctx->fd,
hctx->proc->pid, hctx->proc->socket);
}
@@ -1226,88 +1186,87 @@ static void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
scgi_proclist_sort_down(srv, hctx->host, hctx->proc);
}
-
+
handler_ctx_free(hctx);
- con->plugin_ctx[p->id] = NULL;
+ con->plugin_ctx[p->id] = NULL;
}
static int scgi_reconnect(server *srv, handler_ctx *hctx) {
plugin_data *p = hctx->plugin_data;
-
- /* child died
- *
- * 1.
- *
+
+ /* child died
+ *
+ * 1.
+ *
* connect was ok, connection was accepted
* but the php accept loop checks after the accept if it should die or not.
- *
- * if yes we can only detect it at a write()
- *
+ *
+ * if yes we can only detect it at a write()
+ *
* next step is resetting this attemp and setup a connection again
- *
+ *
* if we have more then 5 reconnects for the same request, die
- *
- * 2.
- *
+ *
+ * 2.
+ *
* we have a connection but the child died by some other reason
- *
+ *
*/
-
+
fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
fdevent_unregister(srv->ev, hctx->fd);
close(hctx->fd);
srv->cur_fds--;
-
+
scgi_set_state(srv, hctx, FCGI_STATE_INIT);
-
+
hctx->request_id = 0;
hctx->reconnects++;
-
+
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "sddb",
- "release proc:",
+ "release proc:",
hctx->fd,
hctx->proc->pid, hctx->proc->socket);
}
-
+
hctx->proc->load--;
scgi_proclist_sort_down(srv, hctx->host, hctx->proc);
-
+
return 0;
}
static handler_t scgi_connection_reset(server *srv, connection *con, void *p_d) {
plugin_data *p = p_d;
-
+
scgi_connection_cleanup(srv, con->plugin_ctx[p->id]);
-
+
return HANDLER_GO_ON;
}
static int scgi_env_add(buffer *env, const char *key, size_t key_len, const char *val, size_t val_len) {
size_t len;
-
+
if (!key || !val) return -1;
-
+
len = key_len + val_len + 2;
-
+
buffer_prepare_append(env, len);
- memcpy(env->ptr + env->used, key, key_len);
- env->ptr[env->used + key_len] = '\0';
+ /* include the NUL */
+ memcpy(env->ptr + env->used, key, key_len + 1);
env->used += key_len + 1;
- memcpy(env->ptr + env->used, val, val_len);
- env->ptr[env->used + val_len] = '\0';
+ memcpy(env->ptr + env->used, val, val_len + 1);
env->used += val_len + 1;
-
+
return 0;
}
/**
- *
+ *
* returns
* -1 error
* 0 connected
@@ -1321,13 +1280,13 @@ static int scgi_establish_connection(server *srv, handler_ctx *hctx) {
struct sockaddr_un scgi_addr_un;
#endif
socklen_t servlen;
-
+
scgi_extension_host *host = hctx->host;
scgi_proc *proc = hctx->proc;
int scgi_fd = hctx->fd;
-
+
memset(&scgi_addr, 0, sizeof(scgi_addr));
-
+
if (!buffer_is_empty(proc->socket)) {
#ifdef HAVE_SYS_UN_H
/* use the unix domain socket */
@@ -1337,7 +1296,7 @@ static int scgi_establish_connection(server *srv, handler_ctx *hctx) {
servlen = SUN_LEN(&scgi_addr_un);
#else
/* stevens says: */
- servlen = proc->socket->used + sizeof(scgi_addr_un.sun_family);
+ servlen = proc->socket->used - 1 + sizeof(scgi_addr_un.sun_family);
#endif
scgi_addr = (struct sockaddr *) &scgi_addr_un;
#else
@@ -1346,105 +1305,105 @@ static int scgi_establish_connection(server *srv, handler_ctx *hctx) {
} else {
scgi_addr_in.sin_family = AF_INET;
if (0 == inet_aton(host->host->ptr, &(scgi_addr_in.sin_addr))) {
- log_error_write(srv, __FILE__, __LINE__, "sbs",
- "converting IP-adress failed for", host->host,
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
+ "converting IP-adress failed for", host->host,
"\nBe sure to specify an IP address here");
-
+
return -1;
}
scgi_addr_in.sin_port = htons(proc->port);
servlen = sizeof(scgi_addr_in);
-
+
scgi_addr = (struct sockaddr *) &scgi_addr_in;
}
-
+
if (-1 == connect(scgi_fd, scgi_addr, servlen)) {
- if (errno == EINPROGRESS ||
+ if (errno == EINPROGRESS ||
errno == EALREADY ||
errno == EINTR) {
if (hctx->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"connect delayed, will continue later:", scgi_fd);
}
-
+
return 1;
} else {
- log_error_write(srv, __FILE__, __LINE__, "sdsddb",
- "connect failed:", scgi_fd,
+ log_error_write(srv, __FILE__, __LINE__, "sdsddb",
+ "connect failed:", scgi_fd,
strerror(errno), errno,
proc->port, proc->socket);
if (errno == EAGAIN) {
/* this is Linux only */
-
- log_error_write(srv, __FILE__, __LINE__, "s",
+
+ log_error_write(srv, __FILE__, __LINE__, "s",
"If this happend on Linux: You have been run out of local ports. "
"Check the manual, section Performance how to handle this.");
- }
-
+ }
+
return -1;
}
}
if (hctx->conf.debug > 1) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"connect succeeded: ", scgi_fd);
}
-
+
return 0;
}
static int scgi_env_add_request_headers(server *srv, connection *con, plugin_data *p) {
size_t i;
-
+
for (i = 0; i < con->request.headers->used; i++) {
data_string *ds;
-
+
ds = (data_string *)con->request.headers->data[i];
-
+
if (ds->value->used && ds->key->used) {
size_t j;
buffer_reset(srv->tmp_buf);
-
+
if (0 != strcasecmp(ds->key->ptr, "CONTENT-TYPE")) {
- buffer_copy_string_len(srv->tmp_buf, CONST_STR_LEN("HTTP_"));
+ BUFFER_COPY_STRING_CONST(srv->tmp_buf, "HTTP_");
srv->tmp_buf->used--;
}
-
+
buffer_prepare_append(srv->tmp_buf, ds->key->used + 2);
for (j = 0; j < ds->key->used - 1; j++) {
- srv->tmp_buf->ptr[srv->tmp_buf->used++] =
- light_isalpha(ds->key->ptr[j]) ?
+ srv->tmp_buf->ptr[srv->tmp_buf->used++] =
+ light_isalpha(ds->key->ptr[j]) ?
ds->key->ptr[j] & ~32 : '_';
}
srv->tmp_buf->ptr[srv->tmp_buf->used++] = '\0';
-
+
scgi_env_add(p->scgi_env, CONST_BUF_LEN(srv->tmp_buf), CONST_BUF_LEN(ds->value));
}
}
-
+
for (i = 0; i < con->environment->used; i++) {
data_string *ds;
-
+
ds = (data_string *)con->environment->data[i];
-
+
if (ds->value->used && ds->key->used) {
size_t j;
buffer_reset(srv->tmp_buf);
-
+
buffer_prepare_append(srv->tmp_buf, ds->key->used + 2);
for (j = 0; j < ds->key->used - 1; j++) {
- srv->tmp_buf->ptr[srv->tmp_buf->used++] =
- light_isalnum((unsigned char)ds->key->ptr[j]) ?
+ srv->tmp_buf->ptr[srv->tmp_buf->used++] =
+ isalpha((unsigned char)ds->key->ptr[j]) ?
toupper((unsigned char)ds->key->ptr[j]) : '_';
}
srv->tmp_buf->ptr[srv->tmp_buf->used++] = '\0';
-
+
scgi_env_add(p->scgi_env, CONST_BUF_LEN(srv->tmp_buf), CONST_BUF_LEN(ds->value));
}
}
-
+
return 0;
}
@@ -1456,48 +1415,34 @@ static int scgi_create_env(server *srv, handler_ctx *hctx) {
char b2[INET6_ADDRSTRLEN + 1];
#endif
buffer *b;
-
+
plugin_data *p = hctx->plugin_data;
scgi_extension_host *host= hctx->host;
connection *con = hctx->remote_conn;
server_socket *srv_sock = con->srv_socket;
-
+
sock_addr our_addr;
socklen_t our_addr_len;
-
+
buffer_prepare_copy(p->scgi_env, 1024);
/* CGI-SPEC 6.1.2, FastCGI spec 6.3 and SCGI spec */
-
+
/* request.content_length < SSIZE_MAX, see request.c */
- LI_ltostr(buf, con->request.content_length);
+ ltostr(buf, con->request.content_length);
scgi_env_add(p->scgi_env, CONST_STR_LEN("CONTENT_LENGTH"), buf, strlen(buf));
scgi_env_add(p->scgi_env, CONST_STR_LEN("SCGI"), CONST_STR_LEN("1"));
- if (buffer_is_empty(con->conf.server_tag)) {
- scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC));
- } else {
- scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag));
- }
-
+ scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
+
if (con->server_name->used) {
- size_t len = con->server_name->used - 1;
-
- if (con->server_name->ptr[0] == '[') {
- const char *colon = strstr(con->server_name->ptr, "]:");
- if (colon) len = (colon + 1) - con->server_name->ptr;
- } else {
- const char *colon = strchr(con->server_name->ptr, ':');
- if (colon) len = colon - con->server_name->ptr;
- }
-
- scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
+ scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
} else {
#ifdef HAVE_IPV6
- s = inet_ntop(srv_sock->addr.plain.sa_family,
- srv_sock->addr.plain.sa_family == AF_INET6 ?
+ s = inet_ntop(srv_sock->addr.plain.sa_family,
+ srv_sock->addr.plain.sa_family == AF_INET6 ?
(const void *) &(srv_sock->addr.ipv6.sin6_addr) :
(const void *) &(srv_sock->addr.ipv4.sin_addr),
b2, sizeof(b2)-1);
@@ -1506,47 +1451,47 @@ static int scgi_create_env(server *srv, handler_ctx *hctx) {
#endif
scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), s, strlen(s));
}
-
+
scgi_env_add(p->scgi_env, CONST_STR_LEN("GATEWAY_INTERFACE"), CONST_STR_LEN("CGI/1.1"));
-
- LI_ltostr(buf,
+
+ ltostr(buf,
#ifdef HAVE_IPV6
ntohs(srv_sock->addr.plain.sa_family ? srv_sock->addr.ipv6.sin6_port : srv_sock->addr.ipv4.sin_port)
#else
ntohs(srv_sock->addr.ipv4.sin_port)
#endif
);
-
+
scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_PORT"), buf, strlen(buf));
-
+
/* get the server-side of the connection to the client */
our_addr_len = sizeof(our_addr);
-
+
if (-1 == getsockname(con->fd, &(our_addr.plain), &our_addr_len)) {
s = inet_ntop_cache_get_ip(srv, &(srv_sock->addr));
} else {
s = inet_ntop_cache_get_ip(srv, &(our_addr));
}
scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_ADDR"), s, strlen(s));
-
- LI_ltostr(buf,
+
+ ltostr(buf,
#ifdef HAVE_IPV6
ntohs(con->dst_addr.plain.sa_family ? con->dst_addr.ipv6.sin6_port : con->dst_addr.ipv4.sin_port)
#else
ntohs(con->dst_addr.ipv4.sin_port)
#endif
);
-
+
scgi_env_add(p->scgi_env, CONST_STR_LEN("REMOTE_PORT"), buf, strlen(buf));
-
+
s = inet_ntop_cache_get_ip(srv, &(con->dst_addr));
scgi_env_add(p->scgi_env, CONST_STR_LEN("REMOTE_ADDR"), s, strlen(s));
-
+
if (!buffer_is_empty(con->authed_user)) {
scgi_env_add(p->scgi_env, CONST_STR_LEN("REMOTE_USER"),
CONST_BUF_LEN(con->authed_user));
}
-
+
/*
* SCRIPT_NAME, PATH_INFO and PATH_TRANSLATED according to
@@ -1555,16 +1500,16 @@ static int scgi_create_env(server *srv, handler_ctx *hctx) {
*/
scgi_env_add(p->scgi_env, CONST_STR_LEN("SCRIPT_NAME"), CONST_BUF_LEN(con->uri.path));
-
+
if (!buffer_is_empty(con->request.pathinfo)) {
scgi_env_add(p->scgi_env, CONST_STR_LEN("PATH_INFO"), CONST_BUF_LEN(con->request.pathinfo));
-
+
/* PATH_TRANSLATED is only defined if PATH_INFO is set */
-
+
if (!buffer_is_empty(host->docroot)) {
buffer_copy_string_buffer(p->path, host->docroot);
} else {
- buffer_copy_string_buffer(p->path, con->physical.basedir);
+ buffer_copy_string_buffer(p->path, con->physical.doc_root);
}
buffer_append_string_buffer(p->path, con->request.pathinfo);
scgi_env_add(p->scgi_env, CONST_STR_LEN("PATH_TRANSLATED"), CONST_BUF_LEN(p->path));
@@ -1581,21 +1526,21 @@ static int scgi_create_env(server *srv, handler_ctx *hctx) {
*/
if (!buffer_is_empty(host->docroot)) {
- /*
- * rewrite SCRIPT_FILENAME
- *
+ /*
+ * rewrite SCRIPT_FILENAME
+ *
*/
-
+
buffer_copy_string_buffer(p->path, host->docroot);
buffer_append_string_buffer(p->path, con->uri.path);
-
+
scgi_env_add(p->scgi_env, CONST_STR_LEN("SCRIPT_FILENAME"), CONST_BUF_LEN(p->path));
scgi_env_add(p->scgi_env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(host->docroot));
} else {
buffer_copy_string_buffer(p->path, con->physical.path);
-
+
scgi_env_add(p->scgi_env, CONST_STR_LEN("SCRIPT_FILENAME"), CONST_BUF_LEN(p->path));
- scgi_env_add(p->scgi_env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.basedir));
+ scgi_env_add(p->scgi_env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.doc_root));
}
scgi_env_add(p->scgi_env, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri));
if (!buffer_is_equal(con->request.uri, con->request.orig_uri)) {
@@ -1606,30 +1551,30 @@ static int scgi_create_env(server *srv, handler_ctx *hctx) {
} else {
scgi_env_add(p->scgi_env, CONST_STR_LEN("QUERY_STRING"), CONST_STR_LEN(""));
}
-
+
s = get_http_method_name(con->request.http_method);
scgi_env_add(p->scgi_env, CONST_STR_LEN("REQUEST_METHOD"), s, strlen(s));
scgi_env_add(p->scgi_env, CONST_STR_LEN("REDIRECT_STATUS"), CONST_STR_LEN("200")); /* if php is compiled with --force-redirect */
s = get_http_version_name(con->request.http_version);
scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_PROTOCOL"), s, strlen(s));
-
+
#ifdef USE_OPENSSL
if (srv_sock->is_ssl) {
scgi_env_add(p->scgi_env, CONST_STR_LEN("HTTPS"), CONST_STR_LEN("on"));
}
#endif
-
+
scgi_env_add_request_headers(srv, con, p);
b = chunkqueue_get_append_buffer(hctx->wb);
-
+
buffer_append_long(b, p->scgi_env->used);
buffer_append_string_len(b, CONST_STR_LEN(":"));
buffer_append_string_len(b, (const char *)p->scgi_env->ptr, p->scgi_env->used);
buffer_append_string_len(b, CONST_STR_LEN(","));
hctx->wb->bytes_in += b->used - 1;
-
+
if (con->request.content_length) {
chunkqueue *req_cq = con->request_content_queue;
chunk *req_c;
@@ -1642,7 +1587,7 @@ static int scgi_create_env(server *srv, handler_ctx *hctx) {
/* we announce toWrite octects
* now take all the request_content chunk that we need to fill this request
- * */
+ * */
switch (req_c->type) {
case FILE_CHUNK:
@@ -1670,18 +1615,32 @@ static int scgi_create_env(server *srv, handler_ctx *hctx) {
req_c->offset += weHave;
req_cq->bytes_out += weHave;
-
+
hctx->wb->bytes_in += weHave;
break;
default:
break;
}
-
+
offset += weHave;
}
}
-
+
+#if 0
+ for (i = 0; i < hctx->write_buffer->used; i++) {
+ fprintf(stderr, "%02x ", hctx->write_buffer->ptr[i]);
+ if ((i+1) % 16 == 0) {
+ size_t j;
+ for (j = i-15; j <= i; j++) {
+ fprintf(stderr, "%c",
+ isprint((unsigned char)hctx->write_buffer->ptr[j]) ? hctx->write_buffer->ptr[j] : '.');
+ }
+ fprintf(stderr, "\n");
+ }
+ }
+#endif
+
return 0;
}
@@ -1689,60 +1648,61 @@ static int scgi_response_parse(server *srv, connection *con, plugin_data *p, buf
char *ns;
const char *s;
int line = 0;
-
+
UNUSED(srv);
-
+
buffer_copy_string_buffer(p->parse_response, in);
-
- for (s = p->parse_response->ptr;
- NULL != (ns = (eol == EOL_RN ? strstr(s, "\r\n") : strchr(s, '\n')));
+
+ for (s = p->parse_response->ptr;
+ NULL != (ns = (eol == EOL_RN ? strstr(s, "\r\n") : strchr(s, '\n')));
s = ns + (eol == EOL_RN ? 2 : 1), line++) {
const char *key, *value;
int key_len;
data_string *ds;
-
+
ns[0] = '\0';
-
- if (line == 0 &&
+
+ if (line == 0 &&
0 == strncmp(s, "HTTP/1.", 7)) {
/* non-parsed header ... we parse them anyway */
-
+
if ((s[7] == '1' ||
s[7] == '0') &&
s[8] == ' ') {
int status;
/* after the space should be a status code for us */
-
+
status = strtol(s+9, NULL, 10);
-
- if (status >= 100 && status < 1000) {
- /* we expected 3 digits got them */
+
+ if (con->http_status >= 100 &&
+ con->http_status < 1000) {
+ /* we expected 3 digits and didn't got them */
con->parsed_response |= HTTP_STATUS;
con->http_status = status;
}
}
} else {
-
+
key = s;
if (NULL == (value = strchr(s, ':'))) {
/* we expect: "<key>: <value>\r\n" */
continue;
}
-
+
key_len = value - key;
value += 1;
-
+
/* skip LWS */
while (*value == ' ' || *value == '\t') value++;
-
+
if (NULL == (ds = (data_string *)array_get_unused_element(con->response.headers, TYPE_STRING))) {
ds = data_response_init();
}
buffer_copy_string_len(ds->key, key, key_len);
buffer_copy_string(ds->value, value);
-
+
array_insert_unique(con->response.headers, (data_unset *)ds);
-
+
switch(key_len) {
case 4:
if (0 == strncasecmp(key, "Date", key_len)) {
@@ -1777,13 +1737,13 @@ static int scgi_response_parse(server *srv, connection *con, plugin_data *p, buf
}
}
}
-
+
/* CGI/1.1 rev 03 - 7.2.1.2 */
if ((con->parsed_response & HTTP_LOCATION) &&
!(con->parsed_response & HTTP_STATUS)) {
con->http_status = 302;
}
-
+
return 0;
}
@@ -1791,10 +1751,10 @@ static int scgi_response_parse(server *srv, connection *con, plugin_data *p, buf
static int scgi_demux_response(server *srv, handler_ctx *hctx) {
plugin_data *p = hctx->plugin_data;
connection *con = hctx->remote_conn;
-
+
while(1) {
int n;
-
+
buffer_prepare_copy(hctx->response, 1024);
if (-1 == (n = read(hctx->fd, hctx->response->ptr, hctx->response->size - 1))) {
if (errno == EAGAIN || errno == EINTR) {
@@ -1805,145 +1765,143 @@ static int scgi_demux_response(server *srv, handler_ctx *hctx) {
log_error_write(srv, __FILE__, __LINE__, "sdd", strerror(errno), con->fd, hctx->fd);
return -1;
}
-
+
if (n == 0) {
/* read finished */
-
+
con->file_finished = 1;
-
+
/* send final chunk */
http_chunk_append_mem(srv, con, NULL, 0);
joblist_append(srv, con);
-
+
return 1;
}
-
+
hctx->response->ptr[n] = '\0';
hctx->response->used = n+1;
-
+
/* split header from body */
-
+
if (con->file_started == 0) {
char *c;
int in_header = 0;
int header_end = 0;
int cp, eol = EOL_UNSET;
size_t used = 0;
- size_t hlen = 0;
-
+
buffer_append_string_buffer(hctx->response_header, hctx->response);
-
+
/* nph (non-parsed headers) */
if (0 == strncmp(hctx->response_header->ptr, "HTTP/1.", 7)) in_header = 1;
-
+
/* search for the \r\n\r\n or \n\n in the string */
for (c = hctx->response_header->ptr, cp = 0, used = hctx->response_header->used - 1; used; c++, cp++, used--) {
if (*c == ':') in_header = 1;
else if (*c == '\n') {
if (in_header == 0) {
/* got a response without a response header */
-
+
c = NULL;
header_end = 1;
break;
}
-
+
if (eol == EOL_UNSET) eol = EOL_N;
-
+
if (*(c+1) == '\n') {
header_end = 1;
- hlen = cp + 2;
break;
}
-
+
} else if (used > 1 && *c == '\r' && *(c+1) == '\n') {
if (in_header == 0) {
/* got a response without a response header */
-
+
c = NULL;
header_end = 1;
break;
}
-
+
if (eol == EOL_UNSET) eol = EOL_RN;
-
+
if (used > 3 &&
- *(c+2) == '\r' &&
+ *(c+2) == '\r' &&
*(c+3) == '\n') {
header_end = 1;
- hlen = cp + 4;
break;
}
-
+
/* skip the \n */
c++;
cp++;
used--;
}
}
-
+
if (header_end) {
if (c == NULL) {
/* no header, but a body */
-
+
if (con->request.http_version == HTTP_VERSION_1_1) {
con->response.transfer_encoding = HTTP_TRANSFER_ENCODING_CHUNKED;
}
-
+
http_chunk_append_mem(srv, con, hctx->response_header->ptr, hctx->response_header->used);
joblist_append(srv, con);
} else {
+ size_t hlen = c - hctx->response_header->ptr + (eol == EOL_RN ? 4 : 2);
size_t blen = hctx->response_header->used - hlen - 1;
-
+
/* a small hack: terminate after at the second \r */
- hctx->response_header->used = hlen;
- hctx->response_header->ptr[hlen - 1] = '\0';
-
+ hctx->response_header->used = hlen + 1 - (eol == EOL_RN ? 2 : 1);
+ hctx->response_header->ptr[hlen - (eol == EOL_RN ? 2 : 1)] = '\0';
+
/* parse the response header */
scgi_response_parse(srv, con, p, hctx->response_header, eol);
-
+
/* enable chunked-transfer-encoding */
if (con->request.http_version == HTTP_VERSION_1_1 &&
!(con->parsed_response & HTTP_CONTENT_LENGTH)) {
con->response.transfer_encoding = HTTP_TRANSFER_ENCODING_CHUNKED;
}
-
+
if ((hctx->response->used != hlen) && blen > 0) {
- http_chunk_append_mem(srv, con, hctx->response_header->ptr + hlen, blen + 1);
+ http_chunk_append_mem(srv, con, c + (eol == EOL_RN ? 4: 2), blen + 1);
joblist_append(srv, con);
}
}
-
+
con->file_started = 1;
}
} else {
http_chunk_append_mem(srv, con, hctx->response->ptr, hctx->response->used);
joblist_append(srv, con);
}
-
-#if 0
+
+#if 0
log_error_write(srv, __FILE__, __LINE__, "ddss", con->fd, hctx->fd, connection_get_state(con->state), b->ptr);
#endif
}
-
+
return 0;
}
-static int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
+int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
scgi_proc *p;
-
+
UNUSED(srv);
-
- /* we have been the smallest of the current list
- * and we want to insert the node sorted as soon
+
+ /* we have been the smallest of the current list
+ * and we want to insert the node sorted as soon
* possible
*
- * 1 0 0 0 1 1 1
- * | ^
+ * 1 0 0 0 1 1 1
+ * | ^
* | |
* +------+
- *
+ *
*/
/* nothing to sort, only one element */
@@ -1951,9 +1909,9 @@ static int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_pr
for (p = proc; p->next && p->next->load < proc->load; p = p->next);
- /* no need to move something
+ /* no need to move something
*
- * 1 2 2 2 3 3 3
+ * 1 2 2 2 3 3 3
* ^
* |
* +
@@ -1972,16 +1930,16 @@ static int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_pr
if (proc->prev) proc->prev->next = proc->next;
if (proc->next) proc->next->prev = proc->prev;
-
+
/* proc should be right of p */
-
+
proc->next = p->next;
proc->prev = p;
if (p->next) p->next->prev = proc;
p->next = proc;
#if 0
for(p = host->first; p; p = p->next) {
- log_error_write(srv, __FILE__, __LINE__, "dd",
+ log_error_write(srv, __FILE__, __LINE__, "dd",
p->pid, p->load);
}
#else
@@ -1993,21 +1951,21 @@ static int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_pr
int scgi_proclist_sort_down(server *srv, scgi_extension_host *host, scgi_proc *proc) {
scgi_proc *p;
-
+
UNUSED(srv);
-
- /* we have been the smallest of the current list
- * and we want to insert the node sorted as soon
+
+ /* we have been the smallest of the current list
+ * and we want to insert the node sorted as soon
* possible
*
- * 0 0 0 0 1 0 1
+ * 0 0 0 0 1 0 1
* ^ |
* | |
* +----------+
*
*
* the basic is idea is:
- * - the last active scgi process should be still
+ * - the last active scgi process should be still
* in ram and is not swapped out yet
* - processes that are not reused will be killed
* after some time by the trigger-handler
@@ -2017,7 +1975,7 @@ int scgi_proclist_sort_down(server *srv, scgi_extension_host *host, scgi_proc *p
* ice-cold processes are propably unused since more
* than 'unused-timeout', are swaped out and won't be
* reused in the next seconds anyway.
- *
+ *
*/
/* nothing to sort, only one element */
@@ -2026,16 +1984,16 @@ int scgi_proclist_sort_down(server *srv, scgi_extension_host *host, scgi_proc *p
for (p = host->first; p != proc && p->load < proc->load; p = p->next);
- /* no need to move something
+ /* no need to move something
*
- * 1 2 2 2 3 3 3
+ * 1 2 2 2 3 3 3
* ^
* |
* +
*
*/
if (p == proc) return 0;
-
+
/* we have to move left. If we are already the first element
* we are done */
if (host->first == proc) return 0;
@@ -2051,9 +2009,9 @@ int scgi_proclist_sort_down(server *srv, scgi_extension_host *host, scgi_proc *p
p->prev = proc;
if (proc->prev == NULL) host->first = proc;
-#if 0
+#if 0
for(p = host->first; p; p = p->next) {
- log_error_write(srv, __FILE__, __LINE__, "dd",
+ log_error_write(srv, __FILE__, __LINE__, "dd",
p->pid, p->load);
}
#else
@@ -2065,40 +2023,40 @@ int scgi_proclist_sort_down(server *srv, scgi_extension_host *host, scgi_proc *p
static int scgi_restart_dead_procs(server *srv, plugin_data *p, scgi_extension_host *host) {
scgi_proc *proc;
-
+
for (proc = host->first; proc; proc = proc->next) {
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sbdbdddd",
- "proc:",
- host->host, proc->port,
+ log_error_write(srv, __FILE__, __LINE__, "sbdbdddd",
+ "proc:",
+ host->host, proc->port,
proc->socket,
proc->state,
proc->is_local,
proc->load,
proc->pid);
}
-
+
if (0 == proc->is_local) {
- /*
- * external servers might get disabled
- *
- * enable the server again, perhaps it is back again
+ /*
+ * external servers might get disabled
+ *
+ * enable the server again, perhaps it is back again
*/
-
+
if ((proc->state == PROC_STATE_DISABLED) &&
(srv->cur_ts - proc->disable_ts > host->disable_time)) {
proc->state = PROC_STATE_RUNNING;
host->active_procs++;
-
- log_error_write(srv, __FILE__, __LINE__, "sbdb",
- "fcgi-server re-enabled:",
- host->host, host->port,
+
+ log_error_write(srv, __FILE__, __LINE__, "sbdb",
+ "fcgi-server re-enabled:",
+ host->host, host->port,
host->unixsocket);
}
} else {
/* the child should not terminate at all */
int status;
-
+
if (proc->state == PROC_STATE_DIED_WAIT_FOR_PID) {
switch(waitpid(proc->pid, &status, WNOHANG)) {
case 0:
@@ -2109,33 +2067,33 @@ static int scgi_restart_dead_procs(server *srv, plugin_data *p, scgi_extension_h
default:
if (WIFEXITED(status)) {
#if 0
- log_error_write(srv, __FILE__, __LINE__, "sdsd",
+ log_error_write(srv, __FILE__, __LINE__, "sdsd",
"child exited, pid:", proc->pid,
"status:", WEXITSTATUS(status));
#endif
} else if (WIFSIGNALED(status)) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child signaled:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child signaled:",
WTERMSIG(status));
} else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child died somehow:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child died somehow:",
status);
}
-
+
proc->state = PROC_STATE_DIED;
break;
}
}
-
- /*
+
+ /*
* local servers might died, but we restart them
- *
+ *
*/
if (proc->state == PROC_STATE_DIED &&
proc->load == 0) {
/* restart the child */
-
+
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "ssdsbsdsd",
"--- scgi spawning",
@@ -2143,18 +2101,18 @@ static int scgi_restart_dead_procs(server *srv, plugin_data *p, scgi_extension_h
"\n\tsocket", host->unixsocket,
"\n\tcurrent:", 1, "/", host->min_procs);
}
-
+
if (scgi_spawn_connection(srv, p, host, proc)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"ERROR: spawning fcgi failed.");
return HANDLER_ERROR;
}
-
+
scgi_proclist_sort_down(srv, host, proc);
}
}
}
-
+
return 0;
}
@@ -2163,16 +2121,13 @@ static handler_t scgi_write_request(server *srv, handler_ctx *hctx) {
plugin_data *p = hctx->plugin_data;
scgi_extension_host *host= hctx->host;
connection *con = hctx->remote_conn;
-
+
int ret;
- /* sanity check */
- if (!host) {
- log_error_write(srv, __FILE__, __LINE__, "s", "fatal error: host = NULL");
- return HANDLER_ERROR;
- }
- if (((!host->host->used || !host->port) && !host->unixsocket->used)) {
- log_error_write(srv, __FILE__, __LINE__, "sxddd",
+ /* sanity check */
+ if (!host ||
+ ((!host->host->used || !host->port) && !host->unixsocket->used)) {
+ log_error_write(srv, __FILE__, __LINE__, "sxddd",
"write-req: error",
host,
host->host->used,
@@ -2180,183 +2135,190 @@ static handler_t scgi_write_request(server *srv, handler_ctx *hctx) {
host->unixsocket->used);
return HANDLER_ERROR;
}
-
+
switch(hctx->state) {
case FCGI_STATE_INIT:
ret = host->unixsocket->used ? AF_UNIX : AF_INET;
-
+
if (-1 == (hctx->fd = socket(ret, SOCK_STREAM, 0))) {
if (errno == EMFILE ||
errno == EINTR) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"wait for fd at connection:", con->fd);
-
+
return HANDLER_WAIT_FOR_FD;
}
-
- log_error_write(srv, __FILE__, __LINE__, "ssdd",
+
+ log_error_write(srv, __FILE__, __LINE__, "ssdd",
"socket failed:", strerror(errno), srv->cur_fds, srv->max_fds);
return HANDLER_ERROR;
}
hctx->fde_ndx = -1;
-
+
srv->cur_fds++;
-
+
fdevent_register(srv->ev, hctx->fd, scgi_handle_fdevent, hctx);
-
+
if (-1 == fdevent_fcntl_set(srv->ev, hctx->fd)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"fcntl failed: ", strerror(errno));
-
+
return HANDLER_ERROR;
}
-
+
/* fall through */
case FCGI_STATE_CONNECT:
if (hctx->state == FCGI_STATE_INIT) {
- for (hctx->proc = hctx->host->first;
- hctx->proc && hctx->proc->state != PROC_STATE_RUNNING;
+ for (hctx->proc = hctx->host->first;
+ hctx->proc && hctx->proc->state != PROC_STATE_RUNNING;
hctx->proc = hctx->proc->next);
-
+
/* all childs are dead */
if (hctx->proc == NULL) {
hctx->fde_ndx = -1;
-
+
return HANDLER_ERROR;
}
-
+
if (hctx->proc->is_local) {
hctx->pid = hctx->proc->pid;
}
-
+
switch (scgi_establish_connection(srv, hctx)) {
case 1:
scgi_set_state(srv, hctx, FCGI_STATE_CONNECT);
-
+
/* connection is in progress, wait for an event and call getsockopt() below */
-
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
-
+
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+
return HANDLER_WAIT_FOR_EVENT;
case -1:
/* if ECONNREFUSED choose another connection -> FIXME */
hctx->fde_ndx = -1;
-
+
return HANDLER_ERROR;
default:
/* everything is ok, go on */
break;
}
-
+
} else {
int socket_error;
socklen_t socket_error_len = sizeof(socket_error);
-
+
/* try to finish the connect() */
if (0 != getsockopt(hctx->fd, SOL_SOCKET, SO_ERROR, &socket_error, &socket_error_len)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"getsockopt failed:", strerror(errno));
-
+
return HANDLER_ERROR;
}
if (socket_error != 0) {
if (!hctx->proc->is_local || p->conf.debug) {
/* local procs get restarted */
-
+
log_error_write(srv, __FILE__, __LINE__, "ss",
- "establishing connection failed:", strerror(socket_error),
+ "establishing connection failed:", strerror(socket_error),
"port:", hctx->proc->port);
}
-
+
return HANDLER_ERROR;
}
}
-
+
/* ok, we have the connection */
-
+
hctx->proc->load++;
hctx->proc->last_used = srv->cur_ts;
hctx->got_proc = 1;
-
+
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "sddbdd",
- "got proc:",
+ "got proc:",
hctx->fd,
- hctx->proc->pid,
- hctx->proc->socket,
+ hctx->proc->pid,
+ hctx->proc->socket,
hctx->proc->port,
hctx->proc->load);
}
/* move the proc-list entry down the list */
scgi_proclist_sort_up(srv, hctx->host, hctx->proc);
-
+
scgi_set_state(srv, hctx, FCGI_STATE_PREPARE_WRITE);
/* fall through */
case FCGI_STATE_PREPARE_WRITE:
scgi_create_env(srv, hctx);
-
+
scgi_set_state(srv, hctx, FCGI_STATE_WRITE);
-
+
/* fall through */
case FCGI_STATE_WRITE:
- ret = srv->network_backend_write(srv, con, hctx->fd, hctx->wb, MAX_WRITE_LIMIT);
+ ret = srv->network_backend_write(srv, con, hctx->fd, hctx->wb);
chunkqueue_remove_finished_chunks(hctx->wb);
-
- if (ret < 0) {
- if (errno == ENOTCONN || ret == -2) {
- /* the connection got dropped after accept()
- *
- * this is most of the time a PHP which dies
+
+ if (-1 == ret) {
+ if (errno == ENOTCONN) {
+ /* the connection got dropped after accept()
+ *
+ * this is most of the time a PHP which dies
* after PHP_FCGI_MAX_REQUESTS
- *
- */
+ *
+ */
if (hctx->wb->bytes_out == 0 &&
hctx->reconnects < 5) {
- usleep(10000); /* take away the load of the webserver
- * to let the php a chance to restart
+ usleep(10000); /* take away the load of the webserver
+ * to let the php a chance to restart
*/
-
+
scgi_reconnect(srv, hctx);
-
+
return HANDLER_WAIT_FOR_FD;
}
-
+
/* not reconnected ... why
- *
+ *
* far@#lighttpd report this for FreeBSD
- *
+ *
*/
-
- log_error_write(srv, __FILE__, __LINE__, "ssosd",
- "connection was dropped after accept(). reconnect() denied:",
+
+ log_error_write(srv, __FILE__, __LINE__, "ssdsd",
+ "[REPORT ME] connection was dropped after accept(). reconnect() denied:",
"write-offset:", hctx->wb->bytes_out,
"reconnect attempts:", hctx->reconnects);
-
+
return HANDLER_ERROR;
- } else {
- /* -1 == ret => error on our side */
- log_error_write(srv, __FILE__, __LINE__, "ssd",
- "write failed:", strerror(errno), errno);
-
+ }
+
+ if ((errno != EAGAIN) &&
+ (errno != EINTR)) {
+
+ log_error_write(srv, __FILE__, __LINE__, "ssd",
+ "write failed:", strerror(errno), errno);
+
return HANDLER_ERROR;
+ } else {
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+
+ return HANDLER_WAIT_FOR_EVENT;
}
}
-
+
if (hctx->wb->bytes_out == hctx->wb->bytes_in) {
/* we don't need the out event anymore */
fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
scgi_set_state(srv, hctx, FCGI_STATE_READ);
} else {
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
-
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+
return HANDLER_WAIT_FOR_EVENT;
}
-
+
break;
case FCGI_STATE_READ:
/* waiting for a response */
@@ -2365,67 +2327,67 @@ static handler_t scgi_write_request(server *srv, handler_ctx *hctx) {
log_error_write(srv, __FILE__, __LINE__, "s", "(debug) unknown state");
return HANDLER_ERROR;
}
-
+
return HANDLER_WAIT_FOR_EVENT;
}
SUBREQUEST_FUNC(mod_scgi_handle_subrequest) {
plugin_data *p = p_d;
-
+
handler_ctx *hctx = con->plugin_ctx[p->id];
scgi_proc *proc;
scgi_extension_host *host;
-
+
if (NULL == hctx) return HANDLER_GO_ON;
-
+
/* not my job */
if (con->mode != p->id) return HANDLER_GO_ON;
-
+
/* ok, create the request */
switch(scgi_write_request(srv, hctx)) {
case HANDLER_ERROR:
proc = hctx->proc;
host = hctx->host;
-
- if (proc &&
+
+ if (proc &&
0 == proc->is_local &&
proc->state != PROC_STATE_DISABLED) {
/* only disable remote servers as we don't manage them*/
-
- log_error_write(srv, __FILE__, __LINE__, "sbdb", "fcgi-server disabled:",
+
+ log_error_write(srv, __FILE__, __LINE__, "sbdb", "fcgi-server disabled:",
host->host,
proc->port,
proc->socket);
-
+
/* disable this server */
proc->disable_ts = srv->cur_ts;
proc->state = PROC_STATE_DISABLED;
host->active_procs--;
}
-
+
if (hctx->state == FCGI_STATE_INIT ||
hctx->state == FCGI_STATE_CONNECT) {
- /* connect() or getsockopt() failed,
- * restart the request-handling
+ /* connect() or getsockopt() failed,
+ * restart the request-handling
*/
if (proc && proc->is_local) {
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "sbdb", "connect() to scgi failed, restarting the request-handling:",
+ log_error_write(srv, __FILE__, __LINE__, "sbdb", "connect() to scgi failed, restarting the request-handling:",
host->host,
proc->port,
proc->socket);
}
- /*
+ /*
* several hctx might reference the same proc
- *
+ *
* Only one of them should mark the proc as dead all the other
* ones should just take a new one.
- *
+ *
* If a new proc was started with the old struct this might lead
* the mark a perfect proc as dead otherwise
- *
+ *
*/
if (proc->state == PROC_STATE_RUNNING &&
hctx->pid == proc->pid) {
@@ -2433,25 +2395,25 @@ SUBREQUEST_FUNC(mod_scgi_handle_subrequest) {
}
}
scgi_restart_dead_procs(srv, p, host);
-
+
scgi_connection_cleanup(srv, hctx);
-
+
buffer_reset(con->physical.path);
con->mode = DIRECT;
joblist_append(srv, con);
-
- /* mis-using HANDLER_WAIT_FOR_FD to break out of the loop
- * and hope that the childs will be restarted
- *
+
+ /* mis-using HANDLER_WAIT_FOR_FD to break out of the loop
+ * and hope that the childs will be restarted
+ *
*/
return HANDLER_WAIT_FOR_FD;
} else {
scgi_connection_cleanup(srv, hctx);
-
+
buffer_reset(con->physical.path);
con->mode = DIRECT;
con->http_status = 503;
-
+
return HANDLER_FINISHED;
}
case HANDLER_WAIT_FOR_EVENT:
@@ -2469,28 +2431,35 @@ SUBREQUEST_FUNC(mod_scgi_handle_subrequest) {
}
static handler_t scgi_connection_close(server *srv, handler_ctx *hctx) {
+ plugin_data *p;
connection *con;
-
+
if (NULL == hctx) return HANDLER_GO_ON;
-
+
+ p = hctx->plugin_data;
con = hctx->remote_conn;
-
- log_error_write(srv, __FILE__, __LINE__, "ssdsd",
- "emergency exit: scgi:",
+
+ if (con->mode != p->id) return HANDLER_GO_ON;
+
+ log_error_write(srv, __FILE__, __LINE__, "ssdsd",
+ "emergency exit: scgi:",
"connection-fd:", con->fd,
"fcgi-fd:", hctx->fd);
-
+
+
+
scgi_connection_cleanup(srv, hctx);
-
+
return HANDLER_FINISHED;
}
-static handler_t scgi_handle_fdevent(server *srv, void *ctx, int revents) {
+static handler_t scgi_handle_fdevent(void *s, void *ctx, int revents) {
+ server *srv = (server *)s;
handler_ctx *hctx = ctx;
connection *con = hctx->remote_conn;
plugin_data *p = hctx->plugin_data;
-
+
scgi_proc *proc = hctx->proc;
scgi_extension_host *host= hctx->host;
@@ -2502,15 +2471,15 @@ static handler_t scgi_handle_fdevent(server *srv, void *ctx, int revents) {
case 1:
/* we are done */
scgi_connection_cleanup(srv, hctx);
-
+
joblist_append(srv, con);
return HANDLER_FINISHED;
case -1:
if (proc->pid && proc->state != PROC_STATE_DIED) {
int status;
-
+
/* only fetch the zombie if it is not already done */
-
+
switch(waitpid(proc->pid, &status, WNOHANG)) {
case 0:
/* child is still alive */
@@ -2520,19 +2489,19 @@ static handler_t scgi_handle_fdevent(server *srv, void *ctx, int revents) {
default:
/* the child should not terminate at all */
if (WIFEXITED(status)) {
- log_error_write(srv, __FILE__, __LINE__, "sdsd",
+ log_error_write(srv, __FILE__, __LINE__, "sdsd",
"child exited, pid:", proc->pid,
"status:", WEXITSTATUS(status));
} else if (WIFSIGNALED(status)) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child signaled:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child signaled:",
WTERMSIG(status));
} else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child died somehow:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child died somehow:",
status);
}
-
+
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "ssdsbsdsd",
"--- scgi spawning",
@@ -2540,117 +2509,117 @@ static handler_t scgi_handle_fdevent(server *srv, void *ctx, int revents) {
"\n\tsocket", host->unixsocket,
"\n\tcurrent:", 1, "/", host->min_procs);
}
-
+
if (scgi_spawn_connection(srv, p, host, proc)) {
/* child died */
proc->state = PROC_STATE_DIED;
} else {
scgi_proclist_sort_down(srv, host, proc);
}
-
+
break;
}
}
if (con->file_started == 0) {
/* nothing has been send out yet, try to use another child */
-
+
if (hctx->wb->bytes_out == 0 &&
hctx->reconnects < 5) {
scgi_reconnect(srv, hctx);
-
- log_error_write(srv, __FILE__, __LINE__, "ssdsd",
+
+ log_error_write(srv, __FILE__, __LINE__, "sdsdsd",
"response not sent, request not sent, reconnection.",
"connection-fd:", con->fd,
"fcgi-fd:", hctx->fd);
-
+
return HANDLER_WAIT_FOR_FD;
}
-
- log_error_write(srv, __FILE__, __LINE__, "sosdsd",
+
+ log_error_write(srv, __FILE__, __LINE__, "sdsdsd",
"response not sent, request sent:", hctx->wb->bytes_out,
"connection-fd:", con->fd,
"fcgi-fd:", hctx->fd);
-
+
scgi_connection_cleanup(srv, hctx);
-
+
connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
buffer_reset(con->physical.path);
con->http_status = 500;
con->mode = DIRECT;
} else {
/* response might have been already started, kill the connection */
- log_error_write(srv, __FILE__, __LINE__, "ssdsd",
+ scgi_connection_cleanup(srv, hctx);
+
+ log_error_write(srv, __FILE__, __LINE__, "ssdsd",
"response already sent out, termination connection",
"connection-fd:", con->fd,
"fcgi-fd:", hctx->fd);
-
- scgi_connection_cleanup(srv, hctx);
-
+
connection_set_state(srv, con, CON_STATE_ERROR);
}
/* */
-
-
+
+
joblist_append(srv, con);
return HANDLER_FINISHED;
}
}
-
+
if (revents & FDEVENT_OUT) {
if (hctx->state == FCGI_STATE_CONNECT ||
hctx->state == FCGI_STATE_WRITE) {
/* we are allowed to send something out
- *
+ *
* 1. in a unfinished connect() call
* 2. in a unfinished write() call (long POST request)
*/
return mod_scgi_handle_subrequest(srv, con, p);
} else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "got a FDEVENT_OUT and didn't know why:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "got a FDEVENT_OUT and didn't know why:",
hctx->state);
}
}
-
+
/* perhaps this issue is already handled */
if (revents & FDEVENT_HUP) {
if (hctx->state == FCGI_STATE_CONNECT) {
/* getoptsock will catch this one (right ?)
- *
- * if we are in connect we might get a EINPROGRESS
- * in the first call and a FDEVENT_HUP in the
+ *
+ * if we are in connect we might get a EINPROGRESS
+ * in the first call and a FDEVENT_HUP in the
* second round
- *
+ *
* FIXME: as it is a bit ugly.
- *
+ *
*/
return mod_scgi_handle_subrequest(srv, con, p);
} else if (hctx->state == FCGI_STATE_READ &&
hctx->proc->port == 0) {
/* FIXME:
- *
+ *
* ioctl says 8192 bytes to read from PHP and we receive directly a HUP for the socket
* even if the FCGI_FIN packet is not received yet
*/
} else {
- log_error_write(srv, __FILE__, __LINE__, "sbSBSDSd",
- "error: unexpected close of scgi connection for",
+ log_error_write(srv, __FILE__, __LINE__, "sbSBSDSd",
+ "error: unexpected close of scgi connection for",
con->uri.path,
- "(no scgi process on host: ",
+ "(no scgi process on host: ",
host->host,
- ", port: ",
+ ", port: ",
host->port,
" ?)",
hctx->state);
-
+
connection_set_state(srv, con, CON_STATE_ERROR);
scgi_connection_close(srv, hctx);
joblist_append(srv, con);
}
} else if (revents & FDEVENT_ERR) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"fcgi: got a FDEVENT_ERR. Don't know why.");
/* kill all connections to the scgi process */
@@ -2659,7 +2628,7 @@ static handler_t scgi_handle_fdevent(server *srv, void *ctx, int revents) {
scgi_connection_close(srv, hctx);
joblist_append(srv, con);
}
-
+
return HANDLER_FINISHED;
}
#define PATCH(x) \
@@ -2667,22 +2636,22 @@ static handler_t scgi_handle_fdevent(server *srv, void *ctx, int revents) {
static int scgi_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(exts);
PATCH(debug);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("scgi.server"))) {
PATCH(exts);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("scgi.debug"))) {
@@ -2690,7 +2659,7 @@ static int scgi_patch_connection(server *srv, connection *con, plugin_data *p) {
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -2700,181 +2669,167 @@ static handler_t scgi_check_extension(server *srv, connection *con, void *p_d, i
plugin_data *p = p_d;
size_t s_len;
int used = -1;
+ int ndx;
size_t k;
buffer *fn;
scgi_extension *extension = NULL;
- scgi_extension_host *host = NULL;
-
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
+
/* Possibly, we processed already this request */
if (con->file_started == 1) return HANDLER_GO_ON;
+
+ fn = con->uri.path;
- fn = uri_path_handler ? con->uri.path : con->physical.path;
-
- if (buffer_is_empty(fn)) return HANDLER_GO_ON;
+ if (fn->used == 0) {
+ return HANDLER_ERROR;
+ }
s_len = fn->used - 1;
-
+
scgi_patch_connection(srv, con, p);
/* check if extension matches */
for (k = 0; k < p->conf.exts->used; k++) {
size_t ct_len;
- scgi_extension *ext = p->conf.exts->exts[k];
-
- if (ext->key->used == 0) continue;
-
- ct_len = ext->key->used - 1;
-
+
+ extension = p->conf.exts->exts[k];
+
+ if (extension->key->used == 0) continue;
+
+ ct_len = extension->key->used - 1;
+
if (s_len < ct_len) continue;
-
+
/* check extension in the form "/scgi_pattern" */
- if (*(ext->key->ptr) == '/') {
- if (strncmp(fn->ptr, ext->key->ptr, ct_len) == 0) {
- extension = ext;
- break;
- }
- } else if (0 == strncmp(fn->ptr + s_len - ct_len, ext->key->ptr, ct_len)) {
+ if (*(extension->key->ptr) == '/' && strncmp(fn->ptr, extension->key->ptr, ct_len) == 0) {
+ break;
+ } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
/* check extension in the form ".fcg" */
- extension = ext;
break;
}
}
/* extension doesn't match */
- if (NULL == extension) {
+ if (k == p->conf.exts->used) {
return HANDLER_GO_ON;
}
-
+
/* get best server */
- for (k = 0; k < extension->used; k++) {
- scgi_extension_host *h = extension->hosts[k];
-
- /* we should have at least one proc that can do something */
- if (h->active_procs == 0) {
- continue;
- }
-
- if (used == -1 || h->load < used) {
- used = h->load;
-
- host = h;
+ for (k = 0, ndx = -1; k < extension->used; k++) {
+ scgi_extension_host *host = extension->hosts[k];
+
+ /* we should have at least one proc that can do somthing */
+ if (host->active_procs == 0) continue;
+
+ if (used == -1 || host->load < used) {
+ used = host->load;
+
+ ndx = k;
}
}
- if (!host) {
- /* sorry, we don't have a server alive for this ext */
- buffer_reset(con->physical.path);
- con->http_status = 500;
-
- /* only send the 'no handler' once */
- if (!extension->note_is_sent) {
- extension->note_is_sent = 1;
-
- log_error_write(srv, __FILE__, __LINE__, "sbsbs",
- "all handlers for ", con->uri.path,
- "on", extension->key,
- "are down.");
- }
-
- return HANDLER_FINISHED;
- }
-
- /* a note about no handler is not sent yet */
- extension->note_is_sent = 0;
-
- /*
- * if check-local is disabled, use the uri.path handler
- *
- */
+ /* found a server */
+ if (ndx != -1) {
+ scgi_extension_host *host = extension->hosts[ndx];
+
+ /*
+ * if check-local is disabled, use the uri.path handler
+ *
+ */
+
+ /* init handler-context */
+ if (uri_path_handler) {
+ if (host->check_local == 0) {
+ handler_ctx *hctx;
+ char *pathinfo;
+
+ hctx = handler_ctx_init();
+
+ hctx->remote_conn = con;
+ hctx->plugin_data = p;
+ hctx->host = host;
+ hctx->proc = NULL;
+
+ hctx->conf.exts = p->conf.exts;
+ hctx->conf.debug = p->conf.debug;
+
+ con->plugin_ctx[p->id] = hctx;
+
+ host->load++;
+
+ con->mode = p->id;
+
+ if (con->conf.log_request_handling) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "handling it in mod_scgi");
+ }
- /* init handler-context */
- if (uri_path_handler) {
- if (host->check_local == 0) {
+ /* the prefix is the SCRIPT_NAME,
+ * everthing from start to the next slash
+ * this is important for check-local = "disable"
+ *
+ * if prefix = /admin.fcgi
+ *
+ * /admin.fcgi/foo/bar
+ *
+ * SCRIPT_NAME = /admin.fcgi
+ * PATH_INFO = /foo/bar
+ *
+ * if prefix = /fcgi-bin/
+ *
+ * /fcgi-bin/foo/bar
+ *
+ * SCRIPT_NAME = /fcgi-bin/foo
+ * PATH_INFO = /bar
+ *
+ */
+
+ /* the rewrite is only done for /prefix/? matches */
+ if (extension->key->ptr[0] == '/' &&
+ con->uri.path->used > extension->key->used &&
+ NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
+ /* rewrite uri.path and pathinfo */
+
+ buffer_copy_string(con->request.pathinfo, pathinfo);
+
+ con->uri.path->used -= con->request.pathinfo->used - 1;
+ con->uri.path->ptr[con->uri.path->used - 1] = '\0';
+ }
+ }
+ return HANDLER_GO_ON;
+ } else {
handler_ctx *hctx;
- char *pathinfo;
-
hctx = handler_ctx_init();
-
+
hctx->remote_conn = con;
hctx->plugin_data = p;
hctx->host = host;
- hctx->proc = NULL;
-
+ hctx->proc = NULL;
+
hctx->conf.exts = p->conf.exts;
hctx->conf.debug = p->conf.debug;
-
+
con->plugin_ctx[p->id] = hctx;
-
+
host->load++;
-
+
con->mode = p->id;
-
+
if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "handling it in mod_fastcgi");
+ log_error_write(srv, __FILE__, __LINE__, "s", "handling it in mod_fastcgi");
}
- /* the prefix is the SCRIPT_NAME,
- * everything from start to the next slash
- * this is important for check-local = "disable"
- *
- * if prefix = /admin.fcgi
- *
- * /admin.fcgi/foo/bar
- *
- * SCRIPT_NAME = /admin.fcgi
- * PATH_INFO = /foo/bar
- *
- * if prefix = /fcgi-bin/
- *
- * /fcgi-bin/foo/bar
- *
- * SCRIPT_NAME = /fcgi-bin/foo
- * PATH_INFO = /bar
- *
- */
-
- /* the rewrite is only done for /prefix/? matches */
- if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
- buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
- con->uri.path->used = 1;
- con->uri.path->ptr[con->uri.path->used - 1] = '\0';
- } else if (extension->key->ptr[0] == '/' &&
- con->uri.path->used > extension->key->used &&
- NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
- /* rewrite uri.path and pathinfo */
-
- buffer_copy_string(con->request.pathinfo, pathinfo);
-
- con->uri.path->used -= con->request.pathinfo->used - 1;
- con->uri.path->ptr[con->uri.path->used - 1] = '\0';
- }
+ return HANDLER_GO_ON;
}
} else {
- handler_ctx *hctx;
- hctx = handler_ctx_init();
-
- hctx->remote_conn = con;
- hctx->plugin_data = p;
- hctx->host = host;
- hctx->proc = NULL;
-
- hctx->conf.exts = p->conf.exts;
- hctx->conf.debug = p->conf.debug;
-
- con->plugin_ctx[p->id] = hctx;
-
- host->load++;
-
- con->mode = p->id;
-
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s", "handling it in mod_fastcgi");
- }
+ /* no handler found */
+ buffer_reset(con->physical.path);
+ con->http_status = 500;
+
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "no fcgi-handler found for:",
+ fn);
+
+ return HANDLER_FINISHED;
}
-
return HANDLER_GO_ON;
}
@@ -2891,19 +2846,19 @@ static handler_t scgi_check_extension_2(server *srv, connection *con, void *p_d)
JOBLIST_FUNC(mod_scgi_handle_joblist) {
plugin_data *p = p_d;
handler_ctx *hctx = con->plugin_ctx[p->id];
-
+
if (hctx == NULL) return HANDLER_GO_ON;
if (hctx->fd != -1) {
switch (hctx->state) {
case FCGI_STATE_READ:
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
-
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+
break;
case FCGI_STATE_CONNECT:
case FCGI_STATE_WRITE:
- fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
-
+ fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+
break;
case FCGI_STATE_INIT:
/* at reconnect */
@@ -2920,21 +2875,21 @@ JOBLIST_FUNC(mod_scgi_handle_joblist) {
static handler_t scgi_connection_close_callback(server *srv, connection *con, void *p_d) {
plugin_data *p = p_d;
-
+
return scgi_connection_close(srv, con->plugin_ctx[p->id]);
}
TRIGGER_FUNC(mod_scgi_handle_trigger) {
plugin_data *p = p_d;
size_t i, j, n;
-
-
+
+
/* perhaps we should kill a connect attempt after 10-15 seconds
- *
+ *
* currently we wait for the TCP timeout which is on Linux 180 seconds
- *
- *
- *
+ *
+ *
+ *
*/
/* check all childs if they are still up */
@@ -2951,61 +2906,61 @@ TRIGGER_FUNC(mod_scgi_handle_trigger) {
scgi_extension *ex;
ex = exts->exts[j];
-
+
for (n = 0; n < ex->used; n++) {
-
+
scgi_proc *proc;
unsigned long sum_load = 0;
scgi_extension_host *host;
-
+
host = ex->hosts[n];
-
+
scgi_restart_dead_procs(srv, p, host);
-
+
for (proc = host->first; proc; proc = proc->next) {
sum_load += proc->load;
}
-
+
if (host->num_procs &&
host->num_procs < host->max_procs &&
(sum_load / host->num_procs) > host->max_load_per_proc) {
/* overload, spawn new child */
scgi_proc *fp = NULL;
-
+
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"overload detected, spawning a new child");
}
-
+
for (fp = host->unused_procs; fp && fp->pid != 0; fp = fp->next);
-
+
if (fp) {
if (fp == host->unused_procs) host->unused_procs = fp->next;
-
+
if (fp->next) fp->next->prev = NULL;
-
+
host->max_id++;
} else {
fp = scgi_process_init();
fp->id = host->max_id++;
}
-
+
host->num_procs++;
-
+
if (buffer_is_empty(host->unixsocket)) {
fp->port = host->port + fp->id;
} else {
buffer_copy_string_buffer(fp->socket, host->unixsocket);
- buffer_append_string_len(fp->socket, CONST_STR_LEN("-"));
+ buffer_append_string(fp->socket, "-");
buffer_append_long(fp->socket, fp->id);
}
-
+
if (scgi_spawn_connection(srv, p, host, fp)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"ERROR: spawning fcgi failed.");
return HANDLER_ERROR;
}
-
+
fp->prev = NULL;
fp->next = host->first;
if (host->first) {
@@ -3013,56 +2968,56 @@ TRIGGER_FUNC(mod_scgi_handle_trigger) {
}
host->first = fp;
}
-
+
for (proc = host->first; proc; proc = proc->next) {
if (proc->load != 0) break;
if (host->num_procs <= host->min_procs) break;
if (proc->pid == 0) continue;
-
+
if (srv->cur_ts - proc->last_used > host->idle_timeout) {
/* a proc is idling for a long time now,
* terminated it */
-
+
if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "ssbsd",
- "idle-timeout reached, terminating child:",
- "socket:", proc->socket,
+ log_error_write(srv, __FILE__, __LINE__, "ssbsd",
+ "idle-timeout reached, terminating child:",
+ "socket:", proc->socket,
"pid", proc->pid);
}
-
-
+
+
if (proc->next) proc->next->prev = proc->prev;
if (proc->prev) proc->prev->next = proc->next;
-
+
if (proc->prev == NULL) host->first = proc->next;
-
+
proc->prev = NULL;
proc->next = host->unused_procs;
-
+
if (host->unused_procs) host->unused_procs->prev = proc;
host->unused_procs = proc;
-
+
kill(proc->pid, SIGTERM);
-
+
proc->state = PROC_STATE_KILLED;
-
- log_error_write(srv, __FILE__, __LINE__, "ssbsd",
- "killed:",
- "socket:", proc->socket,
+
+ log_error_write(srv, __FILE__, __LINE__, "ssbsd",
+ "killed:",
+ "socket:", proc->socket,
"pid", proc->pid);
-
+
host->num_procs--;
-
+
/* proc is now in unused, let the next second handle the next process */
break;
- }
+ }
}
-
+
for (proc = host->unused_procs; proc; proc = proc->next) {
int status;
-
+
if (proc->pid == 0) continue;
-
+
switch (waitpid(proc->pid, &status, WNOHANG)) {
case 0:
/* child still running after timeout, good */
@@ -3070,10 +3025,10 @@ TRIGGER_FUNC(mod_scgi_handle_trigger) {
case -1:
if (errno != EINTR) {
/* no PID found ? should never happen */
- log_error_write(srv, __FILE__, __LINE__, "sddss",
+ log_error_write(srv, __FILE__, __LINE__, "sddss",
"pid ", proc->pid, proc->state,
"not found:", strerror(errno));
-
+
#if 0
if (errno == ECHILD) {
/* someone else has cleaned up for us */
@@ -3087,19 +3042,19 @@ TRIGGER_FUNC(mod_scgi_handle_trigger) {
/* the child should not terminate at all */
if (WIFEXITED(status)) {
if (proc->state != PROC_STATE_KILLED) {
- log_error_write(srv, __FILE__, __LINE__, "sdb",
- "child exited:",
+ log_error_write(srv, __FILE__, __LINE__, "sdb",
+ "child exited:",
WEXITSTATUS(status), proc->socket);
}
} else if (WIFSIGNALED(status)) {
if (WTERMSIG(status) != SIGTERM) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child signaled:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child signaled:",
WTERMSIG(status));
}
} else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "child died somehow:",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "child died somehow:",
status);
}
proc->pid = 0;
@@ -3115,7 +3070,6 @@ TRIGGER_FUNC(mod_scgi_handle_trigger) {
}
-int mod_scgi_plugin_init(plugin *p);
int mod_scgi_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("scgi");
@@ -3130,8 +3084,8 @@ int mod_scgi_plugin_init(plugin *p) {
p->handle_subrequest = mod_scgi_handle_subrequest;
p->handle_joblist = mod_scgi_handle_joblist;
p->handle_trigger = mod_scgi_handle_trigger;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_secure_download.c b/src/mod_secure_download.c
index a9c031f..5139507 100644
--- a/src/mod_secure_download.c
+++ b/src/mod_secure_download.c
@@ -1,14 +1,22 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
#include "plugin.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
-#include "md5.h"
+#ifdef USE_OPENSSL
+# include <openssl/md5.h>
+#else
+# include "md5.h"
+#endif
#define HASHLEN 16
typedef unsigned char HASH[HASHLEN];
@@ -17,7 +25,7 @@ typedef char HASHHEX[HASHHEXLEN+1];
#ifdef USE_OPENSSL
#define IN const
#else
-#define IN
+#define IN
#endif
#define OUT
@@ -28,28 +36,28 @@ typedef struct {
buffer *doc_root;
buffer *secret;
buffer *uri_prefix;
-
- unsigned int timeout;
+
+ time_t timeout;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
buffer *md5;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
/* init the plugin data */
INIT_FUNC(mod_secdownload_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->md5 = buffer_init();
-
+
return p;
}
@@ -57,27 +65,27 @@ INIT_FUNC(mod_secdownload_init) {
FREE_FUNC(mod_secdownload_free) {
plugin_data *p = p_d;
UNUSED(srv);
-
+
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
buffer_free(s->secret);
buffer_free(s->doc_root);
buffer_free(s->uri_prefix);
-
+
free(s);
}
free(p->config_storage);
}
-
+
buffer_free(p->md5);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -86,65 +94,65 @@ FREE_FUNC(mod_secdownload_free) {
SETDEFAULTS_FUNC(mod_secdownload_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "secdownload.secret", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "secdownload.document-root", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ "secdownload.uri-prefix", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
- { "secdownload.timeout", NULL, T_CONFIG_INT, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
+ { "secdownload.timeout", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->secret = buffer_init();
s->doc_root = buffer_init();
s->uri_prefix = buffer_init();
s->timeout = 60;
-
+
cv[0].destination = s->secret;
cv[1].destination = s->doc_root;
cv[2].destination = s->uri_prefix;
cv[3].destination = &(s->timeout);
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
}
-
+
return HANDLER_GO_ON;
}
/**
* checks if the supplied string is a MD5 string
- *
+ *
* @param str a possible MD5 string
* @return if the supplied string is a valid MD5 string 1 is returned otherwise 0
*/
-static int is_hex_len(const char *str, size_t len) {
+int is_hex_len(const char *str, size_t len) {
size_t i;
-
+
if (NULL == str) return 0;
-
+
for (i = 0; i < len && *str; i++, str++) {
/* illegal characters */
if (!((*str >= '0' && *str <= '9') ||
(*str >= 'a' && *str <= 'f') ||
- (*str >= 'A' && *str <= 'F'))
+ (*str >= 'A' && *str <= 'F'))
) {
return 0;
}
}
-
+
return i == len;
}
@@ -153,24 +161,24 @@ static int is_hex_len(const char *str, size_t len) {
static int mod_secdownload_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(secret);
PATCH(doc_root);
PATCH(uri_prefix);
PATCH(timeout);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("secdownload.secret"))) {
PATCH(secret);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("secdownload.document-root"))) {
@@ -182,7 +190,7 @@ static int mod_secdownload_patch_connection(server *srv, connection *con, plugin
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -190,112 +198,108 @@ static int mod_secdownload_patch_connection(server *srv, connection *con, plugin
URIHANDLER_FUNC(mod_secdownload_uri_handler) {
plugin_data *p = p_d;
- li_MD5_CTX Md5Ctx;
+ MD5_CTX Md5Ctx;
HASH HA1;
const char *rel_uri, *ts_str, *md5_str;
time_t ts = 0;
size_t i;
-
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
+
if (con->uri.path->used == 0) return HANDLER_GO_ON;
-
+
mod_secdownload_patch_connection(srv, con, p);
if (buffer_is_empty(p->conf.uri_prefix)) return HANDLER_GO_ON;
-
+
if (buffer_is_empty(p->conf.secret)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"secdownload.secret has to be set");
return HANDLER_ERROR;
}
-
+
if (buffer_is_empty(p->conf.doc_root)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"secdownload.document-root has to be set");
return HANDLER_ERROR;
}
-
- /*
+
+ /*
* /<uri-prefix>[a-f0-9]{32}/[a-f0-9]{8}/<rel-path>
*/
-
+
if (0 != strncmp(con->uri.path->ptr, p->conf.uri_prefix->ptr, p->conf.uri_prefix->used - 1)) return HANDLER_GO_ON;
-
+
md5_str = con->uri.path->ptr + p->conf.uri_prefix->used - 1;
-
+
if (!is_hex_len(md5_str, 32)) return HANDLER_GO_ON;
if (*(md5_str + 32) != '/') return HANDLER_GO_ON;
-
+
ts_str = md5_str + 32 + 1;
-
+
if (!is_hex_len(ts_str, 8)) return HANDLER_GO_ON;
if (*(ts_str + 8) != '/') return HANDLER_GO_ON;
-
+
for (i = 0; i < 8; i++) {
ts = (ts << 4) + hex2int(*(ts_str + i));
}
-
+
/* timed-out */
- if ( (srv->cur_ts > ts && (unsigned int) (srv->cur_ts - ts) > p->conf.timeout) ||
- (srv->cur_ts < ts && (unsigned int) (ts - srv->cur_ts) > p->conf.timeout) ) {
- /* "Gone" as the url will never be valid again instead of "408 - Timeout" where the request may be repeated */
- con->http_status = 410;
-
+ if (srv->cur_ts - ts > p->conf.timeout ||
+ srv->cur_ts - ts < -p->conf.timeout) {
+ con->http_status = 408;
+
return HANDLER_FINISHED;
}
-
+
rel_uri = ts_str + 8;
-
- /* checking MD5
- *
+
+ /* checking MD5
+ *
* <secret><rel-path><timestamp-hex>
*/
-
+
buffer_copy_string_buffer(p->md5, p->conf.secret);
buffer_append_string(p->md5, rel_uri);
buffer_append_string_len(p->md5, ts_str, 8);
-
- li_MD5_Init(&Md5Ctx);
- li_MD5_Update(&Md5Ctx, (unsigned char *)p->md5->ptr, p->md5->used - 1);
- li_MD5_Final(HA1, &Md5Ctx);
-
+
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)p->md5->ptr, p->md5->used - 1);
+ MD5_Final(HA1, &Md5Ctx);
+
buffer_copy_string_hex(p->md5, (char *)HA1, 16);
-
- if (0 != strncasecmp(md5_str, p->md5->ptr, 32)) {
+
+ if (0 != strncmp(md5_str, p->md5->ptr, 32)) {
con->http_status = 403;
-
- log_error_write(srv, __FILE__, __LINE__, "sss",
+
+ log_error_write(srv, __FILE__, __LINE__, "sss",
"md5 invalid:",
md5_str, p->md5->ptr);
-
+
return HANDLER_FINISHED;
}
-
+
/* starting with the last / we should have relative-path to the docroot
*/
-
+
buffer_copy_string_buffer(con->physical.doc_root, p->conf.doc_root);
buffer_copy_string(con->physical.rel_path, rel_uri);
buffer_copy_string_buffer(con->physical.path, con->physical.doc_root);
buffer_append_string_buffer(con->physical.path, con->physical.rel_path);
-
+
return HANDLER_GO_ON;
}
/* this function is called at dlopen() time and inits the callbacks */
-int mod_secdownload_plugin_init(plugin *p);
int mod_secdownload_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("secdownload");
-
+
p->init = mod_secdownload_init;
p->handle_physical = mod_secdownload_uri_handler;
p->set_defaults = mod_secdownload_set_defaults;
p->cleanup = mod_secdownload_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_setenv.c b/src/mod_setenv.c
index 4419b61..001b238 100644
--- a/src/mod_setenv.c
+++ b/src/mod_setenv.c
@@ -1,3 +1,6 @@
+#include <stdlib.h>
+#include <string.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -6,78 +9,56 @@
#include "response.h"
-#include <stdlib.h>
-#include <string.h>
-
/* plugin config for all request/connections */
typedef struct {
- int handled; /* make sure that we only apply the headers once */
-} handler_ctx;
-
-typedef struct {
array *request_header;
array *response_header;
-
+
array *environment;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
-static handler_ctx * handler_ctx_init() {
- handler_ctx * hctx;
-
- hctx = calloc(1, sizeof(*hctx));
-
- hctx->handled = 0;
-
- return hctx;
-}
-
-static void handler_ctx_free(handler_ctx *hctx) {
- free(hctx);
-}
-
-
/* init the plugin data */
INIT_FUNC(mod_setenv_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
return p;
}
/* detroy the plugin data */
FREE_FUNC(mod_setenv_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
array_free(s->request_header);
array_free(s->response_header);
array_free(s->environment);
-
+
free(s);
}
free(p->config_storage);
}
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -86,37 +67,37 @@ FREE_FUNC(mod_setenv_free) {
SETDEFAULTS_FUNC(mod_setenv_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "setenv.add-request-header", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "setenv.add-response-header", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ "setenv.add-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->request_header = array_init();
s->response_header = array_init();
s->environment = array_init();
-
+
cv[0].destination = s->request_header;
cv[1].destination = s->response_header;
cv[2].destination = s->environment;
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
}
-
+
return HANDLER_GO_ON;
}
@@ -125,23 +106,23 @@ SETDEFAULTS_FUNC(mod_setenv_set_defaults) {
static int mod_setenv_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(request_header);
PATCH(response_header);
PATCH(environment);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("setenv.add-request-header"))) {
PATCH(request_header);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("setenv.add-response-header"))) {
@@ -151,7 +132,7 @@ static int mod_setenv_patch_connection(server *srv, connection *con, plugin_data
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -159,90 +140,59 @@ static int mod_setenv_patch_connection(server *srv, connection *con, plugin_data
URIHANDLER_FUNC(mod_setenv_uri_handler) {
plugin_data *p = p_d;
size_t k;
- handler_ctx *hctx;
-
- if (con->plugin_ctx[p->id]) {
- hctx = con->plugin_ctx[p->id];
- } else {
- hctx = handler_ctx_init();
-
- con->plugin_ctx[p->id] = hctx;
- }
-
- if (hctx->handled) {
- return HANDLER_GO_ON;
- }
-
- hctx->handled = 1;
-
+
mod_setenv_patch_connection(srv, con, p);
for (k = 0; k < p->conf.request_header->used; k++) {
data_string *ds = (data_string *)p->conf.request_header->data[k];
data_string *ds_dst;
-
+
if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
ds_dst = data_string_init();
}
-
+
buffer_copy_string_buffer(ds_dst->key, ds->key);
buffer_copy_string_buffer(ds_dst->value, ds->value);
-
+
array_insert_unique(con->request.headers, (data_unset *)ds_dst);
}
-
+
for (k = 0; k < p->conf.environment->used; k++) {
data_string *ds = (data_string *)p->conf.environment->data[k];
data_string *ds_dst;
-
+
if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->environment, TYPE_STRING))) {
ds_dst = data_string_init();
}
-
+
buffer_copy_string_buffer(ds_dst->key, ds->key);
buffer_copy_string_buffer(ds_dst->value, ds->value);
-
+
array_insert_unique(con->environment, (data_unset *)ds_dst);
}
-
+
for (k = 0; k < p->conf.response_header->used; k++) {
data_string *ds = (data_string *)p->conf.response_header->data[k];
-
+
response_header_insert(srv, con, CONST_BUF_LEN(ds->key), CONST_BUF_LEN(ds->value));
}
-
+
/* not found */
return HANDLER_GO_ON;
}
-CONNECTION_FUNC(mod_setenv_reset) {
- plugin_data *p = p_d;
-
- UNUSED(srv);
-
- if (con->plugin_ctx[p->id]) {
- handler_ctx_free(con->plugin_ctx[p->id]);
- con->plugin_ctx[p->id] = NULL;
- }
-
- return HANDLER_GO_ON;
-}
-
/* this function is called at dlopen() time and inits the callbacks */
-int mod_setenv_plugin_init(plugin *p);
int mod_setenv_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("setenv");
-
+
p->init = mod_setenv_init;
p->handle_uri_clean = mod_setenv_uri_handler;
p->set_defaults = mod_setenv_set_defaults;
p->cleanup = mod_setenv_free;
-
- p->connection_reset = mod_setenv_reset;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_simple_vhost.c b/src/mod_simple_vhost.c
index bbb61d5..8f81384 100644
--- a/src/mod_simple_vhost.c
+++ b/src/mod_simple_vhost.c
@@ -1,3 +1,8 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -5,16 +10,15 @@
#include "plugin.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
typedef struct {
buffer *server_root;
buffer *default_host;
buffer *document_root;
-
+
buffer *docroot_cache_key;
buffer *docroot_cache_value;
buffer *docroot_cache_servername;
@@ -24,119 +28,119 @@ typedef struct {
typedef struct {
PLUGIN_DATA;
-
+
buffer *doc_root;
-
+
plugin_config **config_storage;
- plugin_config conf;
+ plugin_config conf;
} plugin_data;
INIT_FUNC(mod_simple_vhost_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->doc_root = buffer_init();
-
+
return p;
}
FREE_FUNC(mod_simple_vhost_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
buffer_free(s->document_root);
buffer_free(s->default_host);
buffer_free(s->server_root);
-
+
buffer_free(s->docroot_cache_key);
buffer_free(s->docroot_cache_value);
buffer_free(s->docroot_cache_servername);
-
+
free(s);
}
-
+
free(p->config_storage);
}
-
+
buffer_free(p->doc_root);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
SETDEFAULTS_FUNC(mod_simple_vhost_set_defaults) {
plugin_data *p = p_d;
size_t i;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "simple-vhost.server-root", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
{ "simple-vhost.default-host", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
{ "simple-vhost.document-root", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
{ "simple-vhost.debug", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
-
+
s->server_root = buffer_init();
s->default_host = buffer_init();
s->document_root = buffer_init();
-
+
s->docroot_cache_key = buffer_init();
s->docroot_cache_value = buffer_init();
s->docroot_cache_servername = buffer_init();
s->debug = 0;
-
+
cv[0].destination = s->server_root;
cv[1].destination = s->default_host;
cv[2].destination = s->document_root;
cv[3].destination = &(s->debug);
-
-
+
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
}
-
+
return HANDLER_GO_ON;
}
static int build_doc_root(server *srv, connection *con, plugin_data *p, buffer *out, buffer *host) {
stat_cache_entry *sce = NULL;
-
+
buffer_prepare_copy(out, 128);
if (p->conf.server_root->used) {
buffer_copy_string_buffer(out, p->conf.server_root);
-
+
if (host->used) {
/* a hostname has to start with a alpha-numerical character
* and must not contain a slash "/"
*/
char *dp;
-
+
BUFFER_APPEND_SLASH(out);
-
+
if (NULL == (dp = strchr(host->ptr, ':'))) {
buffer_append_string_buffer(out, host);
} else {
@@ -144,7 +148,7 @@ static int build_doc_root(server *srv, connection *con, plugin_data *p, buffer *
}
}
BUFFER_APPEND_SLASH(out);
-
+
if (p->conf.document_root->used > 2 && p->conf.document_root->ptr[0] == '/') {
buffer_append_string_len(out, p->conf.document_root->ptr + 1, p->conf.document_root->used - 2);
} else {
@@ -155,7 +159,7 @@ static int build_doc_root(server *srv, connection *con, plugin_data *p, buffer *
buffer_copy_string_buffer(out, con->conf.document_root);
BUFFER_APPEND_SLASH(out);
}
-
+
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, out, &sce)) {
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "sb",
@@ -165,7 +169,7 @@ static int build_doc_root(server *srv, connection *con, plugin_data *p, buffer *
} else if (!S_ISDIR(sce->st.st_mode)) {
return -1;
}
-
+
return 0;
}
@@ -175,29 +179,29 @@ static int build_doc_root(server *srv, connection *con, plugin_data *p, buffer *
static int mod_simple_vhost_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(server_root);
PATCH(default_host);
PATCH(document_root);
-
+
PATCH(docroot_cache_key);
PATCH(docroot_cache_value);
PATCH(docroot_cache_servername);
PATCH(debug);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("simple-vhost.server-root"))) {
PATCH(server_root);
PATCH(docroot_cache_key);
@@ -212,7 +216,7 @@ static int mod_simple_vhost_patch_connection(server *srv, connection *con, plugi
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -223,12 +227,12 @@ static handler_t mod_simple_vhost_docroot(server *srv, connection *con, void *p_
/*
* cache the last successfull translation from hostname (authority) to docroot
* - this saves us a stat() call
- *
+ *
*/
-
+
mod_simple_vhost_patch_connection(srv, con, p);
-
- if (p->conf.docroot_cache_key->used &&
+
+ if (p->conf.docroot_cache_key->used &&
con->uri.authority->used &&
buffer_is_equal(p->conf.docroot_cache_key, con->uri.authority)) {
/* cache hit */
@@ -239,44 +243,39 @@ static handler_t mod_simple_vhost_docroot(server *srv, connection *con, void *p_
if ((con->uri.authority->used == 0) ||
build_doc_root(srv, con, p, p->doc_root, con->uri.authority)) {
/* not found, fallback the default-host */
- if (build_doc_root(srv, con, p,
- p->doc_root,
+ if (build_doc_root(srv, con, p,
+ p->doc_root,
p->conf.default_host)) {
return HANDLER_GO_ON;
} else {
buffer_copy_string_buffer(con->server_name, p->conf.default_host);
- buffer_copy_string_buffer(con->physical.doc_root, p->doc_root);
-
- /* do not cache default host */
- return HANDLER_GO_ON;
}
} else {
buffer_copy_string_buffer(con->server_name, con->uri.authority);
}
-
+
/* copy to cache */
buffer_copy_string_buffer(p->conf.docroot_cache_key, con->uri.authority);
buffer_copy_string_buffer(p->conf.docroot_cache_value, p->doc_root);
buffer_copy_string_buffer(p->conf.docroot_cache_servername, con->server_name);
-
+
buffer_copy_string_buffer(con->physical.doc_root, p->doc_root);
}
-
+
return HANDLER_GO_ON;
}
-int mod_simple_vhost_plugin_init(plugin *p);
int mod_simple_vhost_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("simple_vhost");
-
+
p->init = mod_simple_vhost_init;
p->set_defaults = mod_simple_vhost_set_defaults;
p->handle_docroot = mod_simple_vhost_docroot;
p->cleanup = mod_simple_vhost_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_skeleton.c b/src/mod_skeleton.c
index 66de2b1..a3fa186 100644
--- a/src/mod_skeleton.c
+++ b/src/mod_skeleton.c
@@ -1,22 +1,26 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
#include "plugin.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/**
* this is a skeleton for a lighttpd plugin
- *
+ *
* just replaces every occurance of 'skeleton' by your plugin name
- *
+ *
* e.g. in vim:
- *
+ *
* :%s/skeleton/myhandler/
- *
+ *
*/
@@ -29,12 +33,12 @@ typedef struct {
typedef struct {
PLUGIN_DATA;
-
+
buffer *match_buf;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
typedef struct {
@@ -43,36 +47,36 @@ typedef struct {
static handler_ctx * handler_ctx_init() {
handler_ctx * hctx;
-
+
hctx = calloc(1, sizeof(*hctx));
-
+
return hctx;
}
static void handler_ctx_free(handler_ctx *hctx) {
-
+
free(hctx);
}
/* init the plugin data */
INIT_FUNC(mod_skeleton_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->match_buf = buffer_init();
-
+
return p;
}
/* detroy the plugin data */
FREE_FUNC(mod_skeleton_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
@@ -80,18 +84,18 @@ FREE_FUNC(mod_skeleton_free) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
-
+
array_free(s->match);
-
+
free(s);
}
free(p->config_storage);
}
-
+
buffer_free(p->match_buf);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -100,31 +104,31 @@ FREE_FUNC(mod_skeleton_free) {
SETDEFAULTS_FUNC(mod_skeleton_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "skeleton.array", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->match = array_init();
-
+
cv[0].destination = s->match;
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
}
-
+
return HANDLER_GO_ON;
}
@@ -133,27 +137,27 @@ SETDEFAULTS_FUNC(mod_skeleton_set_defaults) {
static int mod_skeleton_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(match);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("skeleton.array"))) {
PATCH(match);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -162,31 +166,29 @@ URIHANDLER_FUNC(mod_skeleton_uri_handler) {
plugin_data *p = p_d;
int s_len;
size_t k, i;
-
+
UNUSED(srv);
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
if (con->uri.path->used == 0) return HANDLER_GO_ON;
-
+
mod_skeleton_patch_connection(srv, con, p);
s_len = con->uri.path->used - 1;
-
+
for (k = 0; k < p->conf.match->used; k++) {
data_string *ds = (data_string *)p->conf.match->data[k];
int ct_len = ds->value->used - 1;
-
+
if (ct_len > s_len) continue;
if (ds->value->used == 0) continue;
-
+
if (0 == strncmp(con->uri.path->ptr + s_len - ct_len, ds->value->ptr, ct_len)) {
con->http_status = 403;
-
+
return HANDLER_FINISHED;
}
}
-
+
/* not found */
return HANDLER_GO_ON;
}
@@ -196,13 +198,13 @@ URIHANDLER_FUNC(mod_skeleton_uri_handler) {
int mod_skeleton_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("skeleton");
-
+
p->init = mod_skeleton_init;
p->handle_uri_clean = mod_skeleton_uri_handler;
p->set_defaults = mod_skeleton_set_defaults;
p->cleanup = mod_skeleton_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_ssi.c b/src/mod_ssi.c
index 897f49e..b6a19d7 100644
--- a/src/mod_ssi.c
+++ b/src/mod_ssi.c
@@ -1,3 +1,13 @@
+#include <sys/types.h>
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <time.h>
+#include <unistd.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -14,46 +24,30 @@
#include "sys-socket.h"
-#include <sys/types.h>
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <time.h>
-#include <unistd.h>
-
#ifdef HAVE_PWD_H
-# include <pwd.h>
+#include <pwd.h>
#endif
#ifdef HAVE_FORK
-# include <sys/wait.h>
+#include <sys/wait.h>
#endif
#ifdef HAVE_SYS_FILIO_H
-# include <sys/filio.h>
+#include <sys/filio.h>
#endif
-#include "etag.h"
-#include "version.h"
-
-/* The newest modified time of included files for include statement */
-static volatile time_t include_file_last_mtime = 0;
-
/* init the plugin data */
INIT_FUNC(mod_ssi_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->timefmt = buffer_init();
p->stat_fn = buffer_init();
-
+
p->ssi_vars = array_init();
p->ssi_cgi_env = array_init();
-
+
return p;
}
@@ -61,22 +55,21 @@ INIT_FUNC(mod_ssi_init) {
FREE_FUNC(mod_ssi_free) {
plugin_data *p = p_d;
UNUSED(srv);
-
+
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
array_free(s->ssi_extension);
- buffer_free(s->content_type);
-
+
free(s);
}
free(p->config_storage);
}
-
+
array_free(p->ssi_vars);
array_free(p->ssi_cgi_env);
#ifdef HAVE_PCRE_H
@@ -84,9 +77,9 @@ FREE_FUNC(mod_ssi_free) {
#endif
buffer_free(p->timefmt);
buffer_free(p->stat_fn);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -99,39 +92,36 @@ SETDEFAULTS_FUNC(mod_ssi_set_defaults) {
const char *errptr;
int erroff;
#endif
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "ssi.extension", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { "ssi.content-type", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->ssi_extension = array_init();
- s->content_type = buffer_init();
-
+
cv[0].destination = s->ssi_extension;
- cv[1].destination = s->content_type;
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
}
-
+
#ifdef HAVE_PCRE_H
/* allow 2 params */
if (NULL == (p->ssi_regex = pcre_compile("<!--#([a-z]+)\\s+(?:([a-z]+)=\"(.*?)(?<!\\\\)\"\\s*)?(?:([a-z]+)=\"(.*?)(?<!\\\\)\"\\s*)?-->", 0, &errptr, &erroff, NULL))) {
log_error_write(srv, __FILE__, __LINE__, "sds",
- "ssi: pcre ",
+ "ssi: pcre ",
erroff, errptr);
return HANDLER_ERROR;
}
@@ -140,52 +130,52 @@ SETDEFAULTS_FUNC(mod_ssi_set_defaults) {
"mod_ssi: pcre support is missing, please recompile with pcre support or remove mod_ssi from the list of modules");
return HANDLER_ERROR;
#endif
-
+
return HANDLER_GO_ON;
}
-static int ssi_env_add(array *env, const char *key, const char *val) {
+int ssi_env_add(array *env, const char *key, const char *val) {
data_string *ds;
-
+
if (NULL == (ds = (data_string *)array_get_unused_element(env, TYPE_STRING))) {
ds = data_string_init();
}
buffer_copy_string(ds->key, key);
buffer_copy_string(ds->value, val);
-
+
array_insert_unique(env, (data_unset *)ds);
-
+
return 0;
}
/**
*
* the next two functions are take from fcgi.c
- *
+ *
*/
static int ssi_env_add_request_headers(server *srv, connection *con, plugin_data *p) {
size_t i;
-
+
for (i = 0; i < con->request.headers->used; i++) {
data_string *ds;
-
+
ds = (data_string *)con->request.headers->data[i];
-
+
if (ds->value->used && ds->key->used) {
size_t j;
buffer_reset(srv->tmp_buf);
-
+
/* don't forward the Authorization: Header */
if (0 == strcasecmp(ds->key->ptr, "AUTHORIZATION")) {
continue;
}
-
+
if (0 != strcasecmp(ds->key->ptr, "CONTENT-TYPE")) {
- buffer_copy_string_len(srv->tmp_buf, CONST_STR_LEN("HTTP_"));
+ buffer_copy_string(srv->tmp_buf, "HTTP_");
srv->tmp_buf->used--;
}
-
+
buffer_prepare_append(srv->tmp_buf, ds->key->used + 2);
for (j = 0; j < ds->key->used - 1; j++) {
char c = '_';
@@ -199,61 +189,33 @@ static int ssi_env_add_request_headers(server *srv, connection *con, plugin_data
srv->tmp_buf->ptr[srv->tmp_buf->used++] = c;
}
srv->tmp_buf->ptr[srv->tmp_buf->used] = '\0';
-
+
ssi_env_add(p->ssi_cgi_env, srv->tmp_buf->ptr, ds->value->ptr);
}
}
-
- for (i = 0; i < con->environment->used; i++) {
- data_string *ds;
-
- ds = (data_string *)con->environment->data[i];
-
- if (ds->value->used && ds->key->used) {
- size_t j;
-
- buffer_reset(srv->tmp_buf);
- buffer_prepare_append(srv->tmp_buf, ds->key->used + 2);
-
- for (j = 0; j < ds->key->used - 1; j++) {
- char c = '_';
- if (light_isalpha(ds->key->ptr[j])) {
- /* upper-case */
- c = ds->key->ptr[j] & ~32;
- } else if (light_isdigit(ds->key->ptr[j])) {
- /* copy */
- c = ds->key->ptr[j];
- }
- srv->tmp_buf->ptr[srv->tmp_buf->used++] = c;
- }
- srv->tmp_buf->ptr[srv->tmp_buf->used] = '\0';
-
- ssi_env_add(p->ssi_cgi_env, srv->tmp_buf->ptr, ds->value->ptr);
- }
- }
-
+
return 0;
}
static int build_ssi_cgi_vars(server *srv, connection *con, plugin_data *p) {
char buf[32];
-
+
server_socket *srv_sock = con->srv_socket;
-
+
#ifdef HAVE_IPV6
char b2[INET6_ADDRSTRLEN + 1];
#endif
#define CONST_STRING(x) \
x
-
+
array_reset(p->ssi_cgi_env);
-
- ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_SOFTWARE"), PACKAGE_DESC);
+
+ ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_SOFTWARE"), PACKAGE_NAME"/"PACKAGE_VERSION);
ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_NAME"),
#ifdef HAVE_IPV6
- inet_ntop(srv_sock->addr.plain.sa_family,
- srv_sock->addr.plain.sa_family == AF_INET6 ?
+ inet_ntop(srv_sock->addr.plain.sa_family,
+ srv_sock->addr.plain.sa_family == AF_INET6 ?
(const void *) &(srv_sock->addr.ipv6.sin6_addr) :
(const void *) &(srv_sock->addr.ipv4.sin_addr),
b2, sizeof(b2)-1)
@@ -262,30 +224,30 @@ static int build_ssi_cgi_vars(server *srv, connection *con, plugin_data *p) {
#endif
);
ssi_env_add(p->ssi_cgi_env, CONST_STRING("GATEWAY_INTERFACE"), "CGI/1.1");
-
- LI_ltostr(buf,
+
+ ltostr(buf,
#ifdef HAVE_IPV6
ntohs(srv_sock->addr.plain.sa_family ? srv_sock->addr.ipv6.sin6_port : srv_sock->addr.ipv4.sin_port)
#else
ntohs(srv_sock->addr.ipv4.sin_port)
#endif
);
-
+
ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_PORT"), buf);
-
+
ssi_env_add(p->ssi_cgi_env, CONST_STRING("REMOTE_ADDR"),
inet_ntop_cache_get_ip(srv, &(con->dst_addr)));
-
+
if (con->authed_user->used) {
ssi_env_add(p->ssi_cgi_env, CONST_STRING("REMOTE_USER"),
con->authed_user->ptr);
}
-
+
if (con->request.content_length > 0) {
/* CGI-SPEC 6.1.2 and FastCGI spec 6.3 */
-
+
/* request.content_length < SSIZE_MAX, see request.c */
- LI_ltostr(buf, con->request.content_length);
+ ltostr(buf, con->request.content_length);
ssi_env_add(p->ssi_cgi_env, CONST_STRING("CONTENT_LENGTH"), buf);
}
@@ -309,30 +271,30 @@ static int build_ssi_cgi_vars(server *srv, connection *con, plugin_data *p) {
if (con->request.pathinfo->used) {
ssi_env_add(p->ssi_cgi_env, CONST_STRING("PATH_INFO"), con->request.pathinfo->ptr);
}
-
+
ssi_env_add(p->ssi_cgi_env, CONST_STRING("SCRIPT_FILENAME"), con->physical.path->ptr);
ssi_env_add(p->ssi_cgi_env, CONST_STRING("DOCUMENT_ROOT"), con->physical.doc_root->ptr);
-
+
ssi_env_add(p->ssi_cgi_env, CONST_STRING("REQUEST_URI"), con->request.uri->ptr);
ssi_env_add(p->ssi_cgi_env, CONST_STRING("QUERY_STRING"), con->uri.query->used ? con->uri.query->ptr : "");
ssi_env_add(p->ssi_cgi_env, CONST_STRING("REQUEST_METHOD"), get_http_method_name(con->request.http_method));
ssi_env_add(p->ssi_cgi_env, CONST_STRING("REDIRECT_STATUS"), "200");
ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_PROTOCOL"), get_http_version_name(con->request.http_version));
-
+
ssi_env_add_request_headers(srv, con, p);
-
+
return 0;
}
-static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
+static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
const char **l, size_t n) {
size_t i, ssicmd = 0;
char buf[255];
buffer *b = NULL;
-
- struct {
+
+ struct {
const char *var;
- enum { SSI_UNSET, SSI_ECHO, SSI_FSIZE, SSI_INCLUDE, SSI_FLASTMOD,
+ enum { SSI_UNSET, SSI_ECHO, SSI_FSIZE, SSI_INCLUDE, SSI_FLASTMOD,
SSI_CONFIG, SSI_PRINTENV, SSI_SET, SSI_IF, SSI_ELIF,
SSI_ELSE, SSI_ENDIF, SSI_EXEC } type;
} ssicmds[] = {
@@ -348,28 +310,27 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
{ "endif", SSI_ENDIF },
{ "else", SSI_ELSE },
{ "exec", SSI_EXEC },
-
+
{ NULL, SSI_UNSET }
};
-
+
for (i = 0; ssicmds[i].var; i++) {
if (0 == strcmp(l[1], ssicmds[i].var)) {
ssicmd = ssicmds[i].type;
break;
}
}
-
+
switch(ssicmd) {
case SSI_ECHO: {
/* echo */
- int var = 0;
- /* int enc = 0; */
+ int var = 0, enc = 0;
const char *var_val = NULL;
stat_cache_entry *sce = NULL;
-
- struct {
+
+ struct {
const char *var;
- enum { SSI_ECHO_UNSET, SSI_ECHO_DATE_GMT, SSI_ECHO_DATE_LOCAL, SSI_ECHO_DOCUMENT_NAME, SSI_ECHO_DOCUMENT_URI,
+ enum { SSI_ECHO_UNSET, SSI_ECHO_DATE_GMT, SSI_ECHO_DATE_LOCAL, SSI_ECHO_DOCUMENT_NAME, SSI_ECHO_DOCUMENT_URI,
SSI_ECHO_LAST_MODIFIED, SSI_ECHO_USER_NAME } type;
} echovars[] = {
{ "DATE_GMT", SSI_ECHO_DATE_GMT },
@@ -378,29 +339,27 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
{ "DOCUMENT_URI", SSI_ECHO_DOCUMENT_URI },
{ "LAST_MODIFIED", SSI_ECHO_LAST_MODIFIED },
{ "USER_NAME", SSI_ECHO_USER_NAME },
-
+
{ NULL, SSI_ECHO_UNSET }
};
-
-/*
- struct {
+
+ struct {
const char *var;
enum { SSI_ENC_UNSET, SSI_ENC_URL, SSI_ENC_NONE, SSI_ENC_ENTITY } type;
} encvars[] = {
{ "url", SSI_ENC_URL },
{ "none", SSI_ENC_NONE },
{ "entity", SSI_ENC_ENTITY },
-
+
{ NULL, SSI_ENC_UNSET }
};
-*/
-
+
for (i = 2; i < n; i += 2) {
if (0 == strcmp(l[i], "var")) {
int j;
-
+
var_val = l[i+1];
-
+
for (j = 0; echovars[j].var; j++) {
if (0 == strcmp(l[i+1], echovars[j].var)) {
var = echovars[j].type;
@@ -408,38 +367,36 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
}
}
} else if (0 == strcmp(l[i], "encoding")) {
-/*
int j;
-
+
for (j = 0; encvars[j].var; j++) {
if (0 == strcmp(l[i+1], encvars[j].var)) {
enc = encvars[j].type;
break;
}
}
-*/
} else {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: unknow attribute for ",
+ "ssi: unknow attribute for ",
l[1], l[i]);
}
}
-
+
if (p->if_is_false) break;
-
+
if (!var_val) {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: ",
+ "ssi: ",
l[1], "var is missing");
break;
}
stat_cache_get_entry(srv, con, con->physical.path, &sce);
-
+
switch(var) {
case SSI_ECHO_USER_NAME: {
struct passwd *pw;
-
+
b = chunkqueue_get_append_buffer(con->write_queue);
#ifdef HAVE_PWD_H
if (NULL == (pw = getpwuid(sce->st.st_uid))) {
@@ -454,10 +411,10 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
}
case SSI_ECHO_LAST_MODIFIED: {
time_t t = sce->st.st_mtime;
-
+
b = chunkqueue_get_append_buffer(con->write_queue);
if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, localtime(&t))) {
- buffer_copy_string_len(b, CONST_STR_LEN("(none)"));
+ buffer_copy_string(b, "(none)");
} else {
buffer_copy_string(b, buf);
}
@@ -465,10 +422,10 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
}
case SSI_ECHO_DATE_LOCAL: {
time_t t = time(NULL);
-
+
b = chunkqueue_get_append_buffer(con->write_queue);
if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, localtime(&t))) {
- buffer_copy_string_len(b, CONST_STR_LEN("(none)"));
+ buffer_copy_string(b, "(none)");
} else {
buffer_copy_string(b, buf);
}
@@ -476,10 +433,10 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
}
case SSI_ECHO_DATE_GMT: {
time_t t = time(NULL);
-
+
b = chunkqueue_get_append_buffer(con->write_queue);
if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, gmtime(&t))) {
- buffer_copy_string_len(b, CONST_STR_LEN("(none)"));
+ buffer_copy_string(b, "(none)");
} else {
buffer_copy_string(b, buf);
}
@@ -487,7 +444,7 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
}
case SSI_ECHO_DOCUMENT_NAME: {
char *sl;
-
+
b = chunkqueue_get_append_buffer(con->write_queue);
if (NULL == (sl = strrchr(con->physical.path->ptr, '/'))) {
buffer_copy_string_buffer(b, con->physical.path);
@@ -504,15 +461,15 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
default: {
data_string *ds;
/* check if it is a cgi-var */
-
+
b = chunkqueue_get_append_buffer(con->write_queue);
-
+
if (NULL != (ds = (data_string *)array_get_element(p->ssi_cgi_env, var_val))) {
buffer_copy_string_buffer(b, ds->value);
} else {
- buffer_copy_string_len(b, CONST_STR_LEN("(none)"));
+ buffer_copy_string(b, "(none)");
}
-
+
break;
}
}
@@ -524,7 +481,7 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
const char * file_path = NULL, *virt_path = NULL;
struct stat st;
char *sl;
-
+
for (i = 2; i < n; i += 2) {
if (0 == strcmp(l[i], "file")) {
file_path = l[i+1];
@@ -532,76 +489,78 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
virt_path = l[i+1];
} else {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: unknow attribute for ",
+ "ssi: unknow attribute for ",
l[1], l[i]);
}
}
-
+
if (!file_path && !virt_path) {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: ",
+ "ssi: ",
l[1], "file or virtual are missing");
break;
}
-
+
if (file_path && virt_path) {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: ",
+ "ssi: ",
l[1], "only one of file and virtual is allowed here");
break;
}
-
-
+
+
if (p->if_is_false) break;
-
+
if (file_path) {
/* current doc-root */
if (NULL == (sl = strrchr(con->physical.path->ptr, '/'))) {
- buffer_copy_string_len(p->stat_fn, CONST_STR_LEN("/"));
+ buffer_copy_string(p->stat_fn, "/");
} else {
buffer_copy_string_len(p->stat_fn, con->physical.path->ptr, sl - con->physical.path->ptr + 1);
}
-
- buffer_copy_string(srv->tmp_buf, file_path);
- buffer_urldecode_path(srv->tmp_buf);
- buffer_path_simplify(srv->tmp_buf, srv->tmp_buf);
- buffer_append_string_buffer(p->stat_fn, srv->tmp_buf);
+
+ /* fn */
+ if (NULL == (sl = strrchr(file_path, '/'))) {
+ buffer_append_string(p->stat_fn, file_path);
+ } else {
+ buffer_append_string(p->stat_fn, sl + 1);
+ }
} else {
/* virtual */
-
+
if (virt_path[0] == '/') {
buffer_copy_string(p->stat_fn, virt_path);
} else {
/* there is always a / */
sl = strrchr(con->uri.path->ptr, '/');
-
+
buffer_copy_string_len(p->stat_fn, con->uri.path->ptr, sl - con->uri.path->ptr + 1);
buffer_append_string(p->stat_fn, virt_path);
}
-
+
buffer_urldecode_path(p->stat_fn);
buffer_path_simplify(srv->tmp_buf, p->stat_fn);
-
+
/* we have an uri */
-
+
buffer_copy_string_buffer(p->stat_fn, con->physical.doc_root);
buffer_append_string_buffer(p->stat_fn, srv->tmp_buf);
}
-
+
if (0 == stat(p->stat_fn->ptr, &st)) {
time_t t = st.st_mtime;
-
+
switch (ssicmd) {
case SSI_FSIZE:
b = chunkqueue_get_append_buffer(con->write_queue);
if (p->sizefmt) {
int j = 0;
const char *abr[] = { " B", " kB", " MB", " GB", " TB", NULL };
-
+
off_t s = st.st_size;
-
+
for (j = 0; s > 1024 && abr[j+1]; s /= 1024, j++);
-
+
buffer_copy_off_t(b, s);
buffer_append_string(b, abr[j]);
} else {
@@ -611,23 +570,18 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
case SSI_FLASTMOD:
b = chunkqueue_get_append_buffer(con->write_queue);
if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, localtime(&t))) {
- buffer_copy_string_len(b, CONST_STR_LEN("(none)"));
+ buffer_copy_string(b, "(none)");
} else {
buffer_copy_string(b, buf);
}
break;
case SSI_INCLUDE:
chunkqueue_append_file(con->write_queue, p->stat_fn, 0, st.st_size);
-
- /* Keep the newest mtime of included files */
- if (st.st_mtime > include_file_last_mtime)
- include_file_last_mtime = st.st_mtime;
-
break;
}
} else {
log_error_write(srv, __FILE__, __LINE__, "sbs",
- "ssi: stating failed ",
+ "ssi: stating failed ",
p->stat_fn, strerror(errno));
}
break;
@@ -641,33 +595,33 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
val = l[i+1];
} else {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: unknow attribute for ",
+ "ssi: unknow attribute for ",
l[1], l[i]);
}
}
-
+
if (p->if_is_false) break;
-
+
if (key && val) {
data_string *ds;
-
+
if (NULL == (ds = (data_string *)array_get_unused_element(p->ssi_vars, TYPE_STRING))) {
ds = data_string_init();
}
buffer_copy_string(ds->key, key);
buffer_copy_string(ds->value, val);
-
+
array_insert_unique(p->ssi_vars, (data_unset *)ds);
} else {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: var and value have to be set in",
+ "ssi: var and value have to be set in",
l[0], l[1]);
}
break;
}
- case SSI_CONFIG:
+ case SSI_CONFIG:
if (p->if_is_false) break;
-
+
for (i = 2; i < n; i += 2) {
if (0 == strcmp(l[i], "timefmt")) {
buffer_copy_string(p->timefmt, l[i+1]);
@@ -680,68 +634,63 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
log_error_write(srv, __FILE__, __LINE__, "sssss",
"ssi: unknow value for attribute '",
l[i],
- "' for ",
+ "' for ",
l[1], l[i+1]);
}
} else {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: unknow attribute for ",
+ "ssi: unknow attribute for ",
l[1], l[i]);
}
}
break;
case SSI_PRINTENV:
if (p->if_is_false) break;
-
+
b = chunkqueue_get_append_buffer(con->write_queue);
+ buffer_copy_string(b, "<pre>");
for (i = 0; i < p->ssi_vars->used; i++) {
data_string *ds = (data_string *)p->ssi_vars->data[p->ssi_vars->sorted[i]];
-
+
buffer_append_string_buffer(b, ds->key);
- buffer_append_string_len(b, CONST_STR_LEN("="));
- buffer_append_string_encoded(b, CONST_BUF_LEN(ds->value), ENCODING_MINIMAL_XML);
- buffer_append_string_len(b, CONST_STR_LEN("\n"));
+ buffer_append_string(b, ": ");
+ buffer_append_string_buffer(b, ds->value);
+ buffer_append_string(b, "<br />");
+
}
- for (i = 0; i < p->ssi_cgi_env->used; i++) {
- data_string *ds = (data_string *)p->ssi_cgi_env->data[p->ssi_cgi_env->sorted[i]];
-
- buffer_append_string_buffer(b, ds->key);
- buffer_append_string_len(b, CONST_STR_LEN("="));
- buffer_append_string_encoded(b, CONST_BUF_LEN(ds->value), ENCODING_MINIMAL_XML);
- buffer_append_string_len(b, CONST_STR_LEN("\n"));
- }
-
+ buffer_append_string(b, "</pre>");
+
break;
case SSI_EXEC: {
const char *cmd = NULL;
pid_t pid;
int from_exec_fds[2];
-
+
for (i = 2; i < n; i += 2) {
if (0 == strcmp(l[i], "cmd")) {
cmd = l[i+1];
} else {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: unknow attribute for ",
+ "ssi: unknow attribute for ",
l[1], l[i]);
}
}
-
+
if (p->if_is_false) break;
-
+
/* create a return pipe and send output to the html-page
- *
- * as exec is assumed evil it is implemented synchronously
+ *
+ * as exec is assumed evil it is implemented synchronously
*/
-
+
if (!cmd) break;
-#ifdef HAVE_FORK
+#ifdef HAVE_FORK
if (pipe(from_exec_fds)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
"pipe failed: ", strerror(errno));
return -1;
}
-
+
/* fork, execve */
switch (pid = fork()) {
case 0: {
@@ -751,14 +700,14 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
close(from_exec_fds[1]);
/* not needed */
close(from_exec_fds[0]);
-
+
/* close stdin */
close(STDIN_FILENO);
-
- execl("/bin/sh", "sh", "-c", cmd, (char *)NULL);
-
+
+ execl("/bin/sh", "sh", "-c", cmd, NULL);
+
log_error_write(srv, __FILE__, __LINE__, "sss", "spawing exec failed:", strerror(errno), cmd);
-
+
/* */
SEGFAULT();
break;
@@ -771,59 +720,44 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
/* father */
int status;
ssize_t r;
- int was_interrupted = 0;
-
+
close(from_exec_fds[1]);
-
+
/* wait for the client to end */
-
- /*
- * OpenBSD and Solaris send a EINTR on SIGCHILD even if we ignore it
- */
- do {
- if (-1 == waitpid(pid, &status, 0)) {
- if (errno == EINTR) {
- was_interrupted++;
- } else {
- was_interrupted = 0;
- log_error_write(srv, __FILE__, __LINE__, "ss", "waitpid failed:", strerror(errno));
+ if (-1 == waitpid(pid, &status, 0)) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "waitpid failed:", strerror(errno));
+ } else if (WIFEXITED(status)) {
+ int toread;
+ /* read everything from client and paste it into the output */
+
+ while(1) {
+ if (ioctl(from_exec_fds[0], FIONREAD, &toread)) {
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "unexpected end-of-file (perhaps the ssi-exec process died)");
+ return -1;
}
- } else if (WIFEXITED(status)) {
- int toread;
- /* read everything from client and paste it into the output */
- was_interrupted = 0;
-
- while(1) {
- if (ioctl(from_exec_fds[0], FIONREAD, &toread)) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "unexpected end-of-file (perhaps the ssi-exec process died)");
- return -1;
- }
-
- if (toread > 0) {
- b = chunkqueue_get_append_buffer(con->write_queue);
-
- buffer_prepare_copy(b, toread + 1);
-
- if ((r = read(from_exec_fds[0], b->ptr, b->size - 1)) < 0) {
- /* read failed */
- break;
- } else {
- b->used = r;
- b->ptr[b->used++] = '\0';
- }
- } else {
+
+ if (toread > 0) {
+ b = chunkqueue_get_append_buffer(con->write_queue);
+
+ buffer_prepare_copy(b, toread + 1);
+
+ if ((r = read(from_exec_fds[0], b->ptr, b->size - 1)) < 0) {
+ /* read failed */
break;
+ } else {
+ b->used = r;
+ b->ptr[b->used++] = '\0';
}
+ } else {
+ break;
}
- } else {
- was_interrupted = 0;
- log_error_write(srv, __FILE__, __LINE__, "s", "process exited abnormally");
}
- } while (was_interrupted > 0 && was_interrupted < 4); /* if waitpid() gets interrupted, retry, but max 4 times */
-
+ } else {
+ log_error_write(srv, __FILE__, __LINE__, "s", "process exited abnormally");
+ }
close(from_exec_fds[0]);
-
+
break;
}
}
@@ -831,51 +765,51 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
return -1;
#endif
-
+
break;
}
case SSI_IF: {
const char *expr = NULL;
-
+
for (i = 2; i < n; i += 2) {
if (0 == strcmp(l[i], "expr")) {
expr = l[i+1];
} else {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: unknow attribute for ",
+ "ssi: unknow attribute for ",
l[1], l[i]);
}
}
-
+
if (!expr) {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: ",
+ "ssi: ",
l[1], "expr missing");
break;
}
-
+
if ((!p->if_is_false) &&
- ((p->if_is_false_level == 0) ||
+ ((p->if_is_false_level == 0) ||
(p->if_level < p->if_is_false_level))) {
switch (ssi_eval_expr(srv, con, p, expr)) {
case -1:
- case 0:
- p->if_is_false = 1;
+ case 0:
+ p->if_is_false = 1;
p->if_is_false_level = p->if_level;
break;
- case 1:
- p->if_is_false = 0;
+ case 1:
+ p->if_is_false = 0;
break;
}
}
-
+
p->if_level++;
-
+
break;
}
case SSI_ELSE:
p->if_level--;
-
+
if (p->if_is_false) {
if ((p->if_level == p->if_is_false_level) &&
(p->if_is_false_endif == 0)) {
@@ -883,11 +817,11 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
}
} else {
p->if_is_false = 1;
-
+
p->if_is_false_level = p->if_level;
}
p->if_level++;
-
+
break;
case SSI_ELIF: {
const char *expr = NULL;
@@ -896,52 +830,52 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
expr = l[i+1];
} else {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: unknow attribute for ",
+ "ssi: unknow attribute for ",
l[1], l[i]);
}
}
-
+
if (!expr) {
log_error_write(srv, __FILE__, __LINE__, "sss",
- "ssi: ",
+ "ssi: ",
l[1], "expr missing");
break;
}
-
+
p->if_level--;
-
+
if (p->if_level == p->if_is_false_level) {
if ((p->if_is_false) &&
(p->if_is_false_endif == 0)) {
switch (ssi_eval_expr(srv, con, p, expr)) {
case -1:
- case 0:
- p->if_is_false = 1;
+ case 0:
+ p->if_is_false = 1;
p->if_is_false_level = p->if_level;
break;
- case 1:
- p->if_is_false = 0;
+ case 1:
+ p->if_is_false = 0;
break;
}
} else {
- p->if_is_false = 1;
+ p->if_is_false = 1;
p->if_is_false_level = p->if_level;
p->if_is_false_endif = 1;
}
}
-
+
p->if_level++;
-
+
break;
}
case SSI_ENDIF:
p->if_level--;
-
+
if (p->if_level == p->if_is_false_level) {
p->if_is_false = 0;
p->if_is_false_endif = 0;
}
-
+
break;
default:
log_error_write(srv, __FILE__, __LINE__, "ss",
@@ -949,44 +883,41 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
l[1]);
break;
}
-
+
return 0;
-
+
}
static int mod_ssi_handle_request(server *srv, connection *con, plugin_data *p) {
stream s;
#ifdef HAVE_PCRE_H
int i, n;
-
+
#define N 10
int ovec[N * 3];
#endif
-
+
/* get a stream to the file */
-
+
array_reset(p->ssi_vars);
array_reset(p->ssi_cgi_env);
- buffer_copy_string_len(p->timefmt, CONST_STR_LEN("%a, %d %b %Y %H:%M:%S %Z"));
+ buffer_copy_string(p->timefmt, "%a, %d %b %Y %H:%M:%S %Z");
p->sizefmt = 0;
build_ssi_cgi_vars(srv, con, p);
p->if_is_false = 0;
-
- /* Reset the modified time of included files */
- include_file_last_mtime = 0;
-
+
if (-1 == stream_open(&s, con->physical.path)) {
log_error_write(srv, __FILE__, __LINE__, "sb",
"stream-open: ", con->physical.path);
return -1;
}
-
-
+
+
/**
- * <!--#element attribute=value attribute=value ... -->
- *
+ * <!--#element attribute=value attribute=value ... -->
+ *
* config DONE
- * errmsg -- missing
+ * errmsg -- missing
* sizefmt DONE
* timefmt DONE
* echo DONE
@@ -1008,13 +939,13 @@ static int mod_ssi_handle_request(server *srv, connection *con, plugin_data *p)
* set DONE
* var DONE
* value DONE
- *
+ *
* if DONE
* elif DONE
* else DONE
* endif DONE
- *
- *
+ *
+ *
* expressions
* AND, OR DONE
* comp DONE
@@ -1022,89 +953,60 @@ static int mod_ssi_handle_request(server *srv, connection *con, plugin_data *p)
* $... DONE
* '...' DONE
* ( ... ) DONE
- *
- *
- *
+ *
+ *
+ *
* ** all DONE **
- * DATE_GMT
- * The current date in Greenwich Mean Time.
- * DATE_LOCAL
- * The current date in the local time zone.
- * DOCUMENT_NAME
- * The filename (excluding directories) of the document requested by the user.
- * DOCUMENT_URI
- * The (%-decoded) URL path of the document requested by the user. Note that in the case of nested include files, this is not then URL for the current document.
- * LAST_MODIFIED
- * The last modification date of the document requested by the user.
- * USER_NAME
+ * DATE_GMT
+ * The current date in Greenwich Mean Time.
+ * DATE_LOCAL
+ * The current date in the local time zone.
+ * DOCUMENT_NAME
+ * The filename (excluding directories) of the document requested by the user.
+ * DOCUMENT_URI
+ * The (%-decoded) URL path of the document requested by the user. Note that in the case of nested include files, this is not then URL for the current document.
+ * LAST_MODIFIED
+ * The last modification date of the document requested by the user.
+ * USER_NAME
* Contains the owner of the file which included it.
- *
+ *
*/
-#ifdef HAVE_PCRE_H
+#ifdef HAVE_PCRE_H
for (i = 0; (n = pcre_exec(p->ssi_regex, NULL, s.start, s.size, i, 0, ovec, N * 3)) > 0; i = ovec[1]) {
const char **l;
- /* take everything from last offset to current match pos */
-
+ /* take every think from last offset to current match pos */
+
if (!p->if_is_false) chunkqueue_append_file(con->write_queue, con->physical.path, i, ovec[0] - i);
-
+
pcre_get_substring_list(s.start, ovec, n, &l);
process_ssi_stmt(srv, con, p, l, n);
pcre_free_substring_list(l);
}
-
+
switch(n) {
case PCRE_ERROR_NOMATCH:
/* copy everything/the rest */
chunkqueue_append_file(con->write_queue, con->physical.path, i, s.size - i);
-
+
break;
default:
log_error_write(srv, __FILE__, __LINE__, "sd",
"execution error while matching: ", n);
break;
}
-#endif
-
-
+#endif
+
+
stream_close(&s);
-
+
con->file_started = 1;
con->file_finished = 1;
- con->mode = p->id;
-
- if (p->conf.content_type->used <= 1) {
- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
- } else {
- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(p->conf.content_type));
- }
-
- {
- /* Generate "ETag" & "Last-Modified" headers */
-
- stat_cache_entry *sce = NULL;
- time_t lm_time = 0;
- buffer *mtime = NULL;
-
- stat_cache_get_entry(srv, con, con->physical.path, &sce);
-
- etag_mutate(con->physical.etag, sce->etag);
- response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
-
- if (sce->st.st_mtime > include_file_last_mtime)
- lm_time = sce->st.st_mtime;
- else
- lm_time = include_file_last_mtime;
-
- mtime = strftime_cache_get(srv, lm_time);
- response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
- }
-
- /* Reset the modified time of included files */
- include_file_last_mtime = 0;
-
+
+ response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
+
/* reset physical.path */
buffer_reset(con->physical.path);
-
+
return 0;
}
@@ -1113,30 +1015,27 @@ static int mod_ssi_handle_request(server *srv, connection *con, plugin_data *p)
static int mod_ssi_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(ssi_extension);
- PATCH(content_type);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssi.extension"))) {
PATCH(ssi_extension);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssi.content-type"))) {
- PATCH(content_type);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -1144,48 +1043,44 @@ static int mod_ssi_patch_connection(server *srv, connection *con, plugin_data *p
URIHANDLER_FUNC(mod_ssi_physical_path) {
plugin_data *p = p_d;
size_t k;
-
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
+
if (con->physical.path->used == 0) return HANDLER_GO_ON;
-
+
mod_ssi_patch_connection(srv, con, p);
-
+
for (k = 0; k < p->conf.ssi_extension->used; k++) {
data_string *ds = (data_string *)p->conf.ssi_extension->data[k];
-
+
if (ds->value->used == 0) continue;
-
+
if (buffer_is_equal_right_len(con->physical.path, ds->value, ds->value->used - 1)) {
/* handle ssi-request */
-
+
if (mod_ssi_handle_request(srv, con, p)) {
/* on error */
con->http_status = 500;
- con->mode = DIRECT;
}
-
+
return HANDLER_FINISHED;
}
}
-
+
/* not found */
return HANDLER_GO_ON;
}
/* this function is called at dlopen() time and inits the callbacks */
-int mod_ssi_plugin_init(plugin *p);
int mod_ssi_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("ssi");
-
+
p->init = mod_ssi_init;
p->handle_subrequest_start = mod_ssi_physical_path;
p->set_defaults = mod_ssi_set_defaults;
p->cleanup = mod_ssi_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_ssi.h b/src/mod_ssi.h
index 241e832..80f03ed 100644
--- a/src/mod_ssi.h
+++ b/src/mod_ssi.h
@@ -15,28 +15,27 @@
typedef struct {
array *ssi_extension;
- buffer *content_type;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
-#ifdef HAVE_PCRE_H
+
+#ifdef HAVE_PCRE_H
pcre *ssi_regex;
-#endif
+#endif
buffer *timefmt;
int sizefmt;
-
+
buffer *stat_fn;
-
+
array *ssi_vars;
array *ssi_cgi_env;
-
+
int if_level, if_is_false_level, if_is_false, if_is_false_endif;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
int ssi_eval_expr(server *srv, connection *con, plugin_data *p, const char *expr);
diff --git a/src/mod_ssi_expr.c b/src/mod_ssi_expr.c
index c5d8581..98959ab 100644
--- a/src/mod_ssi_expr.c
+++ b/src/mod_ssi_expr.c
@@ -1,19 +1,19 @@
+#include <ctype.h>
+#include <string.h>
+
#include "buffer.h"
#include "log.h"
#include "mod_ssi.h"
#include "mod_ssi_expr.h"
#include "mod_ssi_exprparser.h"
-#include <ctype.h>
-#include <string.h>
-
typedef struct {
const char *input;
size_t offset;
size_t size;
-
+
int line_pos;
-
+
int in_key;
int in_brace;
int in_cond;
@@ -21,15 +21,15 @@ typedef struct {
ssi_val_t *ssi_val_init() {
ssi_val_t *s;
-
+
s = calloc(1, sizeof(*s));
-
+
return s;
}
void ssi_val_free(ssi_val_t *s) {
if (s->str) buffer_free(s->str);
-
+
free(s);
}
@@ -45,192 +45,192 @@ static int ssi_expr_tokenizer(server *srv, connection *con, plugin_data *p,
ssi_tokenizer_t *t, int *token_id, buffer *token) {
int tid = 0;
size_t i;
-
+
UNUSED(con);
for (tid = 0; tid == 0 && t->offset < t->size && t->input[t->offset] ; ) {
char c = t->input[t->offset];
data_string *ds;
-
+
switch (c) {
- case '=':
+ case '=':
tid = TK_EQ;
-
+
t->offset++;
t->line_pos++;
-
- buffer_copy_string_len(token, CONST_STR_LEN("(=)"));
-
+
+ buffer_copy_string(token, "(=)");
+
break;
case '>':
if (t->input[t->offset + 1] == '=') {
t->offset += 2;
t->line_pos += 2;
-
+
tid = TK_GE;
-
- buffer_copy_string_len(token, CONST_STR_LEN("(>=)"));
+
+ buffer_copy_string(token, "(>=)");
} else {
t->offset += 1;
t->line_pos += 1;
-
+
tid = TK_GT;
-
- buffer_copy_string_len(token, CONST_STR_LEN("(>)"));
+
+ buffer_copy_string(token, "(>)");
}
-
+
break;
case '<':
if (t->input[t->offset + 1] == '=') {
t->offset += 2;
t->line_pos += 2;
-
+
tid = TK_LE;
-
- buffer_copy_string_len(token, CONST_STR_LEN("(<=)"));
+
+ buffer_copy_string(token, "(<=)");
} else {
t->offset += 1;
t->line_pos += 1;
-
+
tid = TK_LT;
-
- buffer_copy_string_len(token, CONST_STR_LEN("(<)"));
+
+ buffer_copy_string(token, "(<)");
}
-
+
break;
-
+
case '!':
if (t->input[t->offset + 1] == '=') {
t->offset += 2;
t->line_pos += 2;
-
+
tid = TK_NE;
-
- buffer_copy_string_len(token, CONST_STR_LEN("(!=)"));
+
+ buffer_copy_string(token, "(!=)");
} else {
t->offset += 1;
t->line_pos += 1;
-
+
tid = TK_NOT;
-
- buffer_copy_string_len(token, CONST_STR_LEN("(!)"));
+
+ buffer_copy_string(token, "(!)");
}
-
+
break;
case '&':
if (t->input[t->offset + 1] == '&') {
t->offset += 2;
t->line_pos += 2;
-
+
tid = TK_AND;
-
- buffer_copy_string_len(token, CONST_STR_LEN("(&&)"));
+
+ buffer_copy_string(token, "(&&)");
} else {
- log_error_write(srv, __FILE__, __LINE__, "sds",
- "pos:", t->line_pos,
+ log_error_write(srv, __FILE__, __LINE__, "sds",
+ "pos:", t->line_pos,
"missing second &");
return -1;
}
-
+
break;
case '|':
if (t->input[t->offset + 1] == '|') {
t->offset += 2;
t->line_pos += 2;
-
+
tid = TK_OR;
-
- buffer_copy_string_len(token, CONST_STR_LEN("(||)"));
+
+ buffer_copy_string(token, "(||)");
} else {
- log_error_write(srv, __FILE__, __LINE__, "sds",
- "pos:", t->line_pos,
+ log_error_write(srv, __FILE__, __LINE__, "sds",
+ "pos:", t->line_pos,
"missing second |");
return -1;
}
-
+
break;
case '\t':
case ' ':
t->offset++;
t->line_pos++;
break;
-
+
case '\'':
/* search for the terminating " */
for (i = 1; t->input[t->offset + i] && t->input[t->offset + i] != '\''; i++);
-
+
if (t->input[t->offset + i]) {
tid = TK_VALUE;
-
+
buffer_copy_string_len(token, t->input + t->offset + 1, i-1);
-
+
t->offset += i + 1;
t->line_pos += i + 1;
} else {
/* ERROR */
-
- log_error_write(srv, __FILE__, __LINE__, "sds",
- "pos:", t->line_pos,
+
+ log_error_write(srv, __FILE__, __LINE__, "sds",
+ "pos:", t->line_pos,
"missing closing quote");
-
+
return -1;
}
-
+
break;
case '(':
t->offset++;
t->in_brace++;
-
+
tid = TK_LPARAN;
-
- buffer_copy_string_len(token, CONST_STR_LEN("("));
+
+ buffer_copy_string(token, "(");
break;
case ')':
t->offset++;
t->in_brace--;
-
+
tid = TK_RPARAN;
-
- buffer_copy_string_len(token, CONST_STR_LEN(")"));
+
+ buffer_copy_string(token, ")");
break;
case '$':
if (t->input[t->offset + 1] == '{') {
for (i = 2; t->input[t->offset + i] && t->input[t->offset + i] != '}'; i++);
-
+
if (t->input[t->offset + i] != '}') {
- log_error_write(srv, __FILE__, __LINE__, "sds",
- "pos:", t->line_pos,
+ log_error_write(srv, __FILE__, __LINE__, "sds",
+ "pos:", t->line_pos,
"missing closing quote");
-
+
return -1;
}
-
+
buffer_copy_string_len(token, t->input + t->offset + 2, i-3);
} else {
for (i = 1; isalpha(t->input[t->offset + i]) || t->input[t->offset + i] == '_'; i++);
-
+
buffer_copy_string_len(token, t->input + t->offset + 1, i-1);
}
-
+
tid = TK_VALUE;
-
+
if (NULL != (ds = (data_string *)array_get_element(p->ssi_cgi_env, token->ptr))) {
buffer_copy_string_buffer(token, ds->value);
} else if (NULL != (ds = (data_string *)array_get_element(p->ssi_vars, token->ptr))) {
buffer_copy_string_buffer(token, ds->value);
} else {
- buffer_copy_string_len(token, CONST_STR_LEN(""));
+ buffer_copy_string(token, "");
}
-
+
t->offset += i;
t->line_pos += i;
-
+
break;
default:
for (i = 0; isgraph(t->input[t->offset + i]); i++) {
char d = t->input[t->offset + i];
switch(d) {
- case ' ':
+ case ' ':
case '\t':
case ')':
case '(':
@@ -244,25 +244,25 @@ static int ssi_expr_tokenizer(server *srv, connection *con, plugin_data *p,
break;
}
}
-
+
tid = TK_VALUE;
-
+
buffer_copy_string_len(token, t->input + t->offset, i);
-
+
t->offset += i;
t->line_pos += i;
-
+
break;
}
}
-
+
if (tid) {
*token_id = tid;
-
+
return 1;
} else if (t->offset < t->size) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
- "pos:", t->line_pos,
+ log_error_write(srv, __FILE__, __LINE__, "sds",
+ "pos:", t->line_pos,
"foobar");
}
return 0;
@@ -275,50 +275,50 @@ int ssi_eval_expr(server *srv, connection *con, plugin_data *p, const char *expr
buffer *token;
ssi_ctx_t context;
int ret;
-
+
t.input = expr;
t.offset = 0;
t.size = strlen(expr);
t.line_pos = 1;
-
+
t.in_key = 1;
t.in_brace = 0;
t.in_cond = 0;
-
+
context.ok = 1;
context.srv = srv;
-
+
/* default context */
-
+
pParser = ssiexprparserAlloc( malloc );
token = buffer_init();
while((1 == (ret = ssi_expr_tokenizer(srv, con, p, &t, &token_id, token))) && context.ok) {
ssiexprparser(pParser, token_id, token, &context);
-
+
token = buffer_init();
}
ssiexprparser(pParser, 0, token, &context);
ssiexprparserFree(pParser, free );
-
+
buffer_free(token);
-
+
if (ret == -1) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"expr parser failed");
return -1;
}
-
+
if (context.ok == 0) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
- "pos:", t.line_pos,
+ log_error_write(srv, __FILE__, __LINE__, "sds",
+ "pos:", t.line_pos,
"parser failed somehow near here");
return -1;
}
#if 0
- log_error_write(srv, __FILE__, __LINE__, "ssd",
+ log_error_write(srv, __FILE__, __LINE__, "ssd",
"expr: ",
expr,
context.val.bo);
-#endif
+#endif
return context.val.bo;
}
diff --git a/src/mod_ssi_expr.h b/src/mod_ssi_expr.h
index 2d3ae8b..b484f78 100644
--- a/src/mod_ssi_expr.h
+++ b/src/mod_ssi_expr.h
@@ -5,16 +5,16 @@
typedef struct {
enum { SSI_TYPE_UNSET, SSI_TYPE_BOOL, SSI_TYPE_STRING } type;
-
+
buffer *str;
int bo;
} ssi_val_t;
typedef struct {
int ok;
-
+
ssi_val_t val;
-
+
void *srv;
} ssi_ctx_t;
diff --git a/src/mod_ssi_exprparser.c b/src/mod_ssi_exprparser.c
index 6a0373d..65ec4dc 100644
--- a/src/mod_ssi_exprparser.c
+++ b/src/mod_ssi_exprparser.c
@@ -4,22 +4,24 @@
/* First off, code is include which follows the "include" declaration
** in the input file. */
#include <stdio.h>
-#line 6 "../../src/mod_ssi_exprparser.y"
-
-#include "mod_ssi_expr.h"
-#include "buffer.h"
+#line 6 "./mod_ssi_exprparser.y"
#include <assert.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "mod_ssi_expr.h"
+#include "buffer.h"
-#line 16 "mod_ssi_exprparser.c"
+#line 18 "mod_ssi_exprparser.c"
/* Next is all token values, in a form suitable for use by makeheaders.
** This section will be null unless lemon is run with the -m switch.
*/
-/*
+/*
** These constants (all generated automatically by the parser generator)
** specify the various kinds of tokens (terminals) that the parser
-** understands.
+** understands.
**
** Each symbol here is a terminal symbol in the grammar.
*/
@@ -36,7 +38,7 @@
** and nonterminals. "int" is used otherwise.
** YYNOCODE is a number of type YYCODETYPE which corresponds
** to no legal terminal or nonterminal number. This
-** number is used to fill in empty slots of the hash
+** number is used to fill in empty slots of the hash
** table.
** YYFALLBACK If defined, this indicates that one or more tokens
** have fall-back values which should be used if the
@@ -45,7 +47,7 @@
** and nonterminal numbers. "unsigned char" is
** used if there are fewer than 250 rules and
** states combined. "int" is used otherwise.
-** ssiexprparserTOKENTYPE is the data type used for minor tokens given
+** ssiexprparserTOKENTYPE is the data type used for minor tokens given
** directly to the parser from the tokenizer.
** YYMINORTYPE is the data type used for all minor tokens.
** This is typically a union of many types, one of
@@ -89,7 +91,7 @@ typedef union {
/* Next are that tables used to determine what action to take based on the
** current state and lookahead token. These tables are used to implement
** functions that take a state number and lookahead value and return an
-** action integer.
+** action integer.
**
** Suppose the action integer is N. Then the action is determined as
** follows
@@ -114,7 +116,7 @@ typedef union {
** If the index value yy_shift_ofst[S]+X is out of range or if the value
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
-** and that yy_default[S] should be used instead.
+** and that yy_default[S] should be used instead.
**
** The formula above is for computing the action when the lookahead is
** a terminal symbol. If the lookahead is a non-terminal (as occurs after
@@ -166,7 +168,7 @@ static YYACTIONTYPE yy_default[] = {
/* The next table maps tokens into fallback tokens. If a construct
** like the following:
-**
+**
** %fallback ID X Y Z.
**
** appears in the grammer, then ID becomes a fallback token for X, Y,
@@ -217,10 +219,10 @@ static char *yyTracePrompt = 0;
#endif /* NDEBUG */
#ifndef NDEBUG
-/*
+/*
** Turn parser tracing on by giving a stream to which to write the trace
** and a prompt to preface each trace message. Tracing is turned off
-** by making either argument NULL
+** by making either argument NULL
**
** Inputs:
** <ul>
@@ -234,20 +236,18 @@ static char *yyTracePrompt = 0;
** Outputs:
** None.
*/
-#if 0
void ssiexprparserTrace(FILE *TraceFILE, char *zTracePrompt){
yyTraceFILE = TraceFILE;
yyTracePrompt = zTracePrompt;
if( yyTraceFILE==0 ) yyTracePrompt = 0;
else if( yyTracePrompt==0 ) yyTraceFILE = 0;
}
-#endif
#endif /* NDEBUG */
#ifndef NDEBUG
/* For tracing shifts, the names of all terminals and nonterminals
** are required. The following table supplies these names */
-static const char *yyTokenName[] = {
+static const char *yyTokenName[] = {
"$", "AND", "OR", "EQ",
"NE", "GT", "GE", "LT",
"LE", "NOT", "LPARAN", "RPARAN",
@@ -283,10 +283,9 @@ static const char *yyRuleName[] = {
** This function returns the symbolic name associated with a token
** value.
*/
-#if 0
const char *ssiexprparserTokenName(int tokenType){
#ifndef NDEBUG
- if( tokenType>0 && (size_t)tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){
+ if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){
return yyTokenName[tokenType];
}else{
return "Unknown";
@@ -295,9 +294,8 @@ const char *ssiexprparserTokenName(int tokenType){
return "";
#endif
}
-#endif
-/*
+/*
** This function allocates a new parser.
** The only argument is a pointer to a function which works like
** malloc.
@@ -328,7 +326,7 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
/* Here is inserted the actions which take place when a
** terminal or non-terminal is destroyed. This can happen
** when the symbol is popped from the stack during a
- ** reduce or during error processing or when a parser is
+ ** reduce or during error processing or when a parser is
** being destroyed before it is finished parsing.
**
** Note: during a reduce, the only symbols destroyed are those
@@ -347,9 +345,9 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
case 10:
case 11:
case 12:
-#line 22 "../../src/mod_ssi_exprparser.y"
+#line 24 "./mod_ssi_exprparser.y"
{ buffer_free((yypminor->yy0)); }
-#line 352 "mod_ssi_exprparser.c"
+#line 350 "mod_ssi_exprparser.c"
break;
default: break; /* If no destructor action specified: do nothing */
}
@@ -381,7 +379,7 @@ static int yy_pop_parser_stack(yyParser *pParser){
return yymajor;
}
-/*
+/*
** Deallocate and destroy a parser. Destructors are all called for
** all stack elements before shutting the parser down.
**
@@ -417,7 +415,7 @@ static int yy_find_shift_action(
){
int i;
int stateno = pParser->yystack[pParser->yyidx].stateno;
-
+
/* if( pParser->yyidx<0 ) return YY_NO_ACTION; */
i = yy_shift_ofst[stateno];
if( i==YY_SHIFT_USE_DFLT ){
@@ -427,7 +425,7 @@ static int yy_find_shift_action(
return YY_NO_ACTION;
}
i += iLookAhead;
- if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
+ if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK
int iFallback; /* Fallback token */
if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
@@ -461,7 +459,7 @@ static int yy_find_reduce_action(
){
int i;
int stateno = pParser->yystack[pParser->yyidx].stateno;
-
+
i = yy_reduce_ofst[stateno];
if( i==YY_REDUCE_USE_DFLT ){
return yy_default[stateno];
@@ -470,7 +468,7 @@ static int yy_find_reduce_action(
return YY_NO_ACTION;
}
i += iLookAhead;
- if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
+ if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
return yy_default[stateno];
}else{
return yy_action[i];
@@ -561,8 +559,8 @@ static void yy_reduce(
ssiexprparserARG_FETCH;
yymsp = &yypParser->yystack[yypParser->yyidx];
#ifndef NDEBUG
- if( yyTraceFILE && yyruleno>=0
- && (size_t)yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
+ if( yyTraceFILE && yyruleno>=0
+ && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
yyRuleName[yyruleno]);
}
@@ -578,29 +576,29 @@ static void yy_reduce(
** break;
*/
case 0:
-#line 29 "../../src/mod_ssi_exprparser.y"
+#line 31 "./mod_ssi_exprparser.y"
{
ctx->val.bo = ssi_val_tobool(yymsp[0].minor.yy29);
ctx->val.type = SSI_TYPE_BOOL;
-
+
ssi_val_free(yymsp[0].minor.yy29);
}
-#line 588 "mod_ssi_exprparser.c"
+#line 586 "mod_ssi_exprparser.c"
break;
case 1:
-#line 36 "../../src/mod_ssi_exprparser.y"
+#line 38 "./mod_ssi_exprparser.y"
{
int cmp;
-
- if (yymsp[-2].minor.yy29->type == SSI_TYPE_STRING &&
+
+ if (yymsp[-2].minor.yy29->type == SSI_TYPE_STRING &&
yymsp[0].minor.yy29->type == SSI_TYPE_STRING) {
cmp = strcmp(yymsp[-2].minor.yy29->str->ptr, yymsp[0].minor.yy29->str->ptr);
} else {
cmp = ssi_val_tobool(yymsp[-2].minor.yy29) - ssi_val_tobool(yymsp[0].minor.yy29);
}
-
+
yygotominor.yy29 = yymsp[-2].minor.yy29;
-
+
switch(yymsp[-1].minor.yy8) {
case SSI_COND_EQ: yygotominor.yy29->bo = (cmp == 0) ? 1 : 0; break;
case SSI_COND_NE: yygotominor.yy29->bo = (cmp != 0) ? 1 : 0; break;
@@ -609,132 +607,131 @@ static void yy_reduce(
case SSI_COND_LE: yygotominor.yy29->bo = (cmp <= 0) ? 1 : 0; break;
case SSI_COND_LT: yygotominor.yy29->bo = (cmp < 0) ? 1 : 0; break;
}
-
+
yygotominor.yy29->type = SSI_TYPE_BOOL;
-
+
ssi_val_free(yymsp[0].minor.yy29);
}
-#line 617 "mod_ssi_exprparser.c"
+#line 615 "mod_ssi_exprparser.c"
break;
case 2:
-#line 61 "../../src/mod_ssi_exprparser.y"
+#line 63 "./mod_ssi_exprparser.y"
{
yygotominor.yy29 = yymsp[0].minor.yy29;
}
-#line 624 "mod_ssi_exprparser.c"
+#line 622 "mod_ssi_exprparser.c"
break;
case 3:
-#line 64 "../../src/mod_ssi_exprparser.y"
+#line 66 "./mod_ssi_exprparser.y"
{
int e;
-
+
e = ssi_val_tobool(yymsp[-2].minor.yy29) && ssi_val_tobool(yymsp[0].minor.yy29);
-
+
yygotominor.yy29 = yymsp[-2].minor.yy29;
yygotominor.yy29->bo = e;
yygotominor.yy29->type = SSI_TYPE_BOOL;
ssi_val_free(yymsp[0].minor.yy29);
}
-#line 638 "mod_ssi_exprparser.c"
+#line 636 "mod_ssi_exprparser.c"
yy_destructor(1,&yymsp[-1].minor);
break;
case 4:
-#line 75 "../../src/mod_ssi_exprparser.y"
+#line 77 "./mod_ssi_exprparser.y"
{
int e;
-
+
e = ssi_val_tobool(yymsp[-2].minor.yy29) || ssi_val_tobool(yymsp[0].minor.yy29);
-
+
yygotominor.yy29 = yymsp[-2].minor.yy29;
yygotominor.yy29->bo = e;
yygotominor.yy29->type = SSI_TYPE_BOOL;
ssi_val_free(yymsp[0].minor.yy29);
}
-#line 653 "mod_ssi_exprparser.c"
+#line 651 "mod_ssi_exprparser.c"
yy_destructor(2,&yymsp[-1].minor);
break;
case 5:
-#line 86 "../../src/mod_ssi_exprparser.y"
+#line 88 "./mod_ssi_exprparser.y"
{
int e;
-
+
e = !ssi_val_tobool(yymsp[0].minor.yy29);
-
+
yygotominor.yy29 = yymsp[0].minor.yy29;
yygotominor.yy29->bo = e;
yygotominor.yy29->type = SSI_TYPE_BOOL;
}
-#line 667 "mod_ssi_exprparser.c"
+#line 665 "mod_ssi_exprparser.c"
yy_destructor(9,&yymsp[-1].minor);
break;
case 6:
-#line 95 "../../src/mod_ssi_exprparser.y"
+#line 97 "./mod_ssi_exprparser.y"
{
yygotominor.yy29 = yymsp[-1].minor.yy29;
}
-#line 675 "mod_ssi_exprparser.c"
+#line 673 "mod_ssi_exprparser.c"
yy_destructor(10,&yymsp[-2].minor);
yy_destructor(11,&yymsp[0].minor);
break;
case 7:
-#line 99 "../../src/mod_ssi_exprparser.y"
+#line 101 "./mod_ssi_exprparser.y"
{
yygotominor.yy29 = ssi_val_init();
yygotominor.yy29->str = yymsp[0].minor.yy19;
yygotominor.yy29->type = SSI_TYPE_STRING;
}
-#line 686 "mod_ssi_exprparser.c"
+#line 684 "mod_ssi_exprparser.c"
break;
case 8:
-#line 105 "../../src/mod_ssi_exprparser.y"
+#line 107 "./mod_ssi_exprparser.y"
{
- yygotominor.yy19 = yymsp[0].minor.yy0;
+ yygotominor.yy19 = buffer_init_string(yymsp[0].minor.yy0->ptr);
}
-#line 693 "mod_ssi_exprparser.c"
+#line 691 "mod_ssi_exprparser.c"
break;
case 9:
-#line 109 "../../src/mod_ssi_exprparser.y"
+#line 111 "./mod_ssi_exprparser.y"
{
yygotominor.yy19 = yymsp[-1].minor.yy19;
buffer_append_string_buffer(yygotominor.yy19, yymsp[0].minor.yy0);
- buffer_free(yymsp[0].minor.yy0);
}
-#line 702 "mod_ssi_exprparser.c"
+#line 699 "mod_ssi_exprparser.c"
break;
case 10:
-#line 115 "../../src/mod_ssi_exprparser.y"
+#line 116 "./mod_ssi_exprparser.y"
{ yygotominor.yy8 = SSI_COND_EQ; }
-#line 707 "mod_ssi_exprparser.c"
+#line 704 "mod_ssi_exprparser.c"
yy_destructor(3,&yymsp[0].minor);
break;
case 11:
-#line 116 "../../src/mod_ssi_exprparser.y"
+#line 117 "./mod_ssi_exprparser.y"
{ yygotominor.yy8 = SSI_COND_NE; }
-#line 713 "mod_ssi_exprparser.c"
+#line 710 "mod_ssi_exprparser.c"
yy_destructor(4,&yymsp[0].minor);
break;
case 12:
-#line 117 "../../src/mod_ssi_exprparser.y"
+#line 118 "./mod_ssi_exprparser.y"
{ yygotominor.yy8 = SSI_COND_LE; }
-#line 719 "mod_ssi_exprparser.c"
+#line 716 "mod_ssi_exprparser.c"
yy_destructor(8,&yymsp[0].minor);
break;
case 13:
-#line 118 "../../src/mod_ssi_exprparser.y"
+#line 119 "./mod_ssi_exprparser.y"
{ yygotominor.yy8 = SSI_COND_GE; }
-#line 725 "mod_ssi_exprparser.c"
+#line 722 "mod_ssi_exprparser.c"
yy_destructor(6,&yymsp[0].minor);
break;
case 14:
-#line 119 "../../src/mod_ssi_exprparser.y"
+#line 120 "./mod_ssi_exprparser.y"
{ yygotominor.yy8 = SSI_COND_LT; }
-#line 731 "mod_ssi_exprparser.c"
+#line 728 "mod_ssi_exprparser.c"
yy_destructor(7,&yymsp[0].minor);
break;
case 15:
-#line 120 "../../src/mod_ssi_exprparser.y"
+#line 121 "./mod_ssi_exprparser.y"
{ yygotominor.yy8 = SSI_COND_GT; }
-#line 737 "mod_ssi_exprparser.c"
+#line 734 "mod_ssi_exprparser.c"
yy_destructor(5,&yymsp[0].minor);
break;
};
@@ -764,11 +761,11 @@ static void yy_parse_failed(
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will be executed whenever the
** parser fails */
-#line 14 "../../src/mod_ssi_exprparser.y"
+#line 16 "./mod_ssi_exprparser.y"
ctx->ok = 0;
-#line 771 "mod_ssi_exprparser.c"
+#line 768 "mod_ssi_exprparser.c"
ssiexprparserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
@@ -781,8 +778,6 @@ static void yy_syntax_error(
YYMINORTYPE yyminor /* The minor type of the error token */
){
ssiexprparserARG_FETCH;
- UNUSED(yymajor);
- UNUSED(yyminor);
#define TOKEN (yyminor.yy0)
ssiexprparserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
@@ -877,7 +872,7 @@ void ssiexprparser(
#ifdef YYERRORSYMBOL
/* A syntax error has occurred.
** The response to an error depends upon whether or not the
- ** grammar defines an error token "ERROR".
+ ** grammar defines an error token "ERROR".
**
** This is what we do if the grammar does define ERROR:
**
diff --git a/src/mod_ssi_exprparser.y b/src/mod_ssi_exprparser.y
index f4aaa96..c123941 100644
--- a/src/mod_ssi_exprparser.y
+++ b/src/mod_ssi_exprparser.y
@@ -4,11 +4,13 @@
%name ssiexprparser
%include {
-#include "mod_ssi_expr.h"
-#include "buffer.h"
-
#include <assert.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "mod_ssi_expr.h"
+#include "buffer.h"
}
%parse_failure {
@@ -29,22 +31,22 @@
input ::= exprline(B). {
ctx->val.bo = ssi_val_tobool(B);
ctx->val.type = SSI_TYPE_BOOL;
-
+
ssi_val_free(B);
}
exprline(A) ::= expr(B) cond(C) expr(D). {
int cmp;
-
- if (B->type == SSI_TYPE_STRING &&
+
+ if (B->type == SSI_TYPE_STRING &&
D->type == SSI_TYPE_STRING) {
cmp = strcmp(B->str->ptr, D->str->ptr);
} else {
cmp = ssi_val_tobool(B) - ssi_val_tobool(D);
}
-
+
A = B;
-
+
switch(C) {
case SSI_COND_EQ: A->bo = (cmp == 0) ? 1 : 0; break;
case SSI_COND_NE: A->bo = (cmp != 0) ? 1 : 0; break;
@@ -53,9 +55,9 @@ exprline(A) ::= expr(B) cond(C) expr(D). {
case SSI_COND_LE: A->bo = (cmp <= 0) ? 1 : 0; break;
case SSI_COND_LT: A->bo = (cmp < 0) ? 1 : 0; break;
}
-
+
A->type = SSI_TYPE_BOOL;
-
+
ssi_val_free(D);
}
exprline(A) ::= expr(B). {
@@ -63,9 +65,9 @@ exprline(A) ::= expr(B). {
}
expr(A) ::= expr(B) AND expr(C). {
int e;
-
+
e = ssi_val_tobool(B) && ssi_val_tobool(C);
-
+
A = B;
A->bo = e;
A->type = SSI_TYPE_BOOL;
@@ -74,9 +76,9 @@ expr(A) ::= expr(B) AND expr(C). {
expr(A) ::= expr(B) OR expr(C). {
int e;
-
+
e = ssi_val_tobool(B) || ssi_val_tobool(C);
-
+
A = B;
A->bo = e;
A->type = SSI_TYPE_BOOL;
@@ -85,9 +87,9 @@ expr(A) ::= expr(B) OR expr(C). {
expr(A) ::= NOT expr(B). {
int e;
-
+
e = !ssi_val_tobool(B);
-
+
A = B;
A->bo = e;
A->type = SSI_TYPE_BOOL;
@@ -103,13 +105,12 @@ expr(A) ::= value(B). {
}
value(A) ::= VALUE(B). {
- A = B;
+ A = buffer_init_string(B->ptr);
}
value(A) ::= value(B) VALUE(C). {
A = B;
buffer_append_string_buffer(A, C);
- buffer_free(C);
}
cond(A) ::= EQ. { A = SSI_COND_EQ; }
diff --git a/src/mod_staticfile.c b/src/mod_staticfile.c
index f5114dd..6496689 100644
--- a/src/mod_staticfile.c
+++ b/src/mod_staticfile.c
@@ -1,3 +1,8 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -9,14 +14,9 @@
#include "http_chunk.h"
#include "response.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
/**
* this is a staticfile for a lighttpd plugin
- *
+ *
*/
@@ -25,54 +25,52 @@
typedef struct {
array *exclude_ext;
- unsigned short etags_used;
- unsigned short disable_pathinfo;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
buffer *range_buf;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
/* init the plugin data */
INIT_FUNC(mod_staticfile_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->range_buf = buffer_init();
-
+
return p;
}
/* detroy the plugin data */
FREE_FUNC(mod_staticfile_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
array_free(s->exclude_ext);
-
+
free(s);
}
free(p->config_storage);
}
buffer_free(p->range_buf);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -81,37 +79,31 @@ FREE_FUNC(mod_staticfile_free) {
SETDEFAULTS_FUNC(mod_staticfile_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "static-file.exclude-extensions", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { "static-file.etags", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
- { "static-file.disable-pathinfo", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->exclude_ext = array_init();
- s->etags_used = 1;
- s->disable_pathinfo = 0;
-
+
cv[0].destination = s->exclude_ext;
- cv[1].destination = &(s->etags_used);
- cv[2].destination = &(s->disable_pathinfo);
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
}
-
+
return HANDLER_GO_ON;
}
@@ -120,33 +112,27 @@ SETDEFAULTS_FUNC(mod_staticfile_set_defaults) {
static int mod_staticfile_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(exclude_ext);
- PATCH(etags_used);
- PATCH(disable_pathinfo);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("static-file.exclude-extensions"))) {
PATCH(exclude_ext);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("static-file.etags"))) {
- PATCH(etags_used);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("static-file.disable-pathinfo"))) {
- PATCH(disable_pathinfo);
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -160,69 +146,69 @@ static int http_response_parse_range(server *srv, connection *con, plugin_data *
data_string *ds;
stat_cache_entry *sce = NULL;
buffer *content_type = NULL;
-
+
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
SEGFAULT();
}
-
+
start = 0;
end = sce->st.st_size - 1;
-
+
con->response.content_length = 0;
-
+
if (NULL != (ds = (data_string *)array_get_element(con->response.headers, "Content-Type"))) {
content_type = ds->value;
}
-
+
for (s = con->request.http_range, error = 0;
!error && *s && NULL != (minus = strchr(s, '-')); ) {
char *err;
off_t la, le;
-
+
if (s == minus) {
/* -<stop> */
-
+
le = strtoll(s, &err, 10);
-
+
if (le == 0) {
/* RFC 2616 - 14.35.1 */
-
+
con->http_status = 416;
error = 1;
} else if (*err == '\0') {
/* end */
s = err;
-
+
end = sce->st.st_size - 1;
start = sce->st.st_size + le;
} else if (*err == ',') {
multipart = 1;
s = err + 1;
-
+
end = sce->st.st_size - 1;
start = sce->st.st_size + le;
} else {
error = 1;
}
-
+
} else if (*(minus+1) == '\0' || *(minus+1) == ',') {
/* <start>- */
-
+
la = strtoll(s, &err, 10);
-
+
if (err == minus) {
/* ok */
-
+
if (*(err + 1) == '\0') {
s = err + 1;
-
+
end = sce->st.st_size - 1;
start = la;
-
+
} else if (*(err + 1) == ',') {
multipart = 1;
s = err + 2;
-
+
end = sce->st.st_size - 1;
start = la;
} else {
@@ -234,119 +220,119 @@ static int http_response_parse_range(server *srv, connection *con, plugin_data *
}
} else {
/* <start>-<stop> */
-
+
la = strtoll(s, &err, 10);
-
+
if (err == minus) {
le = strtoll(minus+1, &err, 10);
-
+
/* RFC 2616 - 14.35.1 */
if (la > le) {
error = 1;
}
-
+
if (*err == '\0') {
/* ok, end*/
s = err;
-
+
end = le;
start = la;
} else if (*err == ',') {
multipart = 1;
s = err + 1;
-
+
end = le;
start = la;
} else {
/* error */
-
+
error = 1;
}
} else {
/* error */
-
+
error = 1;
}
}
-
+
if (!error) {
if (start < 0) start = 0;
-
+
/* RFC 2616 - 14.35.1 */
if (end > sce->st.st_size - 1) end = sce->st.st_size - 1;
-
+
if (start > sce->st.st_size - 1) {
error = 1;
-
+
con->http_status = 416;
}
}
-
+
if (!error) {
if (multipart) {
/* write boundary-header */
buffer *b;
-
+
b = chunkqueue_get_append_buffer(con->write_queue);
-
- buffer_copy_string_len(b, CONST_STR_LEN("\r\n--"));
+
+ buffer_copy_string(b, "\r\n--");
buffer_append_string(b, boundary);
-
+
/* write Content-Range */
- buffer_append_string_len(b, CONST_STR_LEN("\r\nContent-Range: bytes "));
+ buffer_append_string(b, "\r\nContent-Range: bytes ");
buffer_append_off_t(b, start);
- buffer_append_string_len(b, CONST_STR_LEN("-"));
+ buffer_append_string(b, "-");
buffer_append_off_t(b, end);
- buffer_append_string_len(b, CONST_STR_LEN("/"));
+ buffer_append_string(b, "/");
buffer_append_off_t(b, sce->st.st_size);
-
- buffer_append_string_len(b, CONST_STR_LEN("\r\nContent-Type: "));
+
+ buffer_append_string(b, "\r\nContent-Type: ");
buffer_append_string_buffer(b, content_type);
-
+
/* write END-OF-HEADER */
- buffer_append_string_len(b, CONST_STR_LEN("\r\n\r\n"));
-
+ buffer_append_string(b, "\r\n\r\n");
+
con->response.content_length += b->used - 1;
-
+
}
-
+
chunkqueue_append_file(con->write_queue, con->physical.path, start, end - start + 1);
con->response.content_length += end - start + 1;
}
}
-
+
/* something went wrong */
if (error) return -1;
-
+
if (multipart) {
/* add boundary end */
buffer *b;
-
+
b = chunkqueue_get_append_buffer(con->write_queue);
-
+
buffer_copy_string_len(b, "\r\n--", 4);
buffer_append_string(b, boundary);
buffer_append_string_len(b, "--\r\n", 4);
-
+
con->response.content_length += b->used - 1;
-
+
/* set header-fields */
-
- buffer_copy_string_len(p->range_buf, CONST_STR_LEN("multipart/byteranges; boundary="));
+
+ buffer_copy_string(p->range_buf, "multipart/byteranges; boundary=");
buffer_append_string(p->range_buf, boundary);
-
+
/* overwrite content-type */
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(p->range_buf));
} else {
/* add Content-Range-header */
-
- buffer_copy_string_len(p->range_buf, CONST_STR_LEN("bytes "));
+
+ buffer_copy_string(p->range_buf, "bytes ");
buffer_append_off_t(p->range_buf, start);
- buffer_append_string_len(p->range_buf, CONST_STR_LEN("-"));
+ buffer_append_string(p->range_buf, "-");
buffer_append_off_t(p->range_buf, end);
- buffer_append_string_len(p->range_buf, CONST_STR_LEN("/"));
+ buffer_append_string(p->range_buf, "/");
buffer_append_off_t(p->range_buf, sce->st.st_size);
-
+
response_header_insert(srv, con, CONST_STR_LEN("Content-Range"), CONST_BUF_LEN(p->range_buf));
}
@@ -357,16 +343,16 @@ static int http_response_parse_range(server *srv, connection *con, plugin_data *
URIHANDLER_FUNC(mod_staticfile_subrequest) {
plugin_data *p = p_d;
size_t k;
+ int s_len;
stat_cache_entry *sce = NULL;
- buffer *mtime = NULL;
+ buffer *mtime;
data_string *ds;
- int allow_caching = 1;
-
+
/* someone else has done a decision for us */
if (con->http_status != 0) return HANDLER_GO_ON;
if (con->uri.path->used == 0) return HANDLER_GO_ON;
if (con->physical.path->used == 0) return HANDLER_GO_ON;
-
+
/* someone else has handled this request */
if (con->mode != DIRECT) return HANDLER_GO_ON;
@@ -379,184 +365,120 @@ URIHANDLER_FUNC(mod_staticfile_subrequest) {
default:
return HANDLER_GO_ON;
}
-
+
mod_staticfile_patch_connection(srv, con, p);
-
- if (p->conf.disable_pathinfo && 0 != con->request.pathinfo->used) {
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s", "-- NOT handling file as static file, pathinfo forbidden");
- }
- return HANDLER_GO_ON;
- }
-
+
+ s_len = con->uri.path->used - 1;
+
/* ignore certain extensions */
for (k = 0; k < p->conf.exclude_ext->used; k++) {
- ds = (data_string *)p->conf.exclude_ext->data[k];
+ int ct_len;
- if (ds->value->used == 0) continue;
+ ds = (data_string *)p->conf.exclude_ext->data[k];
- if (buffer_is_equal_right_len(con->physical.path, ds->value, ds->value->used - 1)) {
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s", "-- NOT handling file as static file, extension forbidden");
- }
+ ct_len = ds->value->used - 1;
+
+ if (ct_len > s_len) continue;
+
+ if (ds->value->used == 0) continue;
+
+ if (0 == strncmp(con->uri.path->ptr + s_len - ct_len, ds->value->ptr, ct_len)) {
return HANDLER_GO_ON;
}
}
-
+
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- handling file as static file");
}
-
+
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
con->http_status = 403;
-
+
log_error_write(srv, __FILE__, __LINE__, "sbsb",
"not a regular file:", con->uri.path,
"->", con->physical.path);
-
+
return HANDLER_FINISHED;
}
-
+
/* we only handline regular files */
-#ifdef HAVE_LSTAT
- if ((sce->is_symlink == 1) && !con->conf.follow_symlink) {
- con->http_status = 403;
-
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s", "-- access denied due symlink restriction");
- log_error_write(srv, __FILE__, __LINE__, "sb", "Path :", con->physical.path);
- }
-
- buffer_reset(con->physical.path);
- return HANDLER_FINISHED;
- }
-#endif
if (!S_ISREG(sce->st.st_mode)) {
con->http_status = 404;
-
+
if (con->conf.log_file_not_found) {
log_error_write(srv, __FILE__, __LINE__, "sbsb",
"not a regular file:", con->uri.path,
"->", sce->name);
}
-
+
return HANDLER_FINISHED;
}
/* mod_compress might set several data directly, don't overwrite them */
-
+
/* set response content-type, if not set already */
if (NULL == array_get_element(con->response.headers, "Content-Type")) {
if (buffer_is_empty(sce->content_type)) {
- /* we are setting application/octet-stream, but also announce that
- * this header field might change in the seconds few requests
- *
- * This should fix the aggressive caching of FF and the script download
- * seen by the first installations
- */
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("application/octet-stream"));
-
- allow_caching = 0;
} else {
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
}
}
-
- if (con->conf.range_requests) {
- response_header_overwrite(srv, con, CONST_STR_LEN("Accept-Ranges"), CONST_STR_LEN("bytes"));
+
+ if (NULL == array_get_element(con->response.headers, "ETag")) {
+ /* generate e-tag */
+ etag_mutate(con->physical.etag, sce->etag);
+
+ response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
}
-
- if (allow_caching) {
- if (p->conf.etags_used && con->etag_flags != 0 && !buffer_is_empty(sce->etag)) {
- if (NULL == array_get_element(con->response.headers, "ETag")) {
- /* generate e-tag */
- etag_mutate(con->physical.etag, sce->etag);
-
- response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
- }
- }
-
- /* prepare header */
- if (NULL == (ds = (data_string *)array_get_element(con->response.headers, "Last-Modified"))) {
- mtime = strftime_cache_get(srv, sce->st.st_mtime);
- response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
- } else {
- mtime = ds->value;
- }
-
- if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) {
- return HANDLER_FINISHED;
- }
+ response_header_overwrite(srv, con, CONST_STR_LEN("Accept-Ranges"), CONST_STR_LEN("bytes"));
+
+ /* prepare header */
+ if (NULL == (ds = (data_string *)array_get_element(con->response.headers, "Last-Modified"))) {
+ mtime = strftime_cache_get(srv, sce->st.st_mtime);
+ response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
+ } else {
+ mtime = ds->value;
}
- if (con->request.http_range && con->conf.range_requests) {
- int do_range_request = 1;
- /* check if we have a conditional GET */
-
- if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "If-Range"))) {
- /* if the value is the same as our ETag, we do a Range-request,
- * otherwise a full 200 */
-
- if (ds->value->ptr[0] == '"') {
- /**
- * client wants a ETag
- */
- if (!con->physical.etag) {
- do_range_request = 0;
- } else if (!buffer_is_equal(ds->value, con->physical.etag)) {
- do_range_request = 0;
- }
- } else if (!mtime) {
- /**
- * we don't have a Last-Modified and can match the If-Range:
- *
- * sending all
- */
- do_range_request = 0;
- } else if (!buffer_is_equal(ds->value, mtime)) {
- do_range_request = 0;
- }
- }
-
- if (do_range_request) {
- /* content prepared, I'm done */
- con->file_finished = 1;
-
- if (0 == http_response_parse_range(srv, con, p)) {
- con->http_status = 206;
- }
- return HANDLER_FINISHED;
+ if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) {
+ return HANDLER_FINISHED;
+ } else if (con->request.http_range && con->conf.range_requests) {
+ /* content prepared, I'm done */
+ con->file_finished = 1;
+
+ if (0 == http_response_parse_range(srv, con, p)) {
+ con->http_status = 206;
}
+ return HANDLER_FINISHED;
}
-
+
/* if we are still here, prepare body */
-
- /* we add it here for all requests
- * the HEAD request will drop it afterwards again
+
+ /* we add it here for all requests
+ * the HEAD request will drop it afterwards again
*/
http_chunk_append_file(srv, con, con->physical.path, 0, sce->st.st_size);
-
- con->http_status = 200;
+
con->file_finished = 1;
-
+
return HANDLER_FINISHED;
}
/* this function is called at dlopen() time and inits the callbacks */
-int mod_staticfile_plugin_init(plugin *p);
int mod_staticfile_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("staticfile");
-
+
p->init = mod_staticfile_init;
p->handle_subrequest_start = mod_staticfile_subrequest;
p->set_defaults = mod_staticfile_set_defaults;
p->cleanup = mod_staticfile_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_status.c b/src/mod_status.c
index 76061f9..f69a1f4 100644
--- a/src/mod_status.c
+++ b/src/mod_status.c
@@ -1,13 +1,4 @@
-#include "server.h"
-#include "connections.h"
-#include "response.h"
-#include "connections.h"
-#include "log.h"
-
-#include "plugin.h"
-
-#include "inet_ntop_cache.h"
-
+#define _GNU_SOURCE
#include <sys/types.h>
#include <fcntl.h>
@@ -18,173 +9,175 @@
#include <time.h>
#include <stdio.h>
-#include "version.h"
+#include "server.h"
+#include "connections.h"
+#include "response.h"
+#include "connections.h"
+#include "log.h"
+
+#include "plugin.h"
+
+#include "inet_ntop_cache.h"
typedef struct {
buffer *config_url;
buffer *status_url;
- buffer *statistics_url;
-
int sort;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
double traffic_out;
double requests;
-
+
double mod_5s_traffic_out[5];
double mod_5s_requests[5];
size_t mod_5s_ndx;
-
+
double rel_traffic_out;
double rel_requests;
-
+
double abs_traffic_out;
double abs_requests;
-
+
double bytes_written;
-
+
buffer *module_list;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
INIT_FUNC(mod_status_init) {
plugin_data *p;
size_t i;
-
+
p = calloc(1, sizeof(*p));
-
+
p->traffic_out = p->requests = 0;
p->rel_traffic_out = p->rel_requests = 0;
p->abs_traffic_out = p->abs_requests = 0;
p->bytes_written = 0;
p->module_list = buffer_init();
-
+
for (i = 0; i < 5; i++) {
p->mod_5s_traffic_out[i] = p->mod_5s_requests[i] = 0;
}
-
+
return p;
}
FREE_FUNC(mod_status_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
buffer_free(p->module_list);
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
buffer_free(s->status_url);
- buffer_free(s->statistics_url);
buffer_free(s->config_url);
-
+
free(s);
}
free(p->config_storage);
}
-
-
+
+
free(p);
-
+
return HANDLER_GO_ON;
}
SETDEFAULTS_FUNC(mod_status_set_defaults) {
plugin_data *p = p_d;
size_t i;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "status.status-url", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
{ "status.config-url", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
- { "status.enable-sort", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
- { "status.statistics-url", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
+ { "status.enable-sort", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->config_url = buffer_init();
s->status_url = buffer_init();
s->sort = 1;
- s->statistics_url = buffer_init();
-
+
cv[0].destination = s->status_url;
cv[1].destination = s->config_url;
cv[2].destination = &(s->sort);
- cv[3].destination = s->statistics_url;
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
}
-
+
return HANDLER_GO_ON;
}
static int mod_status_row_append(buffer *b, const char *key, const char *value) {
- buffer_append_string_len(b, CONST_STR_LEN(" <tr>\n"));
- buffer_append_string_len(b, CONST_STR_LEN(" <td><b>"));
+ BUFFER_APPEND_STRING_CONST(b, " <tr>\n");
+ BUFFER_APPEND_STRING_CONST(b, " <td><b>");
buffer_append_string(b, key);
- buffer_append_string_len(b, CONST_STR_LEN("</b></td>\n"));
- buffer_append_string_len(b, CONST_STR_LEN(" <td>"));
+ BUFFER_APPEND_STRING_CONST(b, "</b></td>\n");
+ BUFFER_APPEND_STRING_CONST(b, " <td>");
buffer_append_string(b, value);
- buffer_append_string_len(b, CONST_STR_LEN("</td>\n"));
- buffer_append_string_len(b, CONST_STR_LEN(" </tr>\n"));
-
+ BUFFER_APPEND_STRING_CONST(b, "</td>\n");
+ BUFFER_APPEND_STRING_CONST(b, " </tr>\n");
+
return 0;
}
static int mod_status_header_append(buffer *b, const char *key) {
- buffer_append_string_len(b, CONST_STR_LEN(" <tr>\n"));
- buffer_append_string_len(b, CONST_STR_LEN(" <th colspan=\"2\">"));
+ BUFFER_APPEND_STRING_CONST(b, " <tr>\n");
+ BUFFER_APPEND_STRING_CONST(b, " <th colspan=\"2\">");
buffer_append_string(b, key);
- buffer_append_string_len(b, CONST_STR_LEN("</th>\n"));
- buffer_append_string_len(b, CONST_STR_LEN(" </tr>\n"));
-
+ BUFFER_APPEND_STRING_CONST(b, "</th>\n");
+ BUFFER_APPEND_STRING_CONST(b, " </tr>\n");
+
return 0;
}
static int mod_status_header_append_sort(buffer *b, void *p_d, const char* key) {
plugin_data *p = p_d;
-
+
if (p->conf.sort) {
- buffer_append_string_len(b, CONST_STR_LEN("<th class=\"status\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">"));
+ BUFFER_APPEND_STRING_CONST(b, "<th class=\"status\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">");
buffer_append_string(b, key);
- buffer_append_string_len(b, CONST_STR_LEN("<span class=\"sortarrow\">:</span></a></th>\n"));
+ BUFFER_APPEND_STRING_CONST(b, "<span class=\"sortarrow\"></span></a></th>\n");
} else {
- buffer_append_string_len(b, CONST_STR_LEN("<th class=\"status\">"));
+ BUFFER_APPEND_STRING_CONST(b, "<th class=\"status\">");
buffer_append_string(b, key);
- buffer_append_string_len(b, CONST_STR_LEN("</th>\n"));
+ BUFFER_APPEND_STRING_CONST(b, "</th>\n");
}
-
+
return 0;
}
static int mod_status_get_multiplier(double *avg, char *multiplier, int size) {
*multiplier = ' ';
-
+
if (*avg > size) { *avg /= size; *multiplier = 'k'; }
if (*avg > size) { *avg /= size; *multiplier = 'M'; }
if (*avg > size) { *avg /= size; *multiplier = 'G'; }
@@ -205,36 +198,37 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
char multiplier = '\0';
char buf[32];
time_t ts;
-
+
int days, hours, mins, seconds;
-
+
b = chunkqueue_get_append_buffer(con->write_queue);
- buffer_copy_string_len(b, CONST_STR_LEN(
+ BUFFER_COPY_STRING_CONST(b,
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n"
" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"
" <head>\n"
- " <title>Status</title>\n"
-
+ " <title>Status</title>\n");
+
+ BUFFER_APPEND_STRING_CONST(b,
" <style type=\"text/css\">\n"
" table.status { border: black solid thin; }\n"
- " td { white-space: nowrap; }\n"
" td.int { background-color: #f0f0f0; text-align: right }\n"
" td.string { background-color: #f0f0f0; text-align: left }\n"
" th.status { background-color: black; color: white; font-weight: bold; }\n"
" a.sortheader { background-color: black; color: white; font-weight: bold; text-decoration: none; display: block; }\n"
" span.sortarrow { color: white; text-decoration: none; }\n"
- " </style>\n"));
-
+ " </style>\n");
+
if (p->conf.sort) {
- buffer_append_string_len(b, CONST_STR_LEN(
+ BUFFER_APPEND_STRING_CONST(b,
"<script type=\"text/javascript\">\n"
"// <!--\n"
"var sort_column;\n"
- "var prev_span = null;\n"
-
+ "var prev_span = null;\n");
+
+ BUFFER_APPEND_STRING_CONST(b,
"function get_inner_text(el) {\n"
" if((typeof el == 'string')||(typeof el == 'undefined'))\n"
" return el;\n"
@@ -250,8 +244,9 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
" }\n"
" }\n"
" return str;\n"
- "}\n"
-
+ "}\n");
+
+ BUFFER_APPEND_STRING_CONST(b,
"function sortfn(a,b) {\n"
" var at = get_inner_text(a.cells[sort_column]);\n"
" var bt = get_inner_text(b.cells[sort_column]);\n"
@@ -264,8 +259,9 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
" else if (aa<bb) return -1;\n"
" else return 1;\n"
" }\n"
- "}\n"
-
+ "}\n");
+
+ BUFFER_APPEND_STRING_CONST(b,
"function resort(lnk) {\n"
" var span = lnk.childNodes[1];\n"
" var table = lnk.parentNode.parentNode.parentNode.parentNode;\n"
@@ -273,8 +269,9 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
" for (j=1;j<table.rows.length;j++)\n"
" rows[j-1] = table.rows[j];\n"
" sort_column = lnk.parentNode.cellIndex;\n"
- " rows.sort(sortfn);\n"
-
+ " rows.sort(sortfn);\n");
+
+ BUFFER_APPEND_STRING_CONST(b,
" if (prev_span != null) prev_span.innerHTML = '';\n"
" if (span.getAttribute('sortdir')=='down') {\n"
" span.innerHTML = '&uarr;';\n"
@@ -289,185 +286,178 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
" prev_span = span;\n"
"}\n"
"// -->\n"
- "</script>\n"));
+ "</script>\n");
}
-
- buffer_append_string_len(b, CONST_STR_LEN(
+
+ BUFFER_APPEND_STRING_CONST(b,
" </head>\n"
- " <body>\n"));
-
-
-
+ " <body>\n");
+
+
+
/* connection listing */
- buffer_append_string_len(b, CONST_STR_LEN("<h1>Server-Status (" PACKAGE_NAME " " PACKAGE_VERSION ")</h1>"));
-
- buffer_append_string_len(b, CONST_STR_LEN("<table summary=\"status\" class=\"status\">"));
- buffer_append_string_len(b, CONST_STR_LEN("<tr><td>Hostname</td><td class=\"string\">"));
+ BUFFER_APPEND_STRING_CONST(b, "<h1>Server-Status</h1>");
+
+ BUFFER_APPEND_STRING_CONST(b, "<table class=\"status\">");
+ BUFFER_APPEND_STRING_CONST(b, "<tr><td>Hostname</td><td class=\"string\">");
buffer_append_string_buffer(b, con->uri.authority);
- buffer_append_string_len(b, CONST_STR_LEN(" ("));
+ BUFFER_APPEND_STRING_CONST(b, " (");
buffer_append_string_buffer(b, con->server_name);
- buffer_append_string_len(b, CONST_STR_LEN(")</td></tr>\n"));
- buffer_append_string_len(b, CONST_STR_LEN("<tr><td>Uptime</td><td class=\"string\">"));
-
+ BUFFER_APPEND_STRING_CONST(b, ")</td></tr>\n");
+ BUFFER_APPEND_STRING_CONST(b, "<tr><td>Uptime</td><td class=\"string\">");
+
ts = srv->cur_ts - srv->startup_ts;
-
+
days = ts / (60 * 60 * 24);
ts %= (60 * 60 * 24);
-
+
hours = ts / (60 * 60);
ts %= (60 * 60);
-
+
mins = ts / (60);
ts %= (60);
-
+
seconds = ts;
-
+
if (days) {
buffer_append_long(b, days);
- buffer_append_string_len(b, CONST_STR_LEN(" days "));
+ BUFFER_APPEND_STRING_CONST(b, " days ");
}
-
+
if (hours) {
buffer_append_long(b, hours);
- buffer_append_string_len(b, CONST_STR_LEN(" hours "));
+ BUFFER_APPEND_STRING_CONST(b, " hours ");
}
-
+
if (mins) {
buffer_append_long(b, mins);
- buffer_append_string_len(b, CONST_STR_LEN(" min "));
+ BUFFER_APPEND_STRING_CONST(b, " min ");
}
-
+
buffer_append_long(b, seconds);
- buffer_append_string_len(b, CONST_STR_LEN(" s"));
-
- buffer_append_string_len(b, CONST_STR_LEN("</td></tr>\n"));
- buffer_append_string_len(b, CONST_STR_LEN("<tr><td>Started at</td><td class=\"string\">"));
-
+ BUFFER_APPEND_STRING_CONST(b, " s");
+
+ BUFFER_APPEND_STRING_CONST(b, "</td></tr>\n");
+ BUFFER_APPEND_STRING_CONST(b, "<tr><td>Started at</td><td class=\"string\">");
+
ts = srv->startup_ts;
-
+
strftime(buf, sizeof(buf) - 1, "%Y-%m-%d %H:%M:%S", localtime(&ts));
buffer_append_string(b, buf);
- buffer_append_string_len(b, CONST_STR_LEN("</td></tr>\n"));
-
-
- buffer_append_string_len(b, CONST_STR_LEN("<tr><th colspan=\"2\">absolute (since start)</th></tr>\n"));
-
- buffer_append_string_len(b, CONST_STR_LEN("<tr><td>Requests</td><td class=\"string\">"));
+ BUFFER_APPEND_STRING_CONST(b, "</td></tr>\n");
+
+
+ BUFFER_APPEND_STRING_CONST(b, "<tr><th colspan=\"2\">absolute (since start)</th></tr>\n");
+
+ BUFFER_APPEND_STRING_CONST(b, "<tr><td>Requests</td><td class=\"string\">");
avg = p->abs_requests;
mod_status_get_multiplier(&avg, &multiplier, 1000);
-
+
buffer_append_long(b, avg);
- buffer_append_string_len(b, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(b, " ");
if (multiplier) buffer_append_string_len(b, &multiplier, 1);
- buffer_append_string_len(b, CONST_STR_LEN("req</td></tr>\n"));
-
- buffer_append_string_len(b, CONST_STR_LEN("<tr><td>Traffic</td><td class=\"string\">"));
+ BUFFER_APPEND_STRING_CONST(b, "req</td></tr>\n");
+
+ BUFFER_APPEND_STRING_CONST(b, "<tr><td>Traffic</td><td class=\"string\">");
avg = p->abs_traffic_out;
mod_status_get_multiplier(&avg, &multiplier, 1024);
sprintf(buf, "%.2f", avg);
buffer_append_string(b, buf);
- buffer_append_string_len(b, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(b, " ");
if (multiplier) buffer_append_string_len(b, &multiplier, 1);
- buffer_append_string_len(b, CONST_STR_LEN("byte</td></tr>\n"));
+ BUFFER_APPEND_STRING_CONST(b, "byte</td></tr>\n");
- buffer_append_string_len(b, CONST_STR_LEN("<tr><th colspan=\"2\">average (since start)</th></tr>\n"));
-
- buffer_append_string_len(b, CONST_STR_LEN("<tr><td>Requests</td><td class=\"string\">"));
+ BUFFER_APPEND_STRING_CONST(b, "<tr><th colspan=\"2\">average (since start)</th></tr>\n");
+
+ BUFFER_APPEND_STRING_CONST(b, "<tr><td>Requests</td><td class=\"string\">");
avg = p->abs_requests / (srv->cur_ts - srv->startup_ts);
mod_status_get_multiplier(&avg, &multiplier, 1000);
buffer_append_long(b, avg);
- buffer_append_string_len(b, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(b, " ");
if (multiplier) buffer_append_string_len(b, &multiplier, 1);
- buffer_append_string_len(b, CONST_STR_LEN("req/s</td></tr>\n"));
-
- buffer_append_string_len(b, CONST_STR_LEN("<tr><td>Traffic</td><td class=\"string\">"));
+ BUFFER_APPEND_STRING_CONST(b, "req/s</td></tr>\n");
+
+ BUFFER_APPEND_STRING_CONST(b, "<tr><td>Traffic</td><td class=\"string\">");
avg = p->abs_traffic_out / (srv->cur_ts - srv->startup_ts);
mod_status_get_multiplier(&avg, &multiplier, 1024);
sprintf(buf, "%.2f", avg);
buffer_append_string(b, buf);
- buffer_append_string_len(b, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(b, " ");
if (multiplier) buffer_append_string_len(b, &multiplier, 1);
- buffer_append_string_len(b, CONST_STR_LEN("byte/s</td></tr>\n"));
+ BUFFER_APPEND_STRING_CONST(b, "byte/s</td></tr>\n");
-
-
- buffer_append_string_len(b, CONST_STR_LEN("<tr><th colspan=\"2\">average (5s sliding average)</th></tr>\n"));
+
+
+ BUFFER_APPEND_STRING_CONST(b, "<tr><th colspan=\"2\">average (5s sliding average)</th></tr>\n");
for (j = 0, avg = 0; j < 5; j++) {
avg += p->mod_5s_requests[j];
}
-
+
avg /= 5;
-
- buffer_append_string_len(b, CONST_STR_LEN("<tr><td>Requests</td><td class=\"string\">"));
+
+ BUFFER_APPEND_STRING_CONST(b, "<tr><td>Requests</td><td class=\"string\">");
mod_status_get_multiplier(&avg, &multiplier, 1000);
buffer_append_long(b, avg);
- buffer_append_string_len(b, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(b, " ");
if (multiplier) buffer_append_string_len(b, &multiplier, 1);
-
- buffer_append_string_len(b, CONST_STR_LEN("req/s</td></tr>\n"));
-
+
+ BUFFER_APPEND_STRING_CONST(b, "req/s</td></tr>\n");
+
for (j = 0, avg = 0; j < 5; j++) {
avg += p->mod_5s_traffic_out[j];
}
-
+
avg /= 5;
-
- buffer_append_string_len(b, CONST_STR_LEN("<tr><td>Traffic</td><td class=\"string\">"));
+
+ BUFFER_APPEND_STRING_CONST(b, "<tr><td>Traffic</td><td class=\"string\">");
mod_status_get_multiplier(&avg, &multiplier, 1024);
sprintf(buf, "%.2f", avg);
buffer_append_string(b, buf);
- buffer_append_string_len(b, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(b, " ");
if (multiplier) buffer_append_string_len(b, &multiplier, 1);
- buffer_append_string_len(b, CONST_STR_LEN("byte/s</td></tr>\n"));
-
- buffer_append_string_len(b, CONST_STR_LEN("</table>\n"));
-
-
- buffer_append_string_len(b, CONST_STR_LEN(
- "<hr />\n<pre><b>legend</b>\n"
- ". = connect, C = close, E = hard error, k = keep-alive\n"
- "r = read, R = read-POST, W = write, h = handle-request\n"
- "q = request-start, Q = request-end\n"
- "s = response-start, S = response-end\n"));
-
- buffer_append_string_len(b, CONST_STR_LEN("<b>"));
+ BUFFER_APPEND_STRING_CONST(b, "byte/s</td></tr>\n");
+
+ BUFFER_APPEND_STRING_CONST(b, "</table>\n");
+
+
+ BUFFER_APPEND_STRING_CONST(b, "<hr />\n<pre><b>legend</b>\n");
+ BUFFER_APPEND_STRING_CONST(b, ". = connect, C = close, E = hard error\n");
+ BUFFER_APPEND_STRING_CONST(b, "r = read, R = read-POST, W = write, h = handle-request\n");
+ BUFFER_APPEND_STRING_CONST(b, "q = request-start, Q = request-end\n");
+ BUFFER_APPEND_STRING_CONST(b, "s = response-start, S = response-end\n");
+
+ BUFFER_APPEND_STRING_CONST(b, "<b>");
buffer_append_long(b, srv->conns->used);
- buffer_append_string_len(b, CONST_STR_LEN(" connections</b>\n"));
-
+ BUFFER_APPEND_STRING_CONST(b, " connections</b>\n");
+
for (j = 0; j < srv->conns->used; j++) {
connection *c = srv->conns->ptr[j];
- const char *state;
-
- if (CON_STATE_READ == c->state && c->request.orig_uri->used > 0) {
- state = "k";
- } else {
- state = connection_get_short_state(c->state);
- }
-
+ const char *state = connection_get_short_state(c->state);
+
buffer_append_string_len(b, state, 1);
-
+
if (((j + 1) % 50) == 0) {
- buffer_append_string_len(b, CONST_STR_LEN("\n"));
+ BUFFER_APPEND_STRING_CONST(b, "\n");
}
}
-
- buffer_append_string_len(b, CONST_STR_LEN("\n</pre><hr />\n<h2>Connections</h2>\n"));
-
- buffer_append_string_len(b, CONST_STR_LEN("<table summary=\"status\" class=\"status\">\n"));
- buffer_append_string_len(b, CONST_STR_LEN("<tr>"));
+
+ BUFFER_APPEND_STRING_CONST(b, "\n</pre><hr />\n<h2>Connections</h2>\n");
+
+ BUFFER_APPEND_STRING_CONST(b, "<table class=\"status\">\n");
+ BUFFER_APPEND_STRING_CONST(b, "<tr>");
mod_status_header_append_sort(b, p_d, "Client IP");
mod_status_header_append_sort(b, p_d, "Read");
mod_status_header_append_sort(b, p_d, "Written");
@@ -476,87 +466,73 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
mod_status_header_append_sort(b, p_d, "Host");
mod_status_header_append_sort(b, p_d, "URI");
mod_status_header_append_sort(b, p_d, "File");
- buffer_append_string_len(b, CONST_STR_LEN("</tr>\n"));
-
+ BUFFER_APPEND_STRING_CONST(b, "</tr>\n");
+
for (j = 0; j < srv->conns->used; j++) {
connection *c = srv->conns->ptr[j];
-
- buffer_append_string_len(b, CONST_STR_LEN("<tr><td class=\"string\">"));
-
+
+ BUFFER_APPEND_STRING_CONST(b, "<tr><td class=\"string\">");
+
buffer_append_string(b, inet_ntop_cache_get_ip(srv, &(c->dst_addr)));
-
- buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"int\">"));
-
- if (c->request.content_length) {
+
+ BUFFER_APPEND_STRING_CONST(b, "</td><td class=\"int\">");
+
+ if (con->request.content_length) {
buffer_append_long(b, c->request_content_queue->bytes_in);
- buffer_append_string_len(b, CONST_STR_LEN("/"));
+ BUFFER_APPEND_STRING_CONST(b, "/");
buffer_append_long(b, c->request.content_length);
} else {
- buffer_append_string_len(b, CONST_STR_LEN("0/0"));
+ BUFFER_APPEND_STRING_CONST(b, "0/0");
}
-
- buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"int\">"));
-
+
+ BUFFER_APPEND_STRING_CONST(b, "</td><td class=\"int\">");
+
buffer_append_off_t(b, chunkqueue_written(c->write_queue));
- buffer_append_string_len(b, CONST_STR_LEN("/"));
+ BUFFER_APPEND_STRING_CONST(b, "/");
buffer_append_off_t(b, chunkqueue_length(c->write_queue));
-
- buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"string\">"));
-
- if (CON_STATE_READ == c->state && c->request.orig_uri->used > 0) {
- buffer_append_string_len(b, CONST_STR_LEN("keep-alive"));
- } else {
- buffer_append_string(b, connection_get_state(c->state));
- }
-
- buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"int\">"));
-
+
+ BUFFER_APPEND_STRING_CONST(b, "</td><td class=\"string\">");
+
+ buffer_append_string(b, connection_get_state(c->state));
+
+ BUFFER_APPEND_STRING_CONST(b, "</td><td class=\"int\">");
+
buffer_append_long(b, srv->cur_ts - c->request_start);
-
- buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"string\">"));
-
+
+ BUFFER_APPEND_STRING_CONST(b, "</td><td class=\"string\">");
+
if (buffer_is_empty(c->server_name)) {
buffer_append_string_buffer(b, c->uri.authority);
}
else {
buffer_append_string_buffer(b, c->server_name);
}
-
- buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"string\">"));
-
+
+ BUFFER_APPEND_STRING_CONST(b, "</td><td class=\"string\">");
+
if (!buffer_is_empty(c->uri.path)) {
buffer_append_string_encoded(b, CONST_BUF_LEN(c->uri.path), ENCODING_HTML);
}
-
- if (!buffer_is_empty(c->uri.query)) {
- buffer_append_string_len(b, CONST_STR_LEN("?"));
- buffer_append_string_encoded(b, CONST_BUF_LEN(c->uri.query), ENCODING_HTML);
- }
-
- if (!buffer_is_empty(c->request.orig_uri)) {
- buffer_append_string_len(b, CONST_STR_LEN(" ("));
- buffer_append_string_encoded(b, CONST_BUF_LEN(c->request.orig_uri), ENCODING_HTML);
- buffer_append_string_len(b, CONST_STR_LEN(")"));
- }
- buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"string\">"));
-
+
+ BUFFER_APPEND_STRING_CONST(b, "</td><td class=\"string\">");
+
buffer_append_string_buffer(b, c->physical.path);
-
- buffer_append_string_len(b, CONST_STR_LEN("</td></tr>\n"));
+
+ BUFFER_APPEND_STRING_CONST(b, "</td></tr>\n");
}
-
-
- buffer_append_string_len(b, CONST_STR_LEN(
- "</table>\n"));
-
-
- buffer_append_string_len(b, CONST_STR_LEN(
+
+
+ BUFFER_APPEND_STRING_CONST(b,
+ "</table>\n");
+
+
+ BUFFER_APPEND_STRING_CONST(b,
" </body>\n"
"</html>\n"
- ));
-
+ );
+
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
-
+
return 0;
}
@@ -566,105 +542,50 @@ static handler_t mod_status_handle_server_status_text(server *srv, connection *c
buffer *b;
double avg;
time_t ts;
- char buf[32];
- unsigned int k;
- unsigned int l;
-
+
b = chunkqueue_get_append_buffer(con->write_queue);
/* output total number of requests */
- buffer_append_string_len(b, CONST_STR_LEN("Total Accesses: "));
+ BUFFER_APPEND_STRING_CONST(b, "Total Accesses: ");
avg = p->abs_requests;
- snprintf(buf, sizeof(buf) - 1, "%.0f", avg);
- buffer_append_string(b, buf);
- buffer_append_string_len(b, CONST_STR_LEN("\n"));
-
+ buffer_append_long(b, avg);
+ BUFFER_APPEND_STRING_CONST(b, "\n");
+
/* output total traffic out in kbytes */
- buffer_append_string_len(b, CONST_STR_LEN("Total kBytes: "));
+ BUFFER_APPEND_STRING_CONST(b, "Total kBytes: ");
avg = p->abs_traffic_out / 1024;
- snprintf(buf, sizeof(buf) - 1, "%.0f", avg);
- buffer_append_string(b, buf);
- buffer_append_string_len(b, CONST_STR_LEN("\n"));
-
+ buffer_append_long(b, avg);
+ BUFFER_APPEND_STRING_CONST(b, "\n");
+
/* output uptime */
- buffer_append_string_len(b, CONST_STR_LEN("Uptime: "));
+ BUFFER_APPEND_STRING_CONST(b, "Uptime: ");
ts = srv->cur_ts - srv->startup_ts;
buffer_append_long(b, ts);
- buffer_append_string_len(b, CONST_STR_LEN("\n"));
-
+ BUFFER_APPEND_STRING_CONST(b, "\n");
+
/* output busy servers */
- buffer_append_string_len(b, CONST_STR_LEN("BusyServers: "));
+ BUFFER_APPEND_STRING_CONST(b, "BusyServers: ");
buffer_append_long(b, srv->conns->used);
- buffer_append_string_len(b, CONST_STR_LEN("\n"));
-
- buffer_append_string_len(b, CONST_STR_LEN("IdleServers: "));
- buffer_append_long(b, srv->conns->size - srv->conns->used);
- buffer_append_string_len(b, CONST_STR_LEN("\n"));
-
- /* output scoreboard */
- buffer_append_string_len(b, CONST_STR_LEN("Scoreboard: "));
- for (k = 0; k < srv->conns->used; k++) {
- connection *c = srv->conns->ptr[k];
- const char *state = connection_get_short_state(c->state);
- buffer_append_string_len(b, state, 1);
- }
- for (l = 0; l < srv->conns->size - srv->conns->used; l++) {
- buffer_append_string_len(b, CONST_STR_LEN("_"));
- }
- buffer_append_string_len(b, CONST_STR_LEN("\n"));
+ BUFFER_APPEND_STRING_CONST(b, "\n");
/* set text/plain output */
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/plain"));
-
+
return 0;
}
-static handler_t mod_status_handle_server_statistics(server *srv, connection *con, void *p_d) {
- buffer *b;
- size_t i;
- array *st = srv->status;
- UNUSED(p_d);
-
- if (0 == st->used) {
- /* we have nothing to send */
- con->http_status = 204;
- con->file_finished = 1;
-
- return HANDLER_FINISHED;
- }
-
- b = chunkqueue_get_append_buffer(con->write_queue);
-
- for (i = 0; i < st->used; i++) {
- size_t ndx = st->sorted[i];
-
- buffer_append_string_buffer(b, st->data[ndx]->key);
- buffer_append_string_len(b, CONST_STR_LEN(": "));
- buffer_append_long(b, ((data_integer *)(st->data[ndx]))->value);
- buffer_append_string_len(b, CONST_STR_LEN("\n"));
- }
-
- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/plain"));
-
- con->http_status = 200;
- con->file_finished = 1;
-
- return HANDLER_FINISHED;
-}
-
-
static handler_t mod_status_handle_server_status(server *srv, connection *con, void *p_d) {
-
+
if (buffer_is_equal_string(con->uri.query, CONST_STR_LEN("auto"))) {
mod_status_handle_server_status_text(srv, con, p_d);
} else {
mod_status_handle_server_status_html(srv, con, p_d);
}
-
+
con->http_status = 200;
con->file_finished = 1;
-
+
return HANDLER_FINISHED;
}
@@ -673,39 +594,37 @@ static handler_t mod_status_handle_server_config(server *srv, connection *con, v
plugin_data *p = p_d;
buffer *b, *m = p->module_list;
size_t i;
-
- struct ev_map { fdevent_handler_t et; const char *name; } event_handlers[] =
- {
- /* - epoll is most reliable
+
+ struct ev_map { fdevent_handler_t et; const char *name; } event_handlers[] =
+ {
+ /* - poll is most reliable
* - select works everywhere
+ * - linux-* are experimental
*/
-#ifdef USE_LINUX_EPOLL
- { FDEVENT_HANDLER_LINUX_SYSEPOLL, "linux-sysepoll" },
-#endif
#ifdef USE_POLL
{ FDEVENT_HANDLER_POLL, "poll" },
#endif
#ifdef USE_SELECT
{ FDEVENT_HANDLER_SELECT, "select" },
#endif
-#ifdef USE_LIBEV
- { FDEVENT_HANDLER_LIBEV, "libev" },
+#ifdef USE_LINUX_EPOLL
+ { FDEVENT_HANDLER_LINUX_SYSEPOLL, "linux-sysepoll" },
+#endif
+#ifdef USE_LINUX_SIGIO
+ { FDEVENT_HANDLER_LINUX_RTSIG, "linux-rtsig" },
#endif
#ifdef USE_SOLARIS_DEVPOLL
{ FDEVENT_HANDLER_SOLARIS_DEVPOLL,"solaris-devpoll" },
#endif
-#ifdef USE_SOLARIS_PORT
- { FDEVENT_HANDLER_SOLARIS_PORT, "solaris-eventports" },
-#endif
#ifdef USE_FREEBSD_KQUEUE
{ FDEVENT_HANDLER_FREEBSD_KQUEUE, "freebsd-kqueue" },
#endif
{ FDEVENT_HANDLER_UNSET, NULL }
};
-
+
b = chunkqueue_get_append_buffer(con->write_queue);
-
- buffer_copy_string_len(b, CONST_STR_LEN(
+
+ BUFFER_COPY_STRING_CONST(b,
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n"
" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
@@ -714,53 +633,53 @@ static handler_t mod_status_handle_server_config(server *srv, connection *con, v
" <title>Status</title>\n"
" </head>\n"
" <body>\n"
- " <h1>" PACKAGE_DESC "</h1>\n"
- " <table summary=\"status\" border=\"1\">\n"));
-
+ " <h1>" PACKAGE_NAME " " PACKAGE_VERSION "</h1>\n"
+ " <table border=\"1\">\n");
+
mod_status_header_append(b, "Server-Features");
#ifdef HAVE_PCRE_H
- mod_status_row_append(b, "RegEx Conditionals", "enabled");
+ mod_status_row_append(b, "Rewrite Engine", "enabled");
#else
- mod_status_row_append(b, "RegEx Conditionals", "disabled - pcre missing");
+ mod_status_row_append(b, "Rewrite Engine", "disabled - pcre missing");
#endif
mod_status_header_append(b, "Network Engine");
-
+
for (i = 0; event_handlers[i].name; i++) {
if (event_handlers[i].et == srv->event_handler) {
mod_status_row_append(b, "fd-Event-Handler", event_handlers[i].name);
break;
}
}
-
+
mod_status_header_append(b, "Config-File-Settings");
-
+
for (i = 0; i < srv->plugins.used; i++) {
plugin **ps = srv->plugins.ptr;
-
+
plugin *pl = ps[i];
-
+
if (i == 0) {
buffer_copy_string_buffer(m, pl->name);
} else {
- buffer_append_string_len(m, CONST_STR_LEN("<br />"));
+ BUFFER_APPEND_STRING_CONST(m, "<br />");
buffer_append_string_buffer(m, pl->name);
}
}
-
+
mod_status_row_append(b, "Loaded Modules", m->ptr);
-
- buffer_append_string_len(b, CONST_STR_LEN(" </table>\n"));
-
- buffer_append_string_len(b, CONST_STR_LEN(
+
+ BUFFER_APPEND_STRING_CONST(b, " </table>\n");
+
+ BUFFER_APPEND_STRING_CONST(b,
" </body>\n"
"</html>\n"
- ));
-
+ );
+
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
-
+
con->http_status = 200;
con->file_finished = 1;
-
+
return HANDLER_FINISHED;
}
@@ -769,117 +688,108 @@ static handler_t mod_status_handle_server_config(server *srv, connection *con, v
static int mod_status_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(status_url);
PATCH(config_url);
PATCH(sort);
- PATCH(statistics_url);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("status.status-url"))) {
PATCH(status_url);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("status.config-url"))) {
PATCH(config_url);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("status.enable-sort"))) {
PATCH(sort);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("status.statistics-url"))) {
- PATCH(statistics_url);
- }
+ }
}
}
-
+
return 0;
}
static handler_t mod_status_handler(server *srv, connection *con, void *p_d) {
plugin_data *p = p_d;
-
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
+
mod_status_patch_connection(srv, con, p);
-
- if (!buffer_is_empty(p->conf.status_url) &&
+
+ if (!buffer_is_empty(p->conf.status_url) &&
buffer_is_equal(p->conf.status_url, con->uri.path)) {
return mod_status_handle_server_status(srv, con, p_d);
- } else if (!buffer_is_empty(p->conf.config_url) &&
+ } else if (!buffer_is_empty(p->conf.config_url) &&
buffer_is_equal(p->conf.config_url, con->uri.path)) {
return mod_status_handle_server_config(srv, con, p_d);
- } else if (!buffer_is_empty(p->conf.statistics_url) &&
- buffer_is_equal(p->conf.statistics_url, con->uri.path)) {
- return mod_status_handle_server_statistics(srv, con, p_d);
}
-
+
return HANDLER_GO_ON;
}
TRIGGER_FUNC(mod_status_trigger) {
plugin_data *p = p_d;
size_t i;
-
+
/* check all connections */
for (i = 0; i < srv->conns->used; i++) {
connection *c = srv->conns->ptr[i];
-
+
p->bytes_written += c->bytes_written_cur_second;
}
-
+
/* a sliding average */
p->mod_5s_traffic_out[p->mod_5s_ndx] = p->bytes_written;
p->mod_5s_requests [p->mod_5s_ndx] = p->requests;
-
+
p->mod_5s_ndx = (p->mod_5s_ndx+1) % 5;
-
+
p->abs_traffic_out += p->bytes_written;
p->rel_traffic_out += p->bytes_written;
-
+
p->bytes_written = 0;
-
+
/* reset storage - second */
p->traffic_out = 0;
p->requests = 0;
-
+
return HANDLER_GO_ON;
}
REQUESTDONE_FUNC(mod_status_account) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
p->requests++;
p->rel_requests++;
p->abs_requests++;
-
+
p->bytes_written += con->bytes_written_cur_second;
-
+
return HANDLER_GO_ON;
}
-int mod_status_plugin_init(plugin *p);
int mod_status_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("status");
-
+
p->init = mod_status_init;
p->cleanup = mod_status_free;
p->set_defaults= mod_status_set_defaults;
-
+
p->handle_uri_clean = mod_status_handler;
p->handle_trigger = mod_status_trigger;
p->handle_request_done = mod_status_account;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_trigger_b4_dl.c b/src/mod_trigger_b4_dl.c
index f813413..8281ec0 100644
--- a/src/mod_trigger_b4_dl.c
+++ b/src/mod_trigger_b4_dl.c
@@ -1,3 +1,7 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -6,37 +10,32 @@
#include "response.h"
#include "inet_ntop_cache.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <string.h>
-
#if defined(HAVE_GDBM_H)
-# include <gdbm.h>
+#include <gdbm.h>
#endif
#if defined(HAVE_PCRE_H)
-# include <pcre.h>
+#include <pcre.h>
#endif
#if defined(HAVE_MEMCACHE_H)
-# include <memcache.h>
+#include <memcache.h>
#endif
/**
* this is a trigger_b4_dl for a lighttpd plugin
- *
+ *
*/
/* plugin config for all request/connections */
typedef struct {
buffer *db_filename;
-
+
buffer *trigger_url;
buffer *download_url;
buffer *deny_url;
-
+
array *mc_hosts;
buffer *mc_namespace;
#if defined(HAVE_PCRE_H)
@@ -47,58 +46,58 @@ typedef struct {
GDBM_FILE db;
#endif
-#if defined(HAVE_MEMCACHE_H)
+#if defined(HAVE_MEMCACHE_H)
struct memcache *mc;
#endif
-
+
unsigned short trigger_timeout;
unsigned short debug;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
buffer *tmp_buf;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
/* init the plugin data */
INIT_FUNC(mod_trigger_b4_dl_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->tmp_buf = buffer_init();
-
+
return p;
}
/* detroy the plugin data */
FREE_FUNC(mod_trigger_b4_dl_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
-
+
buffer_free(s->db_filename);
buffer_free(s->download_url);
buffer_free(s->trigger_url);
buffer_free(s->deny_url);
-
+
buffer_free(s->mc_namespace);
array_free(s->mc_hosts);
-
+
#if defined(HAVE_PCRE_H)
if (s->trigger_regex) pcre_free(s->trigger_regex);
if (s->download_regex) pcre_free(s->download_regex);
@@ -109,16 +108,16 @@ FREE_FUNC(mod_trigger_b4_dl_free) {
#if defined(HAVE_MEMCACHE_H)
if (s->mc) mc_free(s->mc);
#endif
-
+
free(s);
}
free(p->config_storage);
}
-
+
buffer_free(p->tmp_buf);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -127,9 +126,9 @@ FREE_FUNC(mod_trigger_b4_dl_free) {
SETDEFAULTS_FUNC(mod_trigger_b4_dl_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
-
- config_values_t cv[] = {
+
+
+ config_values_t cv[] = {
{ "trigger-before-download.gdbm-filename", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "trigger-before-download.trigger-url", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ "trigger-before-download.download-url", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
@@ -140,18 +139,18 @@ SETDEFAULTS_FUNC(mod_trigger_b4_dl_set_defaults) {
{ "trigger-before-download.debug", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
#if defined(HAVE_PCRE_H)
const char *errptr;
int erroff;
#endif
-
+
s = calloc(1, sizeof(plugin_config));
s->db_filename = buffer_init();
s->download_url = buffer_init();
@@ -159,7 +158,7 @@ SETDEFAULTS_FUNC(mod_trigger_b4_dl_set_defaults) {
s->deny_url = buffer_init();
s->mc_hosts = array_init();
s->mc_namespace = buffer_init();
-
+
cv[0].destination = s->db_filename;
cv[1].destination = s->trigger_url;
cv[2].destination = s->download_url;
@@ -168,44 +167,41 @@ SETDEFAULTS_FUNC(mod_trigger_b4_dl_set_defaults) {
cv[5].destination = s->mc_hosts;
cv[6].destination = s->mc_namespace;
cv[7].destination = &(s->debug);
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
#if defined(HAVE_GDBM_H)
if (!buffer_is_empty(s->db_filename)) {
if (NULL == (s->db = gdbm_open(s->db_filename->ptr, 4096, GDBM_WRCREAT | GDBM_NOLOCK, S_IRUSR | S_IWUSR, 0))) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"gdbm-open failed");
return HANDLER_ERROR;
}
-#ifdef FD_CLOEXEC
- fcntl(gdbm_fdesc(s->db), F_SETFD, FD_CLOEXEC);
-#endif
}
#endif
-#if defined(HAVE_PCRE_H)
+#if defined(HAVE_PCRE_H)
if (!buffer_is_empty(s->download_url)) {
if (NULL == (s->download_regex = pcre_compile(s->download_url->ptr,
0, &errptr, &erroff, NULL))) {
-
- log_error_write(srv, __FILE__, __LINE__, "sbss",
- "compiling regex for download-url failed:",
+
+ log_error_write(srv, __FILE__, __LINE__, "sbss",
+ "compiling regex for download-url failed:",
s->download_url, "pos:", erroff);
return HANDLER_ERROR;
}
}
-
+
if (!buffer_is_empty(s->trigger_url)) {
if (NULL == (s->trigger_regex = pcre_compile(s->trigger_url->ptr,
0, &errptr, &erroff, NULL))) {
-
- log_error_write(srv, __FILE__, __LINE__, "sbss",
- "compiling regex for trigger-url failed:",
+
+ log_error_write(srv, __FILE__, __LINE__, "sbss",
+ "compiling regex for trigger-url failed:",
s->trigger_url, "pos:", erroff);
-
+
return HANDLER_ERROR;
}
}
@@ -215,33 +211,33 @@ SETDEFAULTS_FUNC(mod_trigger_b4_dl_set_defaults) {
#if defined(HAVE_MEMCACHE_H)
size_t k;
s->mc = mc_new();
-
+
for (k = 0; k < s->mc_hosts->used; k++) {
data_string *ds = (data_string *)s->mc_hosts->data[k];
-
+
if (0 != mc_server_add4(s->mc, ds->value->ptr)) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "connection to host failed:",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "connection to host failed:",
ds->value);
-
+
return HANDLER_ERROR;
}
}
#else
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"memcache support is not compiled in but trigger-before-download.memcache-hosts is set, aborting");
return HANDLER_ERROR;
#endif
}
-
+
#if (!defined(HAVE_GDBM_H) && !defined(HAVE_MEMCACHE_H)) || !defined(HAVE_PCRE_H)
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"(either gdbm or libmemcache) and pcre are require, but were not found, aborting");
return HANDLER_ERROR;
#endif
}
-
+
return HANDLER_GO_ON;
}
@@ -250,14 +246,14 @@ SETDEFAULTS_FUNC(mod_trigger_b4_dl_set_defaults) {
static int mod_trigger_b4_dl_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
#if defined(HAVE_GDBM)
PATCH(db);
-#endif
+#endif
#if defined(HAVE_PCRE_H)
PATCH(download_regex);
PATCH(trigger_regex);
-#endif
+#endif
PATCH(trigger_timeout);
PATCH(deny_url);
PATCH(mc_namespace);
@@ -265,15 +261,15 @@ static int mod_trigger_b4_dl_patch_connection(server *srv, connection *con, plug
#if defined(HAVE_MEMCACHE_H)
PATCH(mc);
#endif
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
@@ -305,7 +301,7 @@ static int mod_trigger_b4_dl_patch_connection(server *srv, connection *con, plug
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -319,22 +315,20 @@ URIHANDLER_FUNC(mod_trigger_b4_dl_uri_handler) {
int n;
# define N 10
int ovec[N * 3];
-
- if (con->mode != DIRECT) return HANDLER_GO_ON;
-
+
if (con->uri.path->used == 0) return HANDLER_GO_ON;
-
+
mod_trigger_b4_dl_patch_connection(srv, con, p);
-
+
if (!p->conf.trigger_regex || !p->conf.download_regex) return HANDLER_GO_ON;
-
+
# if !defined(HAVE_GDBM_H) && !defined(HAVE_MEMCACHE_H)
return HANDLER_GO_ON;
# elif defined(HAVE_GDBM_H) && defined(HAVE_MEMCACHE_H)
if (!p->conf.db && !p->conf.mc) return HANDLER_GO_ON;
if (p->conf.db && p->conf.mc) {
/* can't decide which one */
-
+
return HANDLER_GO_ON;
}
# elif defined(HAVE_GDBM_H)
@@ -342,12 +336,12 @@ URIHANDLER_FUNC(mod_trigger_b4_dl_uri_handler) {
# else
if (!p->conf.mc) return HANDLER_GO_ON;
# endif
-
+
if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "X-Forwarded-For"))) {
/* X-Forwarded-For contains the ip behind the proxy */
-
+
remote_ip = ds->value->ptr;
-
+
/* memcache can't handle spaces */
} else {
remote_ip = inet_ntop_cache_get_ip(srv, &(con->dst_addr));
@@ -356,13 +350,13 @@ URIHANDLER_FUNC(mod_trigger_b4_dl_uri_handler) {
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "ss", "(debug) remote-ip:", remote_ip);
}
-
+
/* check if URL is a trigger -> insert IP into DB */
if ((n = pcre_exec(p->conf.trigger_regex, NULL, con->uri.path->ptr, con->uri.path->used - 1, 0, 0, ovec, 3 * N)) < 0) {
if (n != PCRE_ERROR_NOMATCH) {
log_error_write(srv, __FILE__, __LINE__, "sd",
"execution error while matching:", n);
-
+
return HANDLER_ERROR;
}
} else {
@@ -370,34 +364,34 @@ URIHANDLER_FUNC(mod_trigger_b4_dl_uri_handler) {
if (p->conf.db) {
/* the trigger matched */
datum key, val;
-
+
key.dptr = (char *)remote_ip;
key.dsize = strlen(remote_ip);
-
+
val.dptr = (char *)&(srv->cur_ts);
val.dsize = sizeof(srv->cur_ts);
-
+
if (0 != gdbm_store(p->conf.db, key, val, GDBM_REPLACE)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"insert failed");
}
}
# endif
-# if defined(HAVE_MEMCACHE_H)
+# if defined(HAVE_MEMCACHE_H)
if (p->conf.mc) {
size_t i;
buffer_copy_string_buffer(p->tmp_buf, p->conf.mc_namespace);
buffer_append_string(p->tmp_buf, remote_ip);
-
+
for (i = 0; i < p->tmp_buf->used - 1; i++) {
if (p->tmp_buf->ptr[i] == ' ') p->tmp_buf->ptr[i] = '-';
}
-
+
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "sb", "(debug) triggered IP:", p->tmp_buf);
}
- if (0 != mc_set(p->conf.mc,
+ if (0 != mc_set(p->conf.mc,
CONST_BUF_LEN(p->tmp_buf),
(char *)&(srv->cur_ts), sizeof(srv->cur_ts),
p->conf.trigger_timeout, 0)) {
@@ -407,7 +401,7 @@ URIHANDLER_FUNC(mod_trigger_b4_dl_uri_handler) {
}
# endif
}
-
+
/* check if URL is a download -> check IP in DB, update timestamp */
if ((n = pcre_exec(p->conf.download_regex, NULL, con->uri.path->ptr, con->uri.path->used - 1, 0, 0, ovec, 3 * N)) < 0) {
if (n != PCRE_ERROR_NOMATCH) {
@@ -417,95 +411,93 @@ URIHANDLER_FUNC(mod_trigger_b4_dl_uri_handler) {
}
} else {
/* the download uri matched */
-# if defined(HAVE_GDBM_H)
+# if defined(HAVE_GDBM_H)
if (p->conf.db) {
datum key, val;
time_t last_hit;
-
+
key.dptr = (char *)remote_ip;
key.dsize = strlen(remote_ip);
-
+
val = gdbm_fetch(p->conf.db, key);
-
+
if (val.dptr == NULL) {
/* not found, redirect */
-
+
response_header_insert(srv, con, CONST_STR_LEN("Location"), CONST_BUF_LEN(p->conf.deny_url));
+
con->http_status = 307;
- con->file_finished = 1;
-
+
return HANDLER_FINISHED;
}
-
+
last_hit = *(time_t *)(val.dptr);
-
+
free(val.dptr);
-
+
if (srv->cur_ts - last_hit > p->conf.trigger_timeout) {
/* found, but timeout, redirect */
-
+
response_header_insert(srv, con, CONST_STR_LEN("Location"), CONST_BUF_LEN(p->conf.deny_url));
con->http_status = 307;
- con->file_finished = 1;
-
+
if (p->conf.db) {
if (0 != gdbm_delete(p->conf.db, key)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"delete failed");
}
}
-
+
return HANDLER_FINISHED;
}
-
+
val.dptr = (char *)&(srv->cur_ts);
val.dsize = sizeof(srv->cur_ts);
-
+
if (0 != gdbm_store(p->conf.db, key, val, GDBM_REPLACE)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"insert failed");
}
}
# endif
-
-# if defined(HAVE_MEMCACHE_H)
+
+# if defined(HAVE_MEMCACHE_H)
if (p->conf.mc) {
void *r;
size_t i;
-
+
buffer_copy_string_buffer(p->tmp_buf, p->conf.mc_namespace);
buffer_append_string(p->tmp_buf, remote_ip);
-
+
for (i = 0; i < p->tmp_buf->used - 1; i++) {
if (p->tmp_buf->ptr[i] == ' ') p->tmp_buf->ptr[i] = '-';
}
-
+
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "sb", "(debug) checking IP:", p->tmp_buf);
}
/**
- *
+ *
* memcached is do expiration for us, as long as we can fetch it every thing is ok
- * and the timestamp is updated
- *
+ * and the timestamp is updated
+ *
*/
- if (NULL == (r = mc_aget(p->conf.mc,
+ if (NULL == (r = mc_aget(p->conf.mc,
CONST_BUF_LEN(p->tmp_buf)
))) {
-
+
response_header_insert(srv, con, CONST_STR_LEN("Location"), CONST_BUF_LEN(p->conf.deny_url));
-
+
con->http_status = 307;
- con->file_finished = 1;
-
+
return HANDLER_FINISHED;
}
-
+
free(r);
-
+
/* set a new timeout */
- if (0 != mc_set(p->conf.mc,
+ if (0 != mc_set(p->conf.mc,
CONST_BUF_LEN(p->tmp_buf),
(char *)&(srv->cur_ts), sizeof(srv->cur_ts),
p->conf.trigger_timeout, 0)) {
@@ -515,13 +507,13 @@ URIHANDLER_FUNC(mod_trigger_b4_dl_uri_handler) {
}
# endif
}
-
+
#else
UNUSED(srv);
UNUSED(con);
UNUSED(p_d);
#endif
-
+
return HANDLER_GO_ON;
}
@@ -529,21 +521,21 @@ URIHANDLER_FUNC(mod_trigger_b4_dl_uri_handler) {
TRIGGER_FUNC(mod_trigger_b4_dl_handle_trigger) {
plugin_data *p = p_d;
size_t i;
-
+
/* check DB each minute */
if (srv->cur_ts % 60 != 0) return HANDLER_GO_ON;
-
+
/* cleanup */
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
datum key, val, okey;
-
+
if (!s->db) continue;
-
+
okey.dptr = NULL;
-
- /* according to the manual this loop + delete does delete all entries on its way
- *
+
+ /* according to the manual this loop + delete does delete all entries on its way
+ *
* we don't care as the next round will remove them. We don't have to perfect here.
*/
for (key = gdbm_firstkey(s->db); key.dptr; key = gdbm_nextkey(s->db, okey)) {
@@ -552,21 +544,21 @@ TRIGGER_FUNC(mod_trigger_b4_dl_handle_trigger) {
free(okey.dptr);
okey.dptr = NULL;
}
-
+
val = gdbm_fetch(s->db, key);
-
+
last_hit = *(time_t *)(val.dptr);
-
+
free(val.dptr);
-
+
if (srv->cur_ts - last_hit > s->trigger_timeout) {
gdbm_delete(s->db, key);
}
-
+
okey = key;
}
if (okey.dptr) free(okey.dptr);
-
+
/* reorg once a day */
if ((srv->cur_ts % (60 * 60 * 24) != 0)) gdbm_reorganize(s->db);
}
@@ -576,11 +568,10 @@ TRIGGER_FUNC(mod_trigger_b4_dl_handle_trigger) {
/* this function is called at dlopen() time and inits the callbacks */
-int mod_trigger_b4_dl_plugin_init(plugin *p);
int mod_trigger_b4_dl_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("trigger_b4_dl");
-
+
p->init = mod_trigger_b4_dl_init;
p->handle_uri_clean = mod_trigger_b4_dl_uri_handler;
p->set_defaults = mod_trigger_b4_dl_set_defaults;
@@ -588,8 +579,8 @@ int mod_trigger_b4_dl_plugin_init(plugin *p) {
p->handle_trigger = mod_trigger_b4_dl_handle_trigger;
#endif
p->cleanup = mod_trigger_b4_dl_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_userdir.c b/src/mod_userdir.c
index 4a1967f..9612fa8 100644
--- a/src/mod_userdir.c
+++ b/src/mod_userdir.c
@@ -1,3 +1,8 @@
+#include <sys/types.h>
+
+#include <stdlib.h>
+#include <string.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -6,13 +11,8 @@
#include "plugin.h"
-#include <sys/types.h>
-
-#include <stdlib.h>
-#include <string.h>
-
#ifdef HAVE_PWD_H
-# include <pwd.h>
+#include <pwd.h>
#endif
/* plugin config for all request/connections */
@@ -21,59 +21,58 @@ typedef struct {
array *include_user;
buffer *path;
buffer *basepath;
- unsigned short letterhomes;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
buffer *username;
buffer *temp_path;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
/* init the plugin data */
INIT_FUNC(mod_userdir_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->username = buffer_init();
p->temp_path = buffer_init();
-
+
return p;
}
/* detroy the plugin data */
FREE_FUNC(mod_userdir_free) {
plugin_data *p = p_d;
-
+
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
array_free(s->include_user);
array_free(s->exclude_user);
buffer_free(s->path);
buffer_free(s->basepath);
-
+
free(s);
}
free(p->config_storage);
}
-
+
buffer_free(p->username);
buffer_free(p->temp_path);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -82,43 +81,40 @@ FREE_FUNC(mod_userdir_free) {
SETDEFAULTS_FUNC(mod_userdir_set_defaults) {
plugin_data *p = p_d;
size_t i;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "userdir.path", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "userdir.exclude-user", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ "userdir.include-user", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
{ "userdir.basepath", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
- { "userdir.letterhomes", NULL, T_CONFIG_BOOLEAN,T_CONFIG_SCOPE_CONNECTION }, /* 4 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->exclude_user = array_init();
s->include_user = array_init();
s->path = buffer_init();
s->basepath = buffer_init();
- s->letterhomes = 0;
-
+
cv[0].destination = s->path;
cv[1].destination = s->exclude_user;
cv[2].destination = s->include_user;
cv[3].destination = s->basepath;
- cv[4].destination = &(s->letterhomes);
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
}
-
+
return HANDLER_GO_ON;
}
@@ -127,25 +123,24 @@ SETDEFAULTS_FUNC(mod_userdir_set_defaults) {
static int mod_userdir_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(path);
PATCH(exclude_user);
PATCH(include_user);
PATCH(basepath);
- PATCH(letterhomes);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("userdir.path"))) {
PATCH(path);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("userdir.exclude-user"))) {
@@ -154,18 +149,17 @@ static int mod_userdir_patch_connection(server *srv, connection *con, plugin_dat
PATCH(include_user);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("userdir.basepath"))) {
PATCH(basepath);
- } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("userdir.letterhomes"))) {
- PATCH(letterhomes);
}
}
}
-
+
return 0;
}
#undef PATCH
URIHANDLER_FUNC(mod_userdir_docroot_handler) {
plugin_data *p = p_d;
+ int uri_len;
size_t k;
char *rel_url;
#ifdef HAVE_PWD_H
@@ -175,21 +169,18 @@ URIHANDLER_FUNC(mod_userdir_docroot_handler) {
if (con->uri.path->used == 0) return HANDLER_GO_ON;
mod_userdir_patch_connection(srv, con, p);
-
- /* enforce the userdir.path to be set in the config, ugly fix for #1587;
- * should be replaced with a clean .enabled option in 1.5
- */
- if (p->conf.path->used == 0) return HANDLER_GO_ON;
-
+
+ uri_len = con->uri.path->used - 1;
+
/* /~user/foo.html -> /home/user/public_html/foo.html */
-
+
if (con->uri.path->ptr[0] != '/' ||
con->uri.path->ptr[1] != '~') return HANDLER_GO_ON;
-
+
if (NULL == (rel_url = strchr(con->uri.path->ptr + 2, '/'))) {
/* / is missing -> redirect to .../ as we are a user - DIRECTORY ! :) */
http_response_redirect_to_directory(srv, con);
-
+
return HANDLER_FINISHED;
}
@@ -197,10 +188,10 @@ URIHANDLER_FUNC(mod_userdir_docroot_handler) {
if (0 == rel_url - (con->uri.path->ptr + 2)) {
return HANDLER_GO_ON;
}
-
+
buffer_copy_string_len(p->username, con->uri.path->ptr + 2, rel_url - (con->uri.path->ptr + 2));
-
- if (buffer_is_empty(p->conf.basepath)
+
+ if (buffer_is_empty(p->conf.basepath)
#ifdef HAVE_PWD_H
&& NULL == (pwd = getpwnam(p->username->ptr))
#endif
@@ -209,31 +200,31 @@ URIHANDLER_FUNC(mod_userdir_docroot_handler) {
return HANDLER_GO_ON;
}
-
+
for (k = 0; k < p->conf.exclude_user->used; k++) {
data_string *ds = (data_string *)p->conf.exclude_user->data[k];
-
+
if (buffer_is_equal(ds->value, p->username)) {
/* user in exclude list */
return HANDLER_GO_ON;
}
}
-
+
if (p->conf.include_user->used) {
int found_user = 0;
for (k = 0; k < p->conf.include_user->used; k++) {
data_string *ds = (data_string *)p->conf.include_user->data[k];
-
+
if (buffer_is_equal(ds->value, p->username)) {
/* user in include list */
found_user = 1;
break;
}
}
-
+
if (!found_user) return HANDLER_GO_ON;
}
-
+
/* we build the physical path */
if (buffer_is_empty(p->conf.basepath)) {
@@ -259,49 +250,26 @@ URIHANDLER_FUNC(mod_userdir_docroot_handler) {
return HANDLER_GO_ON;
}
}
- if (con->conf.force_lowercase_filenames) {
- buffer_to_lower(p->username);
- }
buffer_copy_string_buffer(p->temp_path, p->conf.basepath);
BUFFER_APPEND_SLASH(p->temp_path);
- if (p->conf.letterhomes) {
- buffer_append_string_len(p->temp_path, p->username->ptr, 1);
- BUFFER_APPEND_SLASH(p->temp_path);
- }
buffer_append_string_buffer(p->temp_path, p->username);
}
BUFFER_APPEND_SLASH(p->temp_path);
- buffer_append_string_buffer(p->temp_path, p->conf.path);
+ buffer_append_string_buffer(p->temp_path, p->conf.path);
if (buffer_is_empty(p->conf.basepath)) {
struct stat st;
int ret;
-
+
ret = stat(p->temp_path->ptr, &st);
if (ret < 0 || S_ISDIR(st.st_mode) != 1) {
return HANDLER_GO_ON;
- }
+ }
}
- /* the physical rel_path is basically the same as uri.path;
- * but it is converted to lowercase in case of force_lowercase_filenames and some special handling
- * for trailing '.', ' ' and '/' on windows
- * we assume that no docroot/physical handler changed this
- * (docroot should only set the docroot/server name, phyiscal should only change the phyiscal.path;
- * the exception mod_secure_download doesn't work with userdir anyway)
- */
BUFFER_APPEND_SLASH(p->temp_path);
- /* if no second '/' is found, we assume that it was stripped from the uri.path for the special handling
- * on windows.
- * we do not care about the trailing slash here on windows, as we already ensured it is a directory
- *
- * TODO: what to do with trailing dots in usernames on windows? they may result in the same directory
- * as a username without them.
- */
- if (NULL != (rel_url = strchr(con->physical.rel_path->ptr + 2, '/'))) {
- buffer_append_string(p->temp_path, rel_url + 1); /* skip the / */
- }
+ buffer_append_string(p->temp_path, rel_url + 1); /* skip the / */
buffer_copy_string_buffer(con->physical.path, p->temp_path);
buffer_reset(p->temp_path);
@@ -311,17 +279,16 @@ URIHANDLER_FUNC(mod_userdir_docroot_handler) {
/* this function is called at dlopen() time and inits the callbacks */
-int mod_userdir_plugin_init(plugin *p);
int mod_userdir_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("userdir");
-
+
p->init = mod_userdir_init;
p->handle_physical = mod_userdir_docroot_handler;
p->set_defaults = mod_userdir_set_defaults;
p->cleanup = mod_userdir_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_usertrack.c b/src/mod_usertrack.c
index 9ecabdc..25fb8ec 100644
--- a/src/mod_usertrack.c
+++ b/src/mod_usertrack.c
@@ -1,63 +1,67 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "base.h"
#include "log.h"
#include "buffer.h"
#include "plugin.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "md5.h"
+#ifdef USE_OPENSSL
+# include <openssl/md5.h>
+#else
+# include "md5.h"
+#endif
/* plugin config for all request/connections */
typedef struct {
buffer *cookie_name;
buffer *cookie_domain;
- unsigned int cookie_max_age;
+ unsigned short cookie_max_age;
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
/* init the plugin data */
INIT_FUNC(mod_usertrack_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
return p;
}
/* detroy the plugin data */
FREE_FUNC(mod_usertrack_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
-
+
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
-
+
buffer_free(s->cookie_name);
buffer_free(s->cookie_domain);
-
+
free(s);
}
free(p->config_storage);
}
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -66,69 +70,69 @@ FREE_FUNC(mod_usertrack_free) {
SETDEFAULTS_FUNC(mod_usertrack_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "usertrack.cookie-name", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { "usertrack.cookie-max-age", NULL, T_CONFIG_INT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
+ { "usertrack.cookie-max-age", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ "usertrack.cookie-domain", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
-
- { "usertrack.cookiename", NULL, T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_CONNECTION },
+
+ { "usertrack.cookiename", NULL, T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_CONNECTION },
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->cookie_name = buffer_init();
s->cookie_domain = buffer_init();
s->cookie_max_age = 0;
-
+
cv[0].destination = s->cookie_name;
cv[1].destination = &(s->cookie_max_age);
cv[2].destination = s->cookie_domain;
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
-
+
if (buffer_is_empty(s->cookie_name)) {
- buffer_copy_string_len(s->cookie_name, CONST_STR_LEN("TRACKID"));
+ buffer_copy_string(s->cookie_name, "TRACKID");
} else {
size_t j;
for (j = 0; j < s->cookie_name->used - 1; j++) {
char c = s->cookie_name->ptr[j] | 32;
if (c < 'a' || c > 'z') {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "invalid character in usertrack.cookie-name:",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "invalid character in usertrack.cookie-name:",
s->cookie_name);
-
+
return HANDLER_ERROR;
}
}
}
-
+
if (!buffer_is_empty(s->cookie_domain)) {
size_t j;
for (j = 0; j < s->cookie_domain->used - 1; j++) {
char c = s->cookie_domain->ptr[j];
if (c <= 32 || c >= 127 || c == '"' || c == '\\') {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "invalid character in usertrack.cookie-domain:",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "invalid character in usertrack.cookie-domain:",
s->cookie_domain);
-
+
return HANDLER_ERROR;
}
}
}
}
-
+
return HANDLER_GO_ON;
}
@@ -137,23 +141,23 @@ SETDEFAULTS_FUNC(mod_usertrack_set_defaults) {
static int mod_usertrack_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
+
PATCH(cookie_name);
PATCH(cookie_domain);
PATCH(cookie_max_age);
-
+
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("usertrack.cookie-name"))) {
PATCH(cookie_name);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("usertrack.cookie-max-age"))) {
@@ -163,7 +167,7 @@ static int mod_usertrack_patch_connection(server *srv, connection *con, plugin_d
}
}
}
-
+
return 0;
}
#undef PATCH
@@ -172,97 +176,96 @@ URIHANDLER_FUNC(mod_usertrack_uri_handler) {
plugin_data *p = p_d;
data_string *ds;
unsigned char h[16];
- li_MD5_CTX Md5Ctx;
+ MD5_CTX Md5Ctx;
char hh[32];
-
+
if (con->uri.path->used == 0) return HANDLER_GO_ON;
-
+
mod_usertrack_patch_connection(srv, con, p);
-
+
if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Cookie"))) {
char *g;
/* we have a cookie, does it contain a valid name ? */
-
- /* parse the cookie
- *
+
+ /* parse the cookie
+ *
* check for cookiename + (WS | '=')
- *
+ *
*/
-
+
if (NULL != (g = strstr(ds->value->ptr, p->conf.cookie_name->ptr))) {
char *nc;
-
+
/* skip WS */
for (nc = g + p->conf.cookie_name->used-1; *nc == ' ' || *nc == '\t'; nc++);
-
+
if (*nc == '=') {
/* ok, found the key of our own cookie */
-
+
if (strlen(nc) > 32) {
/* i'm lazy */
return HANDLER_GO_ON;
}
}
}
- }
-
+ }
+
/* set a cookie */
if (NULL == (ds = (data_string *)array_get_unused_element(con->response.headers, TYPE_STRING))) {
ds = data_response_init();
}
- buffer_copy_string_len(ds->key, CONST_STR_LEN("Set-Cookie"));
+ buffer_copy_string(ds->key, "Set-Cookie");
buffer_copy_string_buffer(ds->value, p->conf.cookie_name);
- buffer_append_string_len(ds->value, CONST_STR_LEN("="));
-
+ buffer_append_string(ds->value, "=\"");
+
/* taken from mod_auth.c */
-
+
/* generate shared-secret */
- li_MD5_Init(&Md5Ctx);
- li_MD5_Update(&Md5Ctx, (unsigned char *)con->uri.path->ptr, con->uri.path->used - 1);
- li_MD5_Update(&Md5Ctx, (unsigned char *)"+", 1);
-
+ MD5_Init(&Md5Ctx);
+ MD5_Update(&Md5Ctx, (unsigned char *)con->uri.path->ptr, con->uri.path->used - 1);
+ MD5_Update(&Md5Ctx, (unsigned char *)"+", 1);
+
/* we assume sizeof(time_t) == 4 here, but if not it ain't a problem at all */
- LI_ltostr(hh, srv->cur_ts);
- li_MD5_Update(&Md5Ctx, (unsigned char *)hh, strlen(hh));
- li_MD5_Update(&Md5Ctx, (unsigned char *)srv->entropy, sizeof(srv->entropy));
- LI_ltostr(hh, rand());
- li_MD5_Update(&Md5Ctx, (unsigned char *)hh, strlen(hh));
-
- li_MD5_Final(h, &Md5Ctx);
-
+ ltostr(hh, srv->cur_ts);
+ MD5_Update(&Md5Ctx, (unsigned char *)hh, strlen(hh));
+ ltostr(hh, rand());
+ MD5_Update(&Md5Ctx, (unsigned char *)hh, strlen(hh));
+
+ MD5_Final(h, &Md5Ctx);
+
buffer_append_string_encoded(ds->value, (char *)h, 16, ENCODING_HEX);
- buffer_append_string_len(ds->value, CONST_STR_LEN("; Path=/"));
- buffer_append_string_len(ds->value, CONST_STR_LEN("; Version=1"));
-
+ buffer_append_string(ds->value, "\"; Path=\"/\"");
+ buffer_append_string(ds->value, "; Version=\"1\"");
+
if (!buffer_is_empty(p->conf.cookie_domain)) {
- buffer_append_string_len(ds->value, CONST_STR_LEN("; Domain="));
- buffer_append_string_encoded(ds->value, CONST_BUF_LEN(p->conf.cookie_domain), ENCODING_REL_URI);
+ buffer_append_string(ds->value, "; Domain=\"");
+ buffer_append_string_buffer(ds->value, p->conf.cookie_domain);
+ buffer_append_string(ds->value, "\"");
}
-
+
if (p->conf.cookie_max_age) {
- buffer_append_string_len(ds->value, CONST_STR_LEN("; max-age="));
+ buffer_append_string(ds->value, "; max-age=");
buffer_append_long(ds->value, p->conf.cookie_max_age);
}
-
+
array_insert_unique(con->response.headers, (data_unset *)ds);
-
+
return HANDLER_GO_ON;
}
/* this function is called at dlopen() time and inits the callbacks */
-int mod_usertrack_plugin_init(plugin *p);
int mod_usertrack_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("usertrack");
-
+
p->init = mod_usertrack_init;
p->handle_uri_clean = mod_usertrack_uri_handler;
p->set_defaults = mod_usertrack_set_defaults;
p->cleanup = mod_usertrack_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/mod_webdav.c b/src/mod_webdav.c
index 4b11996..0e7a682 100644
--- a/src/mod_webdav.c
+++ b/src/mod_webdav.c
@@ -1,27 +1,19 @@
-#include "base.h"
-#include "log.h"
-#include "buffer.h"
-#include "response.h"
-
-#include "plugin.h"
-
-#include "stream.h"
-#include "stat_cache.h"
-
-#include "sys-mmap.h"
-
#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
+#include <dirent.h>
#include <errno.h>
+#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <assert.h>
+#include <sys/mman.h>
-#include <unistd.h>
-#include <dirent.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#if defined(HAVE_LIBXML_H) && defined(HAVE_SQLITE3_H)
#define USE_PROPPATCH
@@ -31,21 +23,26 @@
#include <sqlite3.h>
#endif
-#if defined(HAVE_LIBXML_H) && defined(HAVE_SQLITE3_H) && defined(HAVE_UUID_UUID_H)
-#define USE_LOCKS
-#include <uuid/uuid.h>
-#endif
+#include "base.h"
+#include "log.h"
+#include "buffer.h"
+#include "response.h"
+
+#include "plugin.h"
+
+#include "stream.h"
+#include "stat_cache.h"
+
/**
* this is a webdav for a lighttpd plugin
*
- * at least a very basic one.
+ * at least a very basic one.
* - for now it is read-only and we only support PROPFIND
- *
+ *
*/
-#define WEBDAV_FILE_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH
-#define WEBDAV_DIR_MODE S_IRWXU | S_IRWXG | S_IRWXO
+
/* plugin config for all request/connections */
@@ -61,70 +58,64 @@ typedef struct {
sqlite3_stmt *stmt_delete_prop;
sqlite3_stmt *stmt_select_prop;
sqlite3_stmt *stmt_select_propnames;
-
+
sqlite3_stmt *stmt_delete_uri;
sqlite3_stmt *stmt_move_uri;
sqlite3_stmt *stmt_copy_uri;
-
- sqlite3_stmt *stmt_remove_lock;
- sqlite3_stmt *stmt_create_lock;
- sqlite3_stmt *stmt_read_lock;
- sqlite3_stmt *stmt_read_lock_by_uri;
- sqlite3_stmt *stmt_refresh_lock;
#endif
} plugin_config;
typedef struct {
PLUGIN_DATA;
-
+
buffer *tmp_buf;
request_uri uri;
physical physical;
plugin_config **config_storage;
-
- plugin_config conf;
+
+ plugin_config conf;
} plugin_data;
/* init the plugin data */
INIT_FUNC(mod_webdav_init) {
plugin_data *p;
-
+
p = calloc(1, sizeof(*p));
-
+
p->tmp_buf = buffer_init();
p->uri.scheme = buffer_init();
p->uri.path_raw = buffer_init();
p->uri.path = buffer_init();
p->uri.authority = buffer_init();
-
+
p->physical.path = buffer_init();
p->physical.rel_path = buffer_init();
p->physical.doc_root = buffer_init();
p->physical.basedir = buffer_init();
-
+
return p;
}
/* detroy the plugin data */
FREE_FUNC(mod_webdav_free) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (!p) return HANDLER_GO_ON;
-
+
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if (!s) continue;
-
+
buffer_free(s->sqlite_db_name);
#ifdef USE_PROPPATCH
- if (s->sql) {
+ if (s->sql) {
sqlite3_finalize(s->stmt_delete_prop);
sqlite3_finalize(s->stmt_delete_uri);
sqlite3_finalize(s->stmt_copy_uri);
@@ -132,15 +123,9 @@ FREE_FUNC(mod_webdav_free) {
sqlite3_finalize(s->stmt_update_prop);
sqlite3_finalize(s->stmt_select_prop);
sqlite3_finalize(s->stmt_select_propnames);
-
- sqlite3_finalize(s->stmt_read_lock);
- sqlite3_finalize(s->stmt_read_lock_by_uri);
- sqlite3_finalize(s->stmt_create_lock);
- sqlite3_finalize(s->stmt_remove_lock);
- sqlite3_finalize(s->stmt_refresh_lock);
sqlite3_close(s->sql);
}
-#endif
+#endif
free(s);
}
free(p->config_storage);
@@ -150,16 +135,16 @@ FREE_FUNC(mod_webdav_free) {
buffer_free(p->uri.path_raw);
buffer_free(p->uri.path);
buffer_free(p->uri.authority);
-
+
buffer_free(p->physical.path);
buffer_free(p->physical.rel_path);
buffer_free(p->physical.doc_root);
buffer_free(p->physical.basedir);
-
+
buffer_free(p->tmp_buf);
-
+
free(p);
-
+
return HANDLER_GO_ON;
}
@@ -168,32 +153,32 @@ FREE_FUNC(mod_webdav_free) {
SETDEFAULTS_FUNC(mod_webdav_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
-
- config_values_t cv[] = {
+
+ config_values_t cv[] = {
{ "webdav.activate", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "webdav.is-readonly", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ "webdav.sqlite-db-name", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
{ "webdav.log-xml", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
+
if (!p) return HANDLER_ERROR;
-
+
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
-
+
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
-
+
s = calloc(1, sizeof(plugin_config));
s->sqlite_db_name = buffer_init();
-
+
cv[0].destination = &(s->enabled);
cv[1].destination = &(s->is_readonly);
cv[2].destination = s->sqlite_db_name;
cv[3].destination = &(s->log_xml);
-
+
p->config_storage[i] = s;
-
+
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
return HANDLER_ERROR;
}
@@ -204,32 +189,12 @@ SETDEFAULTS_FUNC(mod_webdav_set_defaults) {
char *err;
if (SQLITE_OK != sqlite3_open(s->sqlite_db_name->ptr, &(s->sql))) {
- log_error_write(srv, __FILE__, __LINE__, "sbs", "sqlite3_open failed for",
- s->sqlite_db_name,
- sqlite3_errmsg(s->sql));
+ log_error_write(srv, __FILE__, __LINE__, "s", "sqlite3_open failed");
return HANDLER_ERROR;
}
- if (SQLITE_OK != sqlite3_exec(s->sql,
- "CREATE TABLE properties ("
- " resource TEXT NOT NULL,"
- " prop TEXT NOT NULL,"
- " ns TEXT NOT NULL,"
- " value TEXT NOT NULL,"
- " PRIMARY KEY(resource, prop, ns))",
- NULL, NULL, &err)) {
-
- if (0 != strcmp(err, "table properties already exists")) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "can't open transaction:", err);
- sqlite3_free(err);
-
- return HANDLER_ERROR;
- }
- sqlite3_free(err);
- }
-
- if (SQLITE_OK != sqlite3_prepare(s->sql,
- CONST_STR_LEN("SELECT value FROM properties WHERE resource = ? AND prop = ? AND ns = ?"),
+ if (SQLITE_OK != sqlite3_prepare(s->sql,
+ CONST_STR_LEN("SELECT value FROM properties WHERE resource = ? AND prop = ? AND ns = ?"),
&(s->stmt_select_prop), &next_stmt)) {
/* prepare failed */
@@ -237,8 +202,8 @@ SETDEFAULTS_FUNC(mod_webdav_set_defaults) {
return HANDLER_ERROR;
}
- if (SQLITE_OK != sqlite3_prepare(s->sql,
- CONST_STR_LEN("SELECT ns, prop FROM properties WHERE resource = ?"),
+ if (SQLITE_OK != sqlite3_prepare(s->sql,
+ CONST_STR_LEN("SELECT ns, prop FROM properties WHERE resource = ?"),
&(s->stmt_select_propnames), &next_stmt)) {
/* prepare failed */
@@ -246,67 +211,16 @@ SETDEFAULTS_FUNC(mod_webdav_set_defaults) {
return HANDLER_ERROR;
}
-
- if (SQLITE_OK != sqlite3_prepare(s->sql,
- CONST_STR_LEN("REPLACE INTO properties (resource, prop, ns, value) VALUES (?, ?, ?, ?)"),
- &(s->stmt_update_prop), &next_stmt)) {
- /* prepare failed */
-
- log_error_write(srv, __FILE__, __LINE__, "ss", "sqlite3_prepare failed:", sqlite3_errmsg(s->sql));
- return HANDLER_ERROR;
- }
-
- if (SQLITE_OK != sqlite3_prepare(s->sql,
- CONST_STR_LEN("DELETE FROM properties WHERE resource = ? AND prop = ? AND ns = ?"),
- &(s->stmt_delete_prop), &next_stmt)) {
- /* prepare failed */
- log_error_write(srv, __FILE__, __LINE__, "ss", "sqlite3_prepare failed", sqlite3_errmsg(s->sql));
-
- return HANDLER_ERROR;
- }
-
- if (SQLITE_OK != sqlite3_prepare(s->sql,
- CONST_STR_LEN("DELETE FROM properties WHERE resource = ?"),
- &(s->stmt_delete_uri), &next_stmt)) {
- /* prepare failed */
- log_error_write(srv, __FILE__, __LINE__, "ss", "sqlite3_prepare failed", sqlite3_errmsg(s->sql));
-
- return HANDLER_ERROR;
- }
-
- if (SQLITE_OK != sqlite3_prepare(s->sql,
- CONST_STR_LEN("INSERT INTO properties SELECT ?, prop, ns, value FROM properties WHERE resource = ?"),
- &(s->stmt_copy_uri), &next_stmt)) {
- /* prepare failed */
- log_error_write(srv, __FILE__, __LINE__, "ss", "sqlite3_prepare failed", sqlite3_errmsg(s->sql));
-
- return HANDLER_ERROR;
- }
-
- if (SQLITE_OK != sqlite3_prepare(s->sql,
- CONST_STR_LEN("UPDATE properties SET resource = ? WHERE resource = ?"),
- &(s->stmt_move_uri), &next_stmt)) {
- /* prepare failed */
- log_error_write(srv, __FILE__, __LINE__, "ss", "sqlite3_prepare failed", sqlite3_errmsg(s->sql));
-
- return HANDLER_ERROR;
- }
-
- /* LOCKS */
-
- if (SQLITE_OK != sqlite3_exec(s->sql,
- "CREATE TABLE locks ("
- " locktoken TEXT NOT NULL,"
+ if (SQLITE_OK != sqlite3_exec(s->sql,
+ "CREATE TABLE properties ("
" resource TEXT NOT NULL,"
- " lockscope TEXT NOT NULL,"
- " locktype TEXT NOT NULL,"
- " owner TEXT NOT NULL,"
- " depth INT NOT NULL,"
- " timeout TIMESTAMP NOT NULL,"
- " PRIMARY KEY(locktoken))",
+ " prop TEXT NOT NULL,"
+ " ns TEXT NOT NULL,"
+ " value TEXT NOT NULL,"
+ " PRIMARY KEY(resource, prop, ns))",
NULL, NULL, &err)) {
- if (0 != strcmp(err, "table locks already exists")) {
+ if (0 != strcmp(err, "table properties already exists")) {
log_error_write(srv, __FILE__, __LINE__, "ss", "can't open transaction:", err);
sqlite3_free(err);
@@ -314,140 +228,126 @@ SETDEFAULTS_FUNC(mod_webdav_set_defaults) {
}
sqlite3_free(err);
}
-
- if (SQLITE_OK != sqlite3_prepare(s->sql,
- CONST_STR_LEN("INSERT INTO locks (locktoken, resource, lockscope, locktype, owner, depth, timeout) VALUES (?,?,?,?,?,?, CURRENT_TIME + 600)"),
- &(s->stmt_create_lock), &next_stmt)) {
+
+ if (SQLITE_OK != sqlite3_prepare(s->sql,
+ CONST_STR_LEN("REPLACE INTO properties (resource, prop, ns, value) VALUES (?, ?, ?, ?)"),
+ &(s->stmt_update_prop), &next_stmt)) {
/* prepare failed */
- log_error_write(srv, __FILE__, __LINE__, "ss", "sqlite3_prepare failed", sqlite3_errmsg(s->sql));
+ log_error_write(srv, __FILE__, __LINE__, "ss", "sqlite3_prepare failed:", sqlite3_errmsg(s->sql));
return HANDLER_ERROR;
}
- if (SQLITE_OK != sqlite3_prepare(s->sql,
- CONST_STR_LEN("DELETE FROM locks WHERE locktoken = ?"),
- &(s->stmt_remove_lock), &next_stmt)) {
+ if (SQLITE_OK != sqlite3_prepare(s->sql,
+ CONST_STR_LEN("DELETE FROM properties WHERE resource = ? AND prop = ? AND ns = ?"),
+ &(s->stmt_delete_prop), &next_stmt)) {
/* prepare failed */
log_error_write(srv, __FILE__, __LINE__, "ss", "sqlite3_prepare failed", sqlite3_errmsg(s->sql));
return HANDLER_ERROR;
}
- if (SQLITE_OK != sqlite3_prepare(s->sql,
- CONST_STR_LEN("SELECT locktoken, resource, lockscope, locktype, owner, depth, timeout FROM locks WHERE locktoken = ?"),
- &(s->stmt_read_lock), &next_stmt)) {
+ if (SQLITE_OK != sqlite3_prepare(s->sql,
+ CONST_STR_LEN("DELETE FROM properties WHERE resource = ?"),
+ &(s->stmt_delete_uri), &next_stmt)) {
/* prepare failed */
log_error_write(srv, __FILE__, __LINE__, "ss", "sqlite3_prepare failed", sqlite3_errmsg(s->sql));
return HANDLER_ERROR;
}
- if (SQLITE_OK != sqlite3_prepare(s->sql,
- CONST_STR_LEN("SELECT locktoken, resource, lockscope, locktype, owner, depth, timeout FROM locks WHERE resource = ?"),
- &(s->stmt_read_lock_by_uri), &next_stmt)) {
+ if (SQLITE_OK != sqlite3_prepare(s->sql,
+ CONST_STR_LEN("INSERT INTO properties SELECT ?, prop, ns, value FROM properties WHERE resource = ?"),
+ &(s->stmt_copy_uri), &next_stmt)) {
/* prepare failed */
log_error_write(srv, __FILE__, __LINE__, "ss", "sqlite3_prepare failed", sqlite3_errmsg(s->sql));
return HANDLER_ERROR;
}
- if (SQLITE_OK != sqlite3_prepare(s->sql,
- CONST_STR_LEN("UPDATE locks SET timeout = CURRENT_TIME + 600 WHERE locktoken = ?"),
- &(s->stmt_refresh_lock), &next_stmt)) {
+ if (SQLITE_OK != sqlite3_prepare(s->sql,
+ CONST_STR_LEN("UPDATE properties SET resource = ? WHERE resource = ?"),
+ &(s->stmt_move_uri), &next_stmt)) {
/* prepare failed */
log_error_write(srv, __FILE__, __LINE__, "ss", "sqlite3_prepare failed", sqlite3_errmsg(s->sql));
return HANDLER_ERROR;
}
-
-
#else
log_error_write(srv, __FILE__, __LINE__, "s", "Sorry, no sqlite3 and libxml2 support include, compile with --with-webdav-props");
return HANDLER_ERROR;
#endif
}
}
-
+
return HANDLER_GO_ON;
}
-#define PATCH_OPTION(x) \
+#define PATCH(x) \
p->conf.x = s->x;
static int mod_webdav_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
-
- PATCH_OPTION(enabled);
- PATCH_OPTION(is_readonly);
- PATCH_OPTION(log_xml);
-
+
+ PATCH(enabled);
+ PATCH(is_readonly);
+
#ifdef USE_PROPPATCH
- PATCH_OPTION(sql);
- PATCH_OPTION(stmt_update_prop);
- PATCH_OPTION(stmt_delete_prop);
- PATCH_OPTION(stmt_select_prop);
- PATCH_OPTION(stmt_select_propnames);
-
- PATCH_OPTION(stmt_delete_uri);
- PATCH_OPTION(stmt_move_uri);
- PATCH_OPTION(stmt_copy_uri);
-
- PATCH_OPTION(stmt_remove_lock);
- PATCH_OPTION(stmt_refresh_lock);
- PATCH_OPTION(stmt_create_lock);
- PATCH_OPTION(stmt_read_lock);
- PATCH_OPTION(stmt_read_lock_by_uri);
+ PATCH(sql);
+ PATCH(stmt_update_prop);
+ PATCH(stmt_delete_prop);
+ PATCH(stmt_select_prop);
+ PATCH(stmt_select_propnames);
+
+ PATCH(stmt_delete_uri);
+ PATCH(stmt_move_uri);
+ PATCH(stmt_copy_uri);
#endif
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
-
+
/* condition didn't match */
if (!config_check_cond(srv, con, dc)) continue;
-
+
/* merge config */
for (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];
-
+
if (buffer_is_equal_string(du->key, CONST_STR_LEN("webdav.activate"))) {
- PATCH_OPTION(enabled);
+ PATCH(enabled);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("webdav.is-readonly"))) {
- PATCH_OPTION(is_readonly);
+ PATCH(is_readonly);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("webdav.log-xml"))) {
- PATCH_OPTION(log_xml);
+ PATCH(log_xml);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("webdav.sqlite-db-name"))) {
#ifdef USE_PROPPATCH
- PATCH_OPTION(sql);
- PATCH_OPTION(stmt_update_prop);
- PATCH_OPTION(stmt_delete_prop);
- PATCH_OPTION(stmt_select_prop);
- PATCH_OPTION(stmt_select_propnames);
-
- PATCH_OPTION(stmt_delete_uri);
- PATCH_OPTION(stmt_move_uri);
- PATCH_OPTION(stmt_copy_uri);
-
- PATCH_OPTION(stmt_remove_lock);
- PATCH_OPTION(stmt_refresh_lock);
- PATCH_OPTION(stmt_create_lock);
- PATCH_OPTION(stmt_read_lock);
- PATCH_OPTION(stmt_read_lock_by_uri);
+ PATCH(sql);
+ PATCH(stmt_update_prop);
+ PATCH(stmt_delete_prop);
+ PATCH(stmt_select_prop);
+ PATCH(stmt_select_propnames);
+
+ PATCH(stmt_delete_uri);
+ PATCH(stmt_move_uri);
+ PATCH(stmt_copy_uri);
#endif
}
}
}
-
+
return 0;
}
+#undef PATCH
URIHANDLER_FUNC(mod_webdav_uri_handler) {
plugin_data *p = p_d;
-
+
UNUSED(srv);
if (con->uri.path->used == 0) return HANDLER_GO_ON;
-
+
mod_webdav_patch_connection(srv, con, p);
if (!p->conf.enabled) return HANDLER_GO_ON;
@@ -461,43 +361,43 @@ URIHANDLER_FUNC(mod_webdav_uri_handler) {
if (p->conf.is_readonly) {
response_header_insert(srv, con, CONST_STR_LEN("Allow"), CONST_STR_LEN("PROPFIND"));
} else {
- response_header_insert(srv, con, CONST_STR_LEN("Allow"), CONST_STR_LEN("PROPFIND, DELETE, MKCOL, PUT, MOVE, COPY, PROPPATCH, LOCK, UNLOCK"));
+ response_header_insert(srv, con, CONST_STR_LEN("Allow"), CONST_STR_LEN("PROPFIND, DELETE, MKCOL, PUT, MOVE, COPY, PROPPATCH"));
}
break;
default:
break;
}
-
+
/* not found */
return HANDLER_GO_ON;
}
-static int webdav_gen_prop_tag(server *srv, connection *con,
- char *prop_name,
- char *prop_ns,
- char *value,
+static int webdav_gen_prop_tag(server *srv, connection *con,
+ char *prop_name,
+ char *prop_ns,
+ char *value,
buffer *b) {
UNUSED(srv);
UNUSED(con);
if (value) {
- buffer_append_string_len(b,CONST_STR_LEN("<"));
+ buffer_append_string(b,"<");
buffer_append_string(b, prop_name);
- buffer_append_string_len(b, CONST_STR_LEN(" xmlns=\""));
+ buffer_append_string(b, " xmlns=\"");
buffer_append_string(b, prop_ns);
- buffer_append_string_len(b, CONST_STR_LEN("\">"));
+ buffer_append_string(b, "\">");
buffer_append_string(b, value);
- buffer_append_string_len(b,CONST_STR_LEN("</"));
+ buffer_append_string(b,"</");
buffer_append_string(b, prop_name);
- buffer_append_string_len(b, CONST_STR_LEN(">"));
+ buffer_append_string(b, ">");
} else {
- buffer_append_string_len(b,CONST_STR_LEN("<"));
+ buffer_append_string(b,"<");
buffer_append_string(b, prop_name);
- buffer_append_string_len(b, CONST_STR_LEN(" xmlns=\""));
+ buffer_append_string(b, " xmlns=\"");
buffer_append_string(b, prop_ns);
- buffer_append_string_len(b, CONST_STR_LEN("\"/>"));
+ buffer_append_string(b, "\"/>");
}
return 0;
@@ -507,24 +407,24 @@ static int webdav_gen_prop_tag(server *srv, connection *con,
static int webdav_gen_response_status_tag(server *srv, connection *con, physical *dst, int status, buffer *b) {
UNUSED(srv);
- buffer_append_string_len(b,CONST_STR_LEN("<D:response xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">\n"));
+ buffer_append_string(b,"<D:response xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">\n");
- buffer_append_string_len(b,CONST_STR_LEN("<D:href>\n"));
+ buffer_append_string(b,"<D:href>\n");
buffer_append_string_buffer(b, dst->rel_path);
- buffer_append_string_len(b,CONST_STR_LEN("</D:href>\n"));
- buffer_append_string_len(b,CONST_STR_LEN("<D:status>\n"));
-
+ buffer_append_string(b,"</D:href>\n");
+ buffer_append_string(b,"<D:status>\n");
+
if (con->request.http_version == HTTP_VERSION_1_1) {
- buffer_copy_string_len(b, CONST_STR_LEN("HTTP/1.1 "));
+ BUFFER_COPY_STRING_CONST(b, "HTTP/1.1 ");
} else {
- buffer_copy_string_len(b, CONST_STR_LEN("HTTP/1.0 "));
+ BUFFER_COPY_STRING_CONST(b, "HTTP/1.0 ");
}
buffer_append_long(b, status);
- buffer_append_string_len(b, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(b, " ");
buffer_append_string(b, get_http_status_name(status));
- buffer_append_string_len(b,CONST_STR_LEN("</D:status>\n"));
- buffer_append_string_len(b,CONST_STR_LEN("</D:response>\n"));
+ buffer_append_string(b,"</D:status>\n");
+ buffer_append_string(b,"</D:response>\n");
return 0;
}
@@ -557,17 +457,16 @@ static int webdav_delete_file(server *srv, connection *con, plugin_data *p, phys
/* bind the values to the insert */
- sqlite3_bind_text(stmt, 1,
- dst->rel_path->ptr,
+ sqlite3_bind_text(stmt, 1,
+ dst->rel_path->ptr,
dst->rel_path->used - 1,
SQLITE_TRANSIENT);
-
+
if (SQLITE_DONE != sqlite3_step(stmt)) {
/* */
+ WP();
}
}
-#else
- UNUSED(p);
#endif
}
@@ -593,12 +492,12 @@ static int webdav_delete_dir(server *srv, connection *con, plugin_data *p, physi
(de->d_name[0] == '.' && de->d_name[1] == '.' && de->d_name[2] == '\0')) {
continue;
/* ignore the parent dir */
- }
+ }
buffer_copy_string_buffer(d.path, dst->path);
BUFFER_APPEND_SLASH(d.path);
buffer_append_string(d.path, de->d_name);
-
+
buffer_copy_string_buffer(d.rel_path, dst->rel_path);
BUFFER_APPEND_SLASH(d.rel_path);
buffer_append_string(d.rel_path, de->d_name);
@@ -608,7 +507,7 @@ static int webdav_delete_dir(server *srv, connection *con, plugin_data *p, physi
/* don't about it yet, rmdir will fail too */
} else if (S_ISDIR(st.st_mode)) {
have_multi_status = webdav_delete_dir(srv, con, p, &d, b);
-
+
/* try to unlink it */
if (-1 == rmdir(d.path->ptr)) {
switch(errno) {
@@ -635,13 +534,14 @@ static int webdav_delete_dir(server *srv, connection *con, plugin_data *p, physi
/* bind the values to the insert */
- sqlite3_bind_text(stmt, 1,
- d.rel_path->ptr,
+ sqlite3_bind_text(stmt, 1,
+ d.rel_path->ptr,
d.rel_path->used - 1,
SQLITE_TRANSIENT);
-
+
if (SQLITE_DONE != sqlite3_step(stmt)) {
/* */
+ WP();
}
}
#endif
@@ -662,14 +562,14 @@ static int webdav_delete_dir(server *srv, connection *con, plugin_data *p, physi
static int webdav_copy_file(server *srv, connection *con, plugin_data *p, physical *src, physical *dst, int overwrite) {
stream s;
int status = 0, ofd;
- UNUSED(srv);
+
UNUSED(con);
if (stream_open(&s, src->path)) {
return 403;
}
-
- if (-1 == (ofd = open(dst->path->ptr, O_WRONLY|O_TRUNC|O_CREAT|(overwrite ? 0 : O_EXCL), WEBDAV_FILE_MODE))) {
+
+ if (-1 == (ofd = open(dst->path->ptr, O_WRONLY|O_TRUNC|O_CREAT|(overwrite ? 0 : O_EXCL), 0600))) {
/* opening the destination failed for some reason */
switch(errno) {
case EEXIST:
@@ -700,7 +600,7 @@ static int webdav_copy_file(server *srv, connection *con, plugin_data *p, physic
break;
}
}
-
+
stream_close(&s);
close(ofd);
@@ -713,23 +613,22 @@ static int webdav_copy_file(server *srv, connection *con, plugin_data *p, physic
sqlite3_reset(stmt);
/* bind the values to the insert */
- sqlite3_bind_text(stmt, 1,
- dst->rel_path->ptr,
+ sqlite3_bind_text(stmt, 1,
+ dst->rel_path->ptr,
dst->rel_path->used - 1,
SQLITE_TRANSIENT);
- sqlite3_bind_text(stmt, 2,
- src->rel_path->ptr,
+ sqlite3_bind_text(stmt, 2,
+ src->rel_path->ptr,
src->rel_path->used - 1,
SQLITE_TRANSIENT);
-
+
if (SQLITE_DONE != sqlite3_step(stmt)) {
/* */
+ WP();
}
}
}
-#else
- UNUSED(p);
#endif
return status;
}
@@ -755,7 +654,7 @@ static int webdav_copy_dir(server *srv, connection *con, plugin_data *p, physica
(de->d_name[0] == '.' && de->d_name[1] == '.' && de->d_name[2] == '\0')) {
continue;
}
-
+
buffer_copy_string_buffer(s.path, src->path);
BUFFER_APPEND_SLASH(s.path);
buffer_append_string(s.path, de->d_name);
@@ -776,7 +675,7 @@ static int webdav_copy_dir(server *srv, connection *con, plugin_data *p, physica
/* why ? */
} else if (S_ISDIR(st.st_mode)) {
/* a directory */
- if (-1 == mkdir(d.path->ptr, WEBDAV_DIR_MODE) &&
+ if (-1 == mkdir(d.path->ptr, 0700) &&
errno != EEXIST) {
/* WTH ? */
} else {
@@ -792,18 +691,19 @@ static int webdav_copy_dir(server *srv, connection *con, plugin_data *p, physica
sqlite3_reset(stmt);
/* bind the values to the insert */
- sqlite3_bind_text(stmt, 1,
- dst->rel_path->ptr,
+ sqlite3_bind_text(stmt, 1,
+ dst->rel_path->ptr,
dst->rel_path->used - 1,
SQLITE_TRANSIENT);
- sqlite3_bind_text(stmt, 2,
- src->rel_path->ptr,
+ sqlite3_bind_text(stmt, 2,
+ src->rel_path->ptr,
src->rel_path->used - 1,
SQLITE_TRANSIENT);
-
+
if (SQLITE_DONE != sqlite3_step(stmt)) {
/* */
+ WP();
}
}
#endif
@@ -820,7 +720,7 @@ static int webdav_copy_dir(server *srv, connection *con, plugin_data *p, physica
buffer_free(s.rel_path);
buffer_free(d.path);
buffer_free(d.rel_path);
-
+
closedir(srcdir);
}
@@ -840,23 +740,23 @@ static int webdav_get_live_property(server *srv, connection *con, plugin_data *p
if (0 == strcmp(prop_name, "resourcetype")) {
if (S_ISDIR(sce->st.st_mode)) {
- buffer_append_string_len(b, CONST_STR_LEN("<D:resourcetype><D:collection/></D:resourcetype>"));
+ buffer_append_string(b, "<D:resourcetype><D:collection/></D:resourcetype>");
found = 1;
}
} else if (0 == strcmp(prop_name, "getcontenttype")) {
if (S_ISDIR(sce->st.st_mode)) {
- buffer_append_string_len(b, CONST_STR_LEN("<D:getcontenttype>httpd/unix-directory</D:getcontenttype>"));
+ buffer_append_string(b, "<D:getcontenttype>httpd/unix-directory</D:getcontenttype>");
found = 1;
- } else if(S_ISREG(sce->st.st_mode)) {
+ } else if(S_ISREG(sce->st.st_mode)) {
for (k = 0; k < con->conf.mimetypes->used; k++) {
data_string *ds = (data_string *)con->conf.mimetypes->data[k];
-
+
if (ds->key->used == 0) continue;
-
+
if (buffer_is_equal_right_len(dst->path, ds->key, ds->key->used - 1)) {
- buffer_append_string_len(b,CONST_STR_LEN("<D:getcontenttype>"));
+ buffer_append_string(b,"<D:getcontenttype>");
buffer_append_string_buffer(b, ds->value);
- buffer_append_string_len(b, CONST_STR_LEN("</D:getcontenttype>"));
+ buffer_append_string(b, "</D:getcontenttype>");
found = 1;
break;
@@ -864,26 +764,26 @@ static int webdav_get_live_property(server *srv, connection *con, plugin_data *p
}
}
} else if (0 == strcmp(prop_name, "creationdate")) {
- buffer_append_string_len(b, CONST_STR_LEN("<D:creationdate ns0:dt=\"dateTime.tz\">"));
+ buffer_append_string(b, "<D:creationdate ns0:dt=\"dateTime.tz\">");
strftime(ctime_buf, sizeof(ctime_buf), "%Y-%m-%dT%H:%M:%SZ", gmtime(&(sce->st.st_ctime)));
buffer_append_string(b, ctime_buf);
- buffer_append_string_len(b, CONST_STR_LEN("</D:creationdate>"));
+ buffer_append_string(b, "</D:creationdate>");
found = 1;
} else if (0 == strcmp(prop_name, "getlastmodified")) {
- buffer_append_string_len(b,CONST_STR_LEN("<D:getlastmodified ns0:dt=\"dateTime.rfc1123\">"));
+ buffer_append_string(b,"<D:getlastmodified ns0:dt=\"dateTime.rfc1123\">");
strftime(mtime_buf, sizeof(mtime_buf), "%a, %d %b %Y %H:%M:%S GMT", gmtime(&(sce->st.st_mtime)));
buffer_append_string(b, mtime_buf);
- buffer_append_string_len(b, CONST_STR_LEN("</D:getlastmodified>"));
+ buffer_append_string(b, "</D:getlastmodified>");
found = 1;
} else if (0 == strcmp(prop_name, "getcontentlength")) {
- buffer_append_string_len(b,CONST_STR_LEN("<D:getcontentlength>"));
+ buffer_append_string(b,"<D:getcontentlength>");
buffer_append_off_t(b, sce->st.st_size);
- buffer_append_string_len(b, CONST_STR_LEN("</D:getcontentlength>"));
+ buffer_append_string(b, "</D:getcontentlength>");
found = 1;
} else if (0 == strcmp(prop_name, "getcontentlanguage")) {
- buffer_append_string_len(b,CONST_STR_LEN("<D:getcontentlanguage>"));
- buffer_append_string_len(b, CONST_STR_LEN("en"));
- buffer_append_string_len(b, CONST_STR_LEN("</D:getcontentlanguage>"));
+ buffer_append_string(b,"<D:getcontentlanguage>");
+ buffer_append_string(b, "en");
+ buffer_append_string(b, "</D:getcontentlanguage>");
found = 1;
}
}
@@ -906,23 +806,23 @@ static int webdav_get_property(server *srv, connection *con, plugin_data *p, phy
/* bind the values to the insert */
- sqlite3_bind_text(stmt, 1,
- dst->rel_path->ptr,
+ sqlite3_bind_text(stmt, 1,
+ dst->rel_path->ptr,
dst->rel_path->used - 1,
SQLITE_TRANSIENT);
- sqlite3_bind_text(stmt, 2,
+ sqlite3_bind_text(stmt, 2,
prop_name,
strlen(prop_name),
SQLITE_TRANSIENT);
- sqlite3_bind_text(stmt, 3,
+ sqlite3_bind_text(stmt, 3,
prop_ns,
strlen(prop_ns),
SQLITE_TRANSIENT);
/* it is the PK */
- while (SQLITE_ROW == sqlite3_step(stmt)) {
+ while (SQLITE_ROW == sqlite3_step(p->conf.stmt_select_prop)) {
/* there is a row for us, we only expect a single col 'value' */
- webdav_gen_prop_tag(srv, con, prop_name, prop_ns, (char *)sqlite3_column_text(stmt, 0), b);
+ webdav_gen_prop_tag(srv, con, prop_name, prop_ns, (char *)sqlite3_column_text(p->conf.stmt_select_prop, 0), b);
found = 1;
}
}
@@ -939,7 +839,7 @@ typedef struct {
char *prop;
} webdav_property;
-webdav_property live_properties[] = {
+webdav_property live_properties[] = {
{ "DAV:", "creationdate" },
{ "DAV:", "displayname" },
{ "DAV:", "getcontentlanguage" },
@@ -970,8 +870,8 @@ static int webdav_get_props(server *srv, connection *con, plugin_data *p, physic
webdav_property *prop;
prop = props->ptr[i];
-
- if (0 != webdav_get_property(srv, con, p,
+
+ if (0 != webdav_get_property(srv, con, p,
dst, prop->prop, prop->ns, b_200)) {
webdav_gen_prop_tag(srv, con, prop->prop, prop->ns, NULL, b_404);
}
@@ -1015,15 +915,13 @@ static int webdav_parse_chunkqueue(server *srv, connection *con, plugin_data *p,
if (-1 == c->file.fd && /* open the file if not already open */
-1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno));
-
+
return -1;
}
-
+
if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
- log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
+ log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
strerror(errno), c->file.name, c->file.fd);
- close(c->file.fd);
- c->file.fd = -1;
return -1;
}
@@ -1037,9 +935,9 @@ static int webdav_parse_chunkqueue(server *srv, connection *con, plugin_data *p,
}
if (XML_ERR_OK != (err = xmlParseChunk(ctxt, c->file.mmap.start + c->offset, weHave, 0))) {
- log_error_write(srv, __FILE__, __LINE__, "sodd", "xmlParseChunk failed at:", cq->bytes_out, weHave, err);
+ log_error_write(srv, __FILE__, __LINE__, "sddd", "xmlParseChunk failed at:", cq->bytes_out, weHave, err);
}
-
+
c->offset += weHave;
cq->bytes_out += weHave;
@@ -1055,9 +953,9 @@ static int webdav_parse_chunkqueue(server *srv, connection *con, plugin_data *p,
}
if (XML_ERR_OK != (err = xmlParseChunk(ctxt, c->mem->ptr + c->offset, weHave, 0))) {
- log_error_write(srv, __FILE__, __LINE__, "sodd", "xmlParseChunk failed at:", cq->bytes_out, weHave, err);
+ log_error_write(srv, __FILE__, __LINE__, "sddd", "xmlParseChunk failed at:", cq->bytes_out, weHave, err);
}
-
+
c->offset += weHave;
cq->bytes_out += weHave;
@@ -1092,122 +990,6 @@ static int webdav_parse_chunkqueue(server *srv, connection *con, plugin_data *p,
}
#endif
-#ifdef USE_LOCKS
-static int webdav_lockdiscovery(server *srv, connection *con,
- buffer *locktoken, const char *lockscope, const char *locktype, int depth) {
-
- buffer *b;
-
- response_header_overwrite(srv, con, CONST_STR_LEN("Lock-Token"), CONST_BUF_LEN(locktoken));
-
- response_header_overwrite(srv, con,
- CONST_STR_LEN("Content-Type"),
- CONST_STR_LEN("text/xml; charset=\"utf-8\""));
-
- b = chunkqueue_get_append_buffer(con->write_queue);
-
- buffer_copy_string_len(b, CONST_STR_LEN("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:prop xmlns:D=\"DAV:\" xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">\n"));
- buffer_append_string_len(b,CONST_STR_LEN("<D:lockdiscovery>\n"));
- buffer_append_string_len(b,CONST_STR_LEN("<D:activelock>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:lockscope>"));
- buffer_append_string_len(b,CONST_STR_LEN("<D:"));
- buffer_append_string(b, lockscope);
- buffer_append_string_len(b, CONST_STR_LEN("/>"));
- buffer_append_string_len(b,CONST_STR_LEN("</D:lockscope>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:locktype>"));
- buffer_append_string_len(b,CONST_STR_LEN("<D:"));
- buffer_append_string(b, locktype);
- buffer_append_string_len(b, CONST_STR_LEN("/>"));
- buffer_append_string_len(b,CONST_STR_LEN("</D:locktype>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:depth>"));
- buffer_append_string(b, depth == 0 ? "0" : "infinity");
- buffer_append_string_len(b,CONST_STR_LEN("</D:depth>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:timeout>"));
- buffer_append_string_len(b, CONST_STR_LEN("Second-600"));
- buffer_append_string_len(b,CONST_STR_LEN("</D:timeout>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:owner>"));
- buffer_append_string_len(b,CONST_STR_LEN("</D:owner>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:locktoken>"));
- buffer_append_string_len(b, CONST_STR_LEN("<D:href>"));
- buffer_append_string_buffer(b, locktoken);
- buffer_append_string_len(b, CONST_STR_LEN("</D:href>"));
- buffer_append_string_len(b,CONST_STR_LEN("</D:locktoken>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("</D:activelock>\n"));
- buffer_append_string_len(b,CONST_STR_LEN("</D:lockdiscovery>\n"));
- buffer_append_string_len(b,CONST_STR_LEN("</D:prop>\n"));
-
- return 0;
-}
-#endif
-
-/**
- * check if resource is having the right locks to access to resource
- *
- *
- *
- */
-static int webdav_has_lock(server *srv, connection *con, plugin_data *p, buffer *uri) {
- int has_lock = 1;
-
-#ifdef USE_LOCKS
- data_string *ds;
- UNUSED(srv);
-
- /**
- * This implementation is more fake than real
- * we need a parser for the If: header to really handle the full scope
- *
- * X-Litmus: locks: 11 (owner_modify)
- * If: <http://127.0.0.1:1025/dav/litmus/lockme> (<opaquelocktoken:2165478d-0611-49c4-be92-e790d68a38f1>)
- * - a tagged check:
- * if http://127.0.0.1:1025/dav/litmus/lockme is locked with
- * opaquelocktoken:2165478d-0611-49c4-be92-e790d68a38f1, go on
- *
- * X-Litmus: locks: 16 (fail_cond_put)
- * If: (<DAV:no-lock> ["-1622396671"])
- * - untagged:
- * go on if the resource has the etag [...] and the lock
- */
- if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "If"))) {
- /* Ooh, ooh. A if tag, now the fun begins.
- *
- * this can only work with a real parser
- **/
- } else {
- /* we didn't provided a lock-token -> */
- /* if the resource is locked -> 423 */
-
- sqlite3_stmt *stmt = p->conf.stmt_read_lock_by_uri;
-
- sqlite3_reset(stmt);
-
- sqlite3_bind_text(stmt, 1,
- CONST_BUF_LEN(uri),
- SQLITE_TRANSIENT);
-
- while (SQLITE_ROW == sqlite3_step(stmt)) {
- has_lock = 0;
- }
- }
-#else
- UNUSED(srv);
- UNUSED(con);
- UNUSED(p);
- UNUSED(uri);
-#endif
-
- return has_lock;
-}
-
URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
plugin_data *p = p_d;
buffer *b;
@@ -1218,8 +1000,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
buffer *prop_200;
buffer *prop_404;
webdav_properties *req_props;
- stat_cache_entry *sce = NULL;
-
+
UNUSED(srv);
if (!p->conf.enabled) return HANDLER_GO_ON;
@@ -1237,19 +1018,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
req_props = NULL;
/* is there a content-body ? */
-
- switch (stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
- case HANDLER_ERROR:
- if (errno == ENOENT) {
- con->http_status = 404;
- return HANDLER_FINISHED;
- }
- break;
- default:
- break;
- }
-
-
+
#ifdef USE_PROPPATCH
/* any special requests or just allprop ? */
if (con->request.content_length) {
@@ -1317,13 +1086,14 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
/* get all property names (EMPTY) */
sqlite3_reset(stmt);
/* bind the values to the insert */
-
- sqlite3_bind_text(stmt, 1,
- con->uri.path->ptr,
+
+ sqlite3_bind_text(stmt, 1,
+ con->uri.path->ptr,
con->uri.path->used - 1,
SQLITE_TRANSIENT);
-
+
if (SQLITE_DONE != sqlite3_step(stmt)) {
+ WP();
}
}
} else if (0 == xmlStrcmp(cmd->name, BAD_CAST "allprop")) {
@@ -1344,13 +1114,13 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/xml; charset=\"utf-8\""));
b = chunkqueue_get_append_buffer(con->write_queue);
+
+ buffer_copy_string(b, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
- buffer_copy_string_len(b, CONST_STR_LEN("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:multistatus xmlns:D=\"DAV:\" xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">\n"));
+ buffer_append_string(b,"<D:multistatus xmlns:D=\"DAV:\" xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">\n");
/* allprop */
-
+
prop_200 = buffer_init();
prop_404 = buffer_init();
@@ -1358,44 +1128,44 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
case 0:
/* Depth: 0 */
webdav_get_props(srv, con, p, &(con->physical), req_props, prop_200, prop_404);
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:response>\n"));
- buffer_append_string_len(b,CONST_STR_LEN("<D:href>"));
+
+ buffer_append_string(b,"<D:response>\n");
+ buffer_append_string(b,"<D:href>");
buffer_append_string_buffer(b, con->uri.scheme);
- buffer_append_string_len(b,CONST_STR_LEN("://"));
+ buffer_append_string(b,"://");
buffer_append_string_buffer(b, con->uri.authority);
buffer_append_string_encoded(b, CONST_BUF_LEN(con->uri.path), ENCODING_REL_URI);
- buffer_append_string_len(b,CONST_STR_LEN("</D:href>\n"));
+ buffer_append_string(b,"</D:href>\n");
if (!buffer_is_empty(prop_200)) {
- buffer_append_string_len(b,CONST_STR_LEN("<D:propstat>\n"));
- buffer_append_string_len(b,CONST_STR_LEN("<D:prop>\n"));
+ buffer_append_string(b,"<D:propstat>\n");
+ buffer_append_string(b,"<D:prop>\n");
buffer_append_string_buffer(b, prop_200);
- buffer_append_string_len(b,CONST_STR_LEN("</D:prop>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:status>HTTP/1.1 200 OK</D:status>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("</D:propstat>\n"));
+ buffer_append_string(b,"</D:prop>\n");
+
+ buffer_append_string(b,"<D:status>HTTP/1.1 200 OK</D:status>\n");
+
+ buffer_append_string(b,"</D:propstat>\n");
}
if (!buffer_is_empty(prop_404)) {
- buffer_append_string_len(b,CONST_STR_LEN("<D:propstat>\n"));
- buffer_append_string_len(b,CONST_STR_LEN("<D:prop>\n"));
+ buffer_append_string(b,"<D:propstat>\n");
+ buffer_append_string(b,"<D:prop>\n");
buffer_append_string_buffer(b, prop_404);
- buffer_append_string_len(b,CONST_STR_LEN("</D:prop>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:status>HTTP/1.1 404 Not Found</D:status>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("</D:propstat>\n"));
+ buffer_append_string(b,"</D:prop>\n");
+
+ buffer_append_string(b,"<D:status>HTTP/1.1 404 Not Found</D:status>\n");
+
+ buffer_append_string(b,"</D:propstat>\n");
}
- buffer_append_string_len(b,CONST_STR_LEN("</D:response>\n"));
+ buffer_append_string(b,"</D:response>\n");
break;
- case 1:
+ case 1:
if (NULL != (dir = opendir(con->physical.path->ptr))) {
struct dirent *de;
physical d;
@@ -1405,63 +1175,59 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
d.rel_path = buffer_init();
while(NULL != (de = readdir(dir))) {
- if (de->d_name[0] == '.' && de->d_name[1] == '.' && de->d_name[2] == '\0') {
+ if ((de->d_name[0] == '.' && de->d_name[1] == '\0') ||
+ (de->d_name[0] == '.' && de->d_name[1] == '.' && de->d_name[2] == '\0')) {
continue;
/* ignore the parent dir */
- }
+ }
buffer_copy_string_buffer(d.path, dst->path);
BUFFER_APPEND_SLASH(d.path);
-
+ buffer_append_string(d.path, de->d_name);
+
buffer_copy_string_buffer(d.rel_path, dst->rel_path);
BUFFER_APPEND_SLASH(d.rel_path);
-
- if (de->d_name[0] == '.' && de->d_name[1] == '\0') {
- /* don't append the . */
- } else {
- buffer_append_string(d.path, de->d_name);
- buffer_append_string(d.rel_path, de->d_name);
- }
+ buffer_append_string(d.rel_path, de->d_name);
buffer_reset(prop_200);
buffer_reset(prop_404);
webdav_get_props(srv, con, p, &d, req_props, prop_200, prop_404);
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:response>\n"));
- buffer_append_string_len(b,CONST_STR_LEN("<D:href>"));
+
+ buffer_append_string(b,"<D:response>\n");
+ buffer_append_string(b,"<D:href>");
buffer_append_string_buffer(b, con->uri.scheme);
- buffer_append_string_len(b,CONST_STR_LEN("://"));
+ buffer_append_string(b,"://");
buffer_append_string_buffer(b, con->uri.authority);
buffer_append_string_encoded(b, CONST_BUF_LEN(d.rel_path), ENCODING_REL_URI);
- buffer_append_string_len(b,CONST_STR_LEN("</D:href>\n"));
+ buffer_append_string(b,"</D:href>\n");
if (!buffer_is_empty(prop_200)) {
- buffer_append_string_len(b,CONST_STR_LEN("<D:propstat>\n"));
- buffer_append_string_len(b,CONST_STR_LEN("<D:prop>\n"));
+ buffer_append_string(b,"<D:propstat>\n");
+ buffer_append_string(b,"<D:prop>\n");
buffer_append_string_buffer(b, prop_200);
- buffer_append_string_len(b,CONST_STR_LEN("</D:prop>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:status>HTTP/1.1 200 OK</D:status>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("</D:propstat>\n"));
+ buffer_append_string(b,"</D:prop>\n");
+
+ buffer_append_string(b,"<D:status>HTTP/1.1 200 OK</D:status>\n");
+
+ buffer_append_string(b,"</D:propstat>\n");
}
if (!buffer_is_empty(prop_404)) {
- buffer_append_string_len(b,CONST_STR_LEN("<D:propstat>\n"));
- buffer_append_string_len(b,CONST_STR_LEN("<D:prop>\n"));
+ buffer_append_string(b,"<D:propstat>\n");
+ buffer_append_string(b,"<D:prop>\n");
buffer_append_string_buffer(b, prop_404);
- buffer_append_string_len(b,CONST_STR_LEN("</D:prop>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:status>HTTP/1.1 404 Not Found</D:status>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("</D:propstat>\n"));
+ buffer_append_string(b,"</D:prop>\n");
+
+ buffer_append_string(b,"<D:status>HTTP/1.1 404 Not Found</D:status>\n");
+
+ buffer_append_string(b,"</D:propstat>\n");
}
- buffer_append_string_len(b,CONST_STR_LEN("</D:response>\n"));
+ buffer_append_string(b,"</D:response>\n");
}
closedir(dir);
buffer_free(d.path);
@@ -1481,10 +1247,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
free(req_props);
}
- buffer_free(prop_200);
- buffer_free(prop_404);
-
- buffer_append_string_len(b,CONST_STR_LEN("</D:multistatus>\n"));
+ buffer_append_string(b,"</D:multistatus>\n");
if (p->conf.log_xml) {
log_error_write(srv, __FILE__, __LINE__, "sb", "XML-response-body:", b);
@@ -1504,10 +1267,10 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
return HANDLER_FINISHED;
}
-
+
/* let's create the directory */
- if (-1 == mkdir(con->physical.path->ptr, WEBDAV_DIR_MODE)) {
+ if (-1 == mkdir(con->physical.path->ptr, 0700)) {
switch(errno) {
case EPERM:
con->http_status = 403;
@@ -1523,7 +1286,6 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
}
} else {
con->http_status = 201;
- con->file_finished = 1;
}
return HANDLER_FINISHED;
@@ -1532,13 +1294,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
con->http_status = 403;
return HANDLER_FINISHED;
}
-
- /* does the client have a lock for this connection ? */
- if (!webdav_has_lock(srv, con, p, con->uri.path)) {
- con->http_status = 423;
- return HANDLER_FINISHED;
- }
-
+
/* stat and unlink afterwards */
if (-1 == stat(con->physical.path->ptr, &st)) {
/* don't about it yet, unlink will fail too */
@@ -1558,15 +1314,15 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/xml; charset=\"utf-8\""));
b = chunkqueue_get_append_buffer(con->write_queue);
+
+ buffer_copy_string(b, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
- buffer_copy_string_len(b, CONST_STR_LEN("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"));
-
- buffer_append_string_len(b,CONST_STR_LEN("<D:multistatus xmlns:D=\"DAV:\">\n"));
+ buffer_append_string(b,"<D:multistatus xmlns:D=\"DAV:\">\n");
buffer_append_string_buffer(b, multi_status_resp);
- buffer_append_string_len(b,CONST_STR_LEN("</D:multistatus>\n"));
-
+ buffer_append_string(b,"</D:multistatus>\n");
+
if (p->conf.log_xml) {
log_error_write(srv, __FILE__, __LINE__, "sb", "XML-response-body:", b);
}
@@ -1575,7 +1331,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
con->file_finished = 1;
} else {
/* everything went fine, remove the directory */
-
+
if (-1 == rmdir(con->physical.path->ptr)) {
switch(errno) {
case ENOENT:
@@ -1610,194 +1366,106 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
case HTTP_METHOD_PUT: {
int fd;
chunkqueue *cq = con->request_content_queue;
- chunk *c;
- data_string *ds_range;
if (p->conf.is_readonly) {
con->http_status = 403;
return HANDLER_FINISHED;
}
- /* is a exclusive lock set on the source */
- if (!webdav_has_lock(srv, con, p, con->uri.path)) {
- con->http_status = 423;
- return HANDLER_FINISHED;
- }
-
-
assert(chunkqueue_length(cq) == (off_t)con->request.content_length);
- /* RFC2616 Section 9.6 PUT requires us to send 501 on all Content-* we don't support
- * - most important Content-Range
- *
- *
- * Example: Content-Range: bytes 100-1037/1038 */
-
- if (NULL != (ds_range = (data_string *)array_get_element(con->request.headers, "Content-Range"))) {
- const char *num = ds_range->value->ptr;
- off_t offset;
- char *err = NULL;
-
- if (0 != strncmp(num, "bytes ", 6)) {
- con->http_status = 501; /* not implemented */
-
- return HANDLER_FINISHED;
- }
-
- /* we only support <num>- ... */
-
- num += 6;
-
- /* skip WS */
- while (*num == ' ' || *num == '\t') num++;
-
- if (*num == '\0') {
- con->http_status = 501; /* not implemented */
-
- return HANDLER_FINISHED;
- }
-
- offset = strtoll(num, &err, 10);
-
- if (*err != '-' || offset < 0) {
- con->http_status = 501; /* not implemented */
-
- return HANDLER_FINISHED;
- }
-
- if (-1 == (fd = open(con->physical.path->ptr, O_WRONLY, WEBDAV_FILE_MODE))) {
- switch (errno) {
- case ENOENT:
- con->http_status = 404; /* not found */
- break;
- default:
- con->http_status = 403; /* not found */
- break;
- }
- return HANDLER_FINISHED;
- }
-
- if (-1 == lseek(fd, offset, SEEK_SET)) {
- con->http_status = 501; /* not implemented */
-
- close(fd);
-
- return HANDLER_FINISHED;
- }
- con->http_status = 200; /* modified */
+ /* taken what we have in the request-body and write it to a file */
+ if (-1 == (fd = open(con->physical.path->ptr, O_WRONLY|O_CREAT|O_TRUNC, 0600))) {
+ /* we can't open the file */
+ con->http_status = 403;
} else {
- /* take what we have in the request-body and write it to a file */
+ chunk *c;
- /* if the file doesn't exist, create it */
- if (-1 == (fd = open(con->physical.path->ptr, O_WRONLY|O_TRUNC, WEBDAV_FILE_MODE))) {
- if (errno == ENOENT &&
- -1 == (fd = open(con->physical.path->ptr, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, WEBDAV_FILE_MODE))) {
- /* we can't open the file */
- con->http_status = 403;
+ con->http_status = 201; /* created */
- return HANDLER_FINISHED;
- } else {
- con->http_status = 201; /* created */
- }
- } else {
- con->http_status = 200; /* modified */
- }
- }
+ for (c = cq->first; c; c = cq->first) {
+ int r = 0;
- con->file_finished = 1;
+ /* copy all chunks */
+ switch(c->type) {
+ case FILE_CHUNK:
- for (c = cq->first; c; c = cq->first) {
- int r = 0;
-
- /* copy all chunks */
- switch(c->type) {
- case FILE_CHUNK:
+ if (c->file.mmap.start == MAP_FAILED) {
+ if (-1 == c->file.fd && /* open the file if not already open */
+ -1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno));
+
+ return -1;
+ }
+
+ if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
+ log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
+ strerror(errno), c->file.name, c->file.fd);
- if (c->file.mmap.start == MAP_FAILED) {
- if (-1 == c->file.fd && /* open the file if not already open */
- -1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno));
+ return -1;
+ }
- return HANDLER_ERROR;
- }
+ c->file.mmap.length = c->file.length;
- if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
- log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
- strerror(errno), c->file.name, c->file.fd);
close(c->file.fd);
c->file.fd = -1;
-
- return HANDLER_ERROR;
+
+ /* chunk_reset() or chunk_free() will cleanup for us */
}
- c->file.mmap.length = c->file.length;
-
- close(c->file.fd);
- c->file.fd = -1;
-
- /* chunk_reset() or chunk_free() will cleanup for us */
- }
-
- if ((r = write(fd, c->file.mmap.start + c->offset, c->file.length - c->offset)) < 0) {
- switch(errno) {
- case ENOSPC:
- con->http_status = 507;
-
- break;
- default:
- con->http_status = 403;
- break;
+ if ((r = write(fd, c->file.mmap.start + c->offset, c->file.length - c->offset)) < 0) {
+ switch(errno) {
+ case ENOSPC:
+ con->http_status = 507;
+
+ break;
+ default:
+ con->http_status = 403;
+ break;
+ }
}
+ break;
+ case MEM_CHUNK:
+ if ((r = write(fd, c->mem->ptr + c->offset, c->mem->used - c->offset - 1)) < 0) {
+ switch(errno) {
+ case ENOSPC:
+ con->http_status = 507;
+
+ break;
+ default:
+ con->http_status = 403;
+ break;
+ }
+ }
+ break;
+ case UNUSED_CHUNK:
+ break;
}
- break;
- case MEM_CHUNK:
- if ((r = write(fd, c->mem->ptr + c->offset, c->mem->used - c->offset - 1)) < 0) {
- switch(errno) {
- case ENOSPC:
- con->http_status = 507;
- break;
- default:
- con->http_status = 403;
- break;
- }
+ if (r > 0) {
+ c->offset += r;
+ cq->bytes_out += r;
+ } else {
+ break;
}
- break;
- case UNUSED_CHUNK:
- break;
+ chunkqueue_remove_finished_chunks(cq);
}
+ close(fd);
- if (r > 0) {
- c->offset += r;
- cq->bytes_out += r;
- } else {
- break;
- }
- chunkqueue_remove_finished_chunks(cq);
}
- close(fd);
-
return HANDLER_FINISHED;
}
- case HTTP_METHOD_MOVE:
+ case HTTP_METHOD_MOVE:
case HTTP_METHOD_COPY: {
buffer *destination = NULL;
- char *sep, *sep2, *start;
+ char *sep, *start;
int overwrite = 1;
if (p->conf.is_readonly) {
con->http_status = 403;
return HANDLER_FINISHED;
}
-
- /* is a exclusive lock set on the source */
- if (con->request.http_method == HTTP_METHOD_MOVE) {
- if (!webdav_has_lock(srv, con, p, con->uri.path)) {
- con->http_status = 423;
- return HANDLER_FINISHED;
- }
- }
-
+
if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Destination"))) {
destination = ds->value;
} else {
@@ -1841,10 +1509,6 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
con->http_status = 400;
return HANDLER_FINISHED;
}
- if (NULL != (sep2 = memchr(start, '@', sep - start))) {
- /* skip login information */
- start = sep2 + 1;
- }
buffer_copy_string_len(p->uri.authority, start, sep - start);
start = sep + 1;
@@ -1867,10 +1531,10 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
buffer_path_simplify(p->uri.path, p->tmp_buf);
/* we now have a URI which is clean. transform it into a physical path */
- buffer_copy_string_buffer(p->physical.doc_root, con->physical.doc_root);
+ buffer_copy_string_buffer(p->physical.doc_root, con->conf.document_root);
buffer_copy_string_buffer(p->physical.rel_path, p->uri.path);
- if (con->conf.force_lowercase_filenames) {
+ if (con->conf.force_lower_case) {
buffer_to_lower(p->physical.rel_path);
}
@@ -1878,7 +1542,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
BUFFER_APPEND_SLASH(p->physical.path);
buffer_copy_string_buffer(p->physical.basedir, p->physical.path);
- /* don't add a second / */
+ /* don't add a second / */
if (p->physical.rel_path->ptr[0] == '/') {
buffer_append_string_len(p->physical.path, p->physical.rel_path->ptr + 1, p->physical.rel_path->used - 2);
} else {
@@ -1903,7 +1567,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
/* src is a directory */
if (-1 == stat(p->physical.path->ptr, &st)) {
- if (-1 == mkdir(p->physical.path->ptr, WEBDAV_DIR_MODE)) {
+ if (-1 == mkdir(p->physical.path->ptr, 0700)) {
con->http_status = 403;
return HANDLER_FINISHED;
}
@@ -1914,7 +1578,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
return HANDLER_FINISHED;
} else {
unlink(p->physical.path->ptr);
- if (-1 == mkdir(p->physical.path->ptr, WEBDAV_DIR_MODE)) {
+ if (-1 == mkdir(p->physical.path->ptr, 0700)) {
con->http_status = 403;
return HANDLER_FINISHED;
}
@@ -1934,17 +1598,10 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
rmdir(con->physical.path->ptr);
}
con->http_status = 201;
- con->file_finished = 1;
} else {
/* it is just a file, good */
int r;
- /* does the client have a lock for this connection ? */
- if (!webdav_has_lock(srv, con, p, p->uri.path)) {
- con->http_status = 423;
- return HANDLER_FINISHED;
- }
-
/* destination exists */
if (0 == (r = stat(p->physical.path->ptr, &st))) {
if (S_ISDIR(st.st_mode)) {
@@ -1960,7 +1617,6 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
if (-1 == r) {
con->http_status = 201; /* we will create a new one */
- con->file_finished = 1;
switch(errno) {
case ENOTDIR:
@@ -1968,7 +1624,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
return HANDLER_FINISHED;
}
} else if (overwrite == 0) {
- /* destination exists, but overwrite is not set */
+ /* destination exists, but overwrite is not set */
con->http_status = 412;
return HANDLER_FINISHED;
} else {
@@ -1980,40 +1636,23 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
if (0 == rename(con->physical.path->ptr, p->physical.path->ptr)) {
#ifdef USE_PROPPATCH
- sqlite3_stmt *stmt;
+ sqlite3_stmt *stmt = p->conf.stmt_move_uri;
- stmt = p->conf.stmt_delete_uri;
if (stmt) {
sqlite3_reset(stmt);
/* bind the values to the insert */
- sqlite3_bind_text(stmt, 1,
- con->uri.path->ptr,
- con->uri.path->used - 1,
- SQLITE_TRANSIENT);
-
- if (SQLITE_DONE != sqlite3_step(stmt)) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "sql-move(delete old) failed:", sqlite3_errmsg(p->conf.sql));
- }
- }
-
- stmt = p->conf.stmt_move_uri;
- if (stmt) {
-
- sqlite3_reset(stmt);
-
- /* bind the values to the insert */
- sqlite3_bind_text(stmt, 1,
- p->uri.path->ptr,
+ sqlite3_bind_text(stmt, 1,
+ p->uri.path->ptr,
p->uri.path->used - 1,
SQLITE_TRANSIENT);
- sqlite3_bind_text(stmt, 2,
- con->uri.path->ptr,
+ sqlite3_bind_text(stmt, 2,
+ con->uri.path->ptr,
con->uri.path->used - 1,
SQLITE_TRANSIENT);
-
+
if (SQLITE_DONE != sqlite3_step(stmt)) {
log_error_write(srv, __FILE__, __LINE__, "ss", "sql-move failed:", sqlite3_errmsg(p->conf.sql));
}
@@ -2040,17 +1679,12 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
return HANDLER_FINISHED;
}
- case HTTP_METHOD_PROPPATCH:
+ case HTTP_METHOD_PROPPATCH: {
if (p->conf.is_readonly) {
con->http_status = 403;
return HANDLER_FINISHED;
}
- if (!webdav_has_lock(srv, con, p, con->uri.path)) {
- con->http_status = 423;
- return HANDLER_FINISHED;
- }
-
/* check if destination exists */
if (-1 == stat(con->physical.path->ptr, &st)) {
switch(errno) {
@@ -2091,7 +1725,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
sqlite3_stmt *stmt;
- stmt = (0 == xmlStrcmp(cmd->name, BAD_CAST "remove")) ?
+ stmt = (0 == xmlStrcmp(cmd->name, BAD_CAST "remove")) ?
p->conf.stmt_delete_prop : p->conf.stmt_update_prop;
for (props = cmd->children; props; props = props->next) {
@@ -2116,35 +1750,34 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
/* bind the values to the insert */
- sqlite3_bind_text(stmt, 1,
- con->uri.path->ptr,
+ sqlite3_bind_text(stmt, 1,
+ con->uri.path->ptr,
con->uri.path->used - 1,
SQLITE_TRANSIENT);
- sqlite3_bind_text(stmt, 2,
+ sqlite3_bind_text(stmt, 2,
(char *)prop->name,
strlen((char *)prop->name),
SQLITE_TRANSIENT);
if (prop->ns) {
- sqlite3_bind_text(stmt, 3,
+ sqlite3_bind_text(stmt, 3,
(char *)prop->ns->href,
strlen((char *)prop->ns->href),
SQLITE_TRANSIENT);
} else {
- sqlite3_bind_text(stmt, 3,
+ sqlite3_bind_text(stmt, 3,
"",
0,
SQLITE_TRANSIENT);
}
if (stmt == p->conf.stmt_update_prop) {
- sqlite3_bind_text(stmt, 4,
+ sqlite3_bind_text(stmt, 4,
(char *)xmlNodeGetContent(prop),
strlen((char *)xmlNodeGetContent(prop)),
SQLITE_TRANSIENT);
}
-
+
if (SQLITE_DONE != (r = sqlite3_step(stmt))) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "sql-set failed:", sqlite3_errmsg(p->conf.sql));
+ log_error_write(srv, __FILE__, __LINE__, "ss", "sql-set failed:", sqlite3_errmsg(p->conf.sql));
}
}
}
@@ -2159,7 +1792,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
goto propmatch_cleanup;
}
-
+
con->http_status = 400;
} else {
if (SQLITE_OK != sqlite3_exec(p->conf.sql, "COMMIT", NULL, NULL, &err)) {
@@ -2176,7 +1809,6 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
}
propmatch_cleanup:
-
xmlFreeDoc(xml);
} else {
con->http_status = 400;
@@ -2186,307 +1818,11 @@ propmatch_cleanup:
#endif
con->http_status = 501;
return HANDLER_FINISHED;
- case HTTP_METHOD_LOCK:
- /**
- * a mac wants to write
- *
- * LOCK /dav/expire.txt HTTP/1.1\r\n
- * User-Agent: WebDAVFS/1.3 (01308000) Darwin/8.1.0 (Power Macintosh)\r\n
- * Accept: * / *\r\n
- * Depth: 0\r\n
- * Timeout: Second-600\r\n
- * Content-Type: text/xml; charset=\"utf-8\"\r\n
- * Content-Length: 229\r\n
- * Connection: keep-alive\r\n
- * Host: 192.168.178.23:1025\r\n
- * \r\n
- * <?xml version=\"1.0\" encoding=\"utf-8\"?>\n
- * <D:lockinfo xmlns:D=\"DAV:\">\n
- * <D:lockscope><D:exclusive/></D:lockscope>\n
- * <D:locktype><D:write/></D:locktype>\n
- * <D:owner>\n
- * <D:href>http://www.apple.com/webdav_fs/</D:href>\n
- * </D:owner>\n
- * </D:lockinfo>\n
- */
-
- if (depth != 0 && depth != -1) {
- con->http_status = 400;
-
- return HANDLER_FINISHED;
- }
-
-#ifdef USE_LOCKS
- if (con->request.content_length) {
- xmlDocPtr xml;
- buffer *hdr_if = NULL;
-
- if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "If"))) {
- hdr_if = ds->value;
- }
-
- /* we don't support Depth: Infinity on locks */
- if (hdr_if == NULL && depth == -1) {
- con->http_status = 409; /* Conflict */
-
- return HANDLER_FINISHED;
- }
-
- if (1 == webdav_parse_chunkqueue(srv, con, p, con->request_content_queue, &xml)) {
- xmlNode *rootnode = xmlDocGetRootElement(xml);
-
- assert(rootnode);
-
- if (0 == xmlStrcmp(rootnode->name, BAD_CAST "lockinfo")) {
- xmlNode *lockinfo;
- const xmlChar *lockscope = NULL, *locktype = NULL; /* TODO: compiler says unused: *owner = NULL; */
-
- for (lockinfo = rootnode->children; lockinfo; lockinfo = lockinfo->next) {
- if (0 == xmlStrcmp(lockinfo->name, BAD_CAST "lockscope")) {
- xmlNode *value;
- for (value = lockinfo->children; value; value = value->next) {
- if ((0 == xmlStrcmp(value->name, BAD_CAST "exclusive")) ||
- (0 == xmlStrcmp(value->name, BAD_CAST "shared"))) {
- lockscope = value->name;
- } else {
- con->http_status = 400;
-
- xmlFreeDoc(xml);
- return HANDLER_FINISHED;
- }
- }
- } else if (0 == xmlStrcmp(lockinfo->name, BAD_CAST "locktype")) {
- xmlNode *value;
- for (value = lockinfo->children; value; value = value->next) {
- if ((0 == xmlStrcmp(value->name, BAD_CAST "write"))) {
- locktype = value->name;
- } else {
- con->http_status = 400;
-
- xmlFreeDoc(xml);
- return HANDLER_FINISHED;
- }
- }
-
- } else if (0 == xmlStrcmp(lockinfo->name, BAD_CAST "owner")) {
- }
- }
-
- if (lockscope && locktype) {
- sqlite3_stmt *stmt = p->conf.stmt_read_lock_by_uri;
-
- /* is this resourse already locked ? */
-
- /* SELECT locktoken, resource, lockscope, locktype, owner, depth, timeout
- * FROM locks
- * WHERE resource = ? */
-
- if (stmt) {
-
- sqlite3_reset(stmt);
-
- sqlite3_bind_text(stmt, 1,
- p->uri.path->ptr,
- p->uri.path->used - 1,
- SQLITE_TRANSIENT);
-
- /* it is the PK */
- while (SQLITE_ROW == sqlite3_step(stmt)) {
- /* we found a lock
- * 1. is it compatible ?
- * 2. is it ours */
- char *sql_lockscope = (char *)sqlite3_column_text(stmt, 2);
-
- if (strcmp(sql_lockscope, "exclusive")) {
- con->http_status = 423;
- } else if (0 == xmlStrcmp(lockscope, BAD_CAST "exclusive")) {
- /* resourse is locked with a shared lock
- * client wants exclusive */
- con->http_status = 423;
- }
- }
- if (con->http_status == 423) {
- xmlFreeDoc(xml);
- return HANDLER_FINISHED;
- }
- }
-
- stmt = p->conf.stmt_create_lock;
- if (stmt) {
- /* create a lock-token */
- uuid_t id;
- char uuid[37] /* 36 + \0 */;
-
- uuid_generate(id);
- uuid_unparse(id, uuid);
-
- buffer_copy_string_len(p->tmp_buf, CONST_STR_LEN("opaquelocktoken:"));
- buffer_append_string(p->tmp_buf, uuid);
-
- /* "CREATE TABLE locks ("
- * " locktoken TEXT NOT NULL,"
- * " resource TEXT NOT NULL,"
- * " lockscope TEXT NOT NULL,"
- * " locktype TEXT NOT NULL,"
- * " owner TEXT NOT NULL,"
- * " depth INT NOT NULL,"
- */
-
- sqlite3_reset(stmt);
-
- sqlite3_bind_text(stmt, 1,
- CONST_BUF_LEN(p->tmp_buf),
- SQLITE_TRANSIENT);
-
- sqlite3_bind_text(stmt, 2,
- CONST_BUF_LEN(con->uri.path),
- SQLITE_TRANSIENT);
-
- sqlite3_bind_text(stmt, 3,
- (const char *)lockscope,
- xmlStrlen(lockscope),
- SQLITE_TRANSIENT);
-
- sqlite3_bind_text(stmt, 4,
- (const char *)locktype,
- xmlStrlen(locktype),
- SQLITE_TRANSIENT);
-
- /* owner */
- sqlite3_bind_text(stmt, 5,
- "",
- 0,
- SQLITE_TRANSIENT);
-
- /* depth */
- sqlite3_bind_int(stmt, 6,
- depth);
-
-
- if (SQLITE_DONE != sqlite3_step(stmt)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "create lock:", sqlite3_errmsg(p->conf.sql));
- }
-
- /* looks like we survived */
- webdav_lockdiscovery(srv, con, p->tmp_buf, (const char *)lockscope, (const char *)locktype, depth);
-
- con->http_status = 201;
- con->file_finished = 1;
- }
- }
- }
-
- xmlFreeDoc(xml);
- return HANDLER_FINISHED;
- } else {
- con->http_status = 400;
- return HANDLER_FINISHED;
- }
- } else {
-
- if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "If"))) {
- buffer *locktoken = ds->value;
- sqlite3_stmt *stmt = p->conf.stmt_refresh_lock;
-
- /* remove the < > around the token */
- if (locktoken->used < 6) {
- con->http_status = 400;
-
- return HANDLER_FINISHED;
- }
-
- buffer_copy_string_len(p->tmp_buf, locktoken->ptr + 2, locktoken->used - 5);
-
- sqlite3_reset(stmt);
-
- sqlite3_bind_text(stmt, 1,
- CONST_BUF_LEN(p->tmp_buf),
- SQLITE_TRANSIENT);
-
- if (SQLITE_DONE != sqlite3_step(stmt)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "refresh lock:", sqlite3_errmsg(p->conf.sql));
- }
-
- webdav_lockdiscovery(srv, con, p->tmp_buf, "exclusive", "write", 0);
-
- con->http_status = 200;
- con->file_finished = 1;
- return HANDLER_FINISHED;
- } else {
- /* we need a lock-token to refresh */
- con->http_status = 400;
-
- return HANDLER_FINISHED;
- }
- }
- break;
-#else
- con->http_status = 501;
- return HANDLER_FINISHED;
-#endif
- case HTTP_METHOD_UNLOCK:
-#ifdef USE_LOCKS
- if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Lock-Token"))) {
- buffer *locktoken = ds->value;
- sqlite3_stmt *stmt = p->conf.stmt_remove_lock;
-
- /* remove the < > around the token */
- if (locktoken->used < 4) {
- con->http_status = 400;
-
- return HANDLER_FINISHED;
- }
-
- /**
- * FIXME:
- *
- * if the resourse is locked:
- * - by us: unlock
- * - by someone else: 401
- * if the resource is not locked:
- * - 412
- * */
-
- buffer_copy_string_len(p->tmp_buf, locktoken->ptr + 1, locktoken->used - 3);
-
- sqlite3_reset(stmt);
-
- sqlite3_bind_text(stmt, 1,
- CONST_BUF_LEN(p->tmp_buf),
- SQLITE_TRANSIENT);
-
- sqlite3_bind_text(stmt, 2,
- CONST_BUF_LEN(con->uri.path),
- SQLITE_TRANSIENT);
-
- if (SQLITE_DONE != sqlite3_step(stmt)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "remove lock:", sqlite3_errmsg(p->conf.sql));
- }
-
- if (0 == sqlite3_changes(p->conf.sql)) {
- con->http_status = 401;
- } else {
- con->http_status = 204;
- }
- return HANDLER_FINISHED;
- } else {
- /* we need a lock-token to unlock */
- con->http_status = 400;
-
- return HANDLER_FINISHED;
- }
- break;
-#else
- con->http_status = 501;
- return HANDLER_FINISHED;
-#endif
+ }
default:
break;
}
-
+
/* not found */
return HANDLER_GO_ON;
}
@@ -2494,18 +1830,17 @@ propmatch_cleanup:
/* this function is called at dlopen() time and inits the callbacks */
-int mod_webdav_plugin_init(plugin *p);
int mod_webdav_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
p->name = buffer_init_string("webdav");
-
+
p->init = mod_webdav_init;
p->handle_uri_clean = mod_webdav_uri_handler;
p->handle_physical = mod_webdav_subrequest_handler;
p->set_defaults = mod_webdav_set_defaults;
p->cleanup = mod_webdav_free;
-
+
p->data = NULL;
-
+
return 0;
}
diff --git a/src/network.c b/src/network.c
index bd30e2d..40e9bba 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1,15 +1,3 @@
-#include "network.h"
-#include "fdevent.h"
-#include "log.h"
-#include "connections.h"
-#include "plugin.h"
-#include "joblist.h"
-#include "configfile.h"
-
-#include "network_backends.h"
-#include "sys-mmap.h"
-#include "sys-socket.h"
-
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
@@ -21,42 +9,33 @@
#include <stdlib.h>
#include <assert.h>
-#ifdef USE_OPENSSL
-# include <openssl/ssl.h>
-# include <openssl/err.h>
-# include <openssl/rand.h>
-# include <openssl/dh.h>
-# include <openssl/bn.h>
-
-# if OPENSSL_VERSION_NUMBER >= 0x0090800fL
-# ifndef OPENSSL_NO_ECDH
-# include <openssl/ecdh.h>
-# endif
-# endif
-#endif
+#include "network.h"
+#include "fdevent.h"
+#include "log.h"
+#include "connections.h"
+#include "plugin.h"
+#include "joblist.h"
+
+#include "network_backends.h"
+#include "sys-mmap.h"
+#include "sys-socket.h"
#ifdef USE_OPENSSL
-static void ssl_info_callback(const SSL *ssl, int where, int ret) {
- UNUSED(ret);
-
- if (0 != (where & SSL_CB_HANDSHAKE_START)) {
- connection *con = SSL_get_app_data(ssl);
- ++con->renegotiations;
- } else if (0 != (where & SSL_CB_HANDSHAKE_DONE)) {
- ssl->s3->flags |= SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS;
- }
-}
+# include <openssl/ssl.h>
+# include <openssl/err.h>
+# include <openssl/rand.h>
#endif
-static handler_t network_server_handle_fdevent(server *srv, void *context, int revents) {
+handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
+ server *srv = (server *)s;
server_socket *srv_socket = (server_socket *)context;
connection *con;
int loops = 0;
-
+
UNUSED(context);
-
- if (0 == (revents & FDEVENT_IN)) {
- log_error_write(srv, __FILE__, __LINE__, "sdd",
+
+ if (revents != FDEVENT_IN) {
+ log_error_write(srv, __FILE__, __LINE__, "sdd",
"strange event for server socket",
srv_socket->fd,
revents);
@@ -65,12 +44,12 @@ static handler_t network_server_handle_fdevent(server *srv, void *context, int r
/* accept()s at most 100 connections directly
*
- * we jump out after 100 to give the waiting connections a chance */
+ * we jump out after 100 to give the waiting connections a chance */
for (loops = 0; loops < 100 && NULL != (con = connection_accept(srv, srv_socket)); loops++) {
handler_t r;
-
+
connection_state_machine(srv, con);
-
+
switch(r = plugins_call_handle_joblist(srv, con)) {
case HANDLER_FINISHED:
case HANDLER_GO_ON:
@@ -83,54 +62,7 @@ static handler_t network_server_handle_fdevent(server *srv, void *context, int r
return HANDLER_GO_ON;
}
-#if defined USE_OPENSSL && ! defined OPENSSL_NO_TLSEXT
-static int network_ssl_servername_callback(SSL *ssl, int *al, server *srv) {
- const char *servername;
- connection *con = (connection *) SSL_get_app_data(ssl);
- UNUSED(al);
-
- buffer_copy_string(con->uri.scheme, "https");
-
- if (NULL == (servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name))) {
-#if 0
- /* this "error" just means the client didn't support it */
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- "failed to get TLS server name");
-#endif
- return SSL_TLSEXT_ERR_NOACK;
- }
- buffer_copy_string(con->tlsext_server_name, servername);
- buffer_to_lower(con->tlsext_server_name);
-
- /* Sometimes this is still set, confusing COMP_HTTP_HOST */
- buffer_reset(con->uri.authority);
-
- config_cond_cache_reset(srv, con);
- config_setup_connection(srv, con);
-
- config_patch_connection(srv, con, COMP_SERVER_SOCKET);
- config_patch_connection(srv, con, COMP_HTTP_SCHEME);
- config_patch_connection(srv, con, COMP_HTTP_HOST);
-
- if (NULL == con->conf.ssl_ctx) {
- /* ssl_ctx <=> pemfile was set <=> ssl_ctx got patched: so this should never happen */
- log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
- "null SSL_CTX for TLS server name", con->tlsext_server_name);
- return SSL_TLSEXT_ERR_ALERT_FATAL;
- }
-
- /* switch to new SSL_CTX in reaction to a client's server_name extension */
- if (con->conf.ssl_ctx != SSL_set_SSL_CTX(ssl, con->conf.ssl_ctx)) {
- log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
- "failed to set SSL_CTX for TLS server name", con->tlsext_server_name);
- return SSL_TLSEXT_ERR_ALERT_FATAL;
- }
-
- return SSL_TLSEXT_ERR_OK;
-}
-#endif
-
-static int network_server_init(server *srv, buffer *host_token, specific_config *s) {
+int network_server_init(server *srv, buffer *host_token, specific_config *s) {
int val;
socklen_t addr_len;
server_socket *srv_socket;
@@ -139,15 +71,18 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
const char *host;
buffer *b;
int is_unix_domain_socket = 0;
- int fd;
+
+#ifdef SO_ACCEPTFILTER
+ struct accept_filter_arg afa;
+#endif
#ifdef __WIN32
WORD wVersionRequested;
WSADATA wsaData;
int err;
-
+
wVersionRequested = MAKEWORD( 2, 2 );
-
+
err = WSAStartup( wVersionRequested, &wsaData );
if ( err != 0 ) {
/* Tell the user that we could not find a usable */
@@ -155,38 +90,37 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
return -1;
}
#endif
-
+
srv_socket = calloc(1, sizeof(*srv_socket));
srv_socket->fd = -1;
- srv_socket->fde_ndx = -1;
-
+
srv_socket->srv_token = buffer_init();
buffer_copy_string_buffer(srv_socket->srv_token, host_token);
-
+
b = buffer_init();
buffer_copy_string_buffer(b, host_token);
-
- /* ipv4:port
+
+ /* ipv4:port
* [ipv6]:port
*/
if (NULL == (sp = strrchr(b->ptr, ':'))) {
log_error_write(srv, __FILE__, __LINE__, "sb", "value of $SERVER[\"socket\"] has to be \"ip:port\".", b);
-
- goto error_free_socket;
+
+ return -1;
}
-
+
host = b->ptr;
-
+
/* check for [ and ] */
if (b->ptr[0] == '[' && *(sp-1) == ']') {
*(sp-1) = '\0';
host++;
-
+
s->use_ipv6 = 1;
}
-
+
*(sp++) = '\0';
-
+
port = strtol(sp, NULL, 10);
if (host[0] == '/') {
@@ -194,62 +128,57 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
is_unix_domain_socket = 1;
} else if (port == 0 || port > 65535) {
log_error_write(srv, __FILE__, __LINE__, "sd", "port out of range:", port);
-
- goto error_free_socket;
+
+ return -1;
}
-
+
if (*host == '\0') host = NULL;
if (is_unix_domain_socket) {
#ifdef HAVE_SYS_UN_H
srv_socket->addr.plain.sa_family = AF_UNIX;
-
+
if (-1 == (srv_socket->fd = socket(srv_socket->addr.plain.sa_family, SOCK_STREAM, 0))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed:", strerror(errno));
- goto error_free_socket;
+ return -1;
}
#else
log_error_write(srv, __FILE__, __LINE__, "s",
"ERROR: Unix Domain sockets are not supported.");
- goto error_free_socket;
+ return -1;
#endif
}
#ifdef HAVE_IPV6
if (s->use_ipv6) {
srv_socket->addr.plain.sa_family = AF_INET6;
-
+
if (-1 == (srv_socket->fd = socket(srv_socket->addr.plain.sa_family, SOCK_STREAM, IPPROTO_TCP))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed:", strerror(errno));
- goto error_free_socket;
+ return -1;
}
srv_socket->use_ipv6 = 1;
}
#endif
-
+
if (srv_socket->fd == -1) {
srv_socket->addr.plain.sa_family = AF_INET;
if (-1 == (srv_socket->fd = socket(srv_socket->addr.plain.sa_family, SOCK_STREAM, IPPROTO_TCP))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed:", strerror(errno));
- goto error_free_socket;
+ return -1;
}
}
-
-#ifdef FD_CLOEXEC
- /* set FD_CLOEXEC now, fdevent_fcntl_set is called later; needed for pipe-logger forks */
- fcntl(srv_socket->fd, F_SETFD, FD_CLOEXEC);
-#endif
-
+
/* */
srv->cur_fds = srv_socket->fd;
-
+
val = 1;
if (setsockopt(srv_socket->fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "socketsockopt(SO_REUSEADDR) failed:", strerror(errno));
- goto error_free_socket;
+ log_error_write(srv, __FILE__, __LINE__, "ss", "socketsockopt failed:", strerror(errno));
+ return -1;
}
-
+
switch(srv_socket->addr.plain.sa_family) {
#ifdef HAVE_IPV6
case AF_INET6:
@@ -257,37 +186,26 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
srv_socket->addr.ipv6.sin6_family = AF_INET6;
if (host == NULL) {
srv_socket->addr.ipv6.sin6_addr = in6addr_any;
- log_error_write(srv, __FILE__, __LINE__, "s", "warning: please use server.use-ipv6 only for hostnames, not without server.bind / empty address; your config will break if the kernel default for IPV6_V6ONLY changes");
} else {
struct addrinfo hints, *res;
int r;
-
- if (s->set_v6only) {
- val = 1;
- if (-1 == setsockopt(srv_socket->fd, IPPROTO_IPV6, IPV6_V6ONLY, &val, sizeof(val))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "socketsockopt(IPV6_V6ONLY) failed:", strerror(errno));
- goto error_free_socket;
- }
- } else {
- log_error_write(srv, __FILE__, __LINE__, "s", "warning: server.set-v6only will be removed soon, update your config to have different sockets for ipv4 and ipv6");
- }
-
+
memset(&hints, 0, sizeof(hints));
-
+
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
-
+
if (0 != (r = getaddrinfo(host, NULL, &hints, &res))) {
- log_error_write(srv, __FILE__, __LINE__,
- "sssss", "getaddrinfo failed: ",
+ log_error_write(srv, __FILE__, __LINE__,
+ "sssss", "getaddrinfo failed: ",
gai_strerror(r), "'", host, "'");
-
- goto error_free_socket;
+
+ return -1;
}
-
+
memcpy(&(srv_socket->addr), res->ai_addr, res->ai_addrlen);
-
+
freeaddrinfo(res);
}
srv_socket->addr.ipv6.sin6_port = htons(port);
@@ -302,122 +220,128 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
} else {
struct hostent *he;
if (NULL == (he = gethostbyname(host))) {
- log_error_write(srv, __FILE__, __LINE__,
- "sds", "gethostbyname failed: ",
+ log_error_write(srv, __FILE__, __LINE__,
+ "sds", "gethostbyname failed: ",
h_errno, host);
- goto error_free_socket;
+ return -1;
}
-
+
if (he->h_addrtype != AF_INET) {
log_error_write(srv, __FILE__, __LINE__, "sd", "addr-type != AF_INET: ", he->h_addrtype);
- goto error_free_socket;
+ return -1;
}
-
+
if (he->h_length != sizeof(struct in_addr)) {
log_error_write(srv, __FILE__, __LINE__, "sd", "addr-length != sizeof(in_addr): ", he->h_length);
- goto error_free_socket;
+ return -1;
}
-
+
memcpy(&(srv_socket->addr.ipv4.sin_addr.s_addr), he->h_addr_list[0], he->h_length);
}
srv_socket->addr.ipv4.sin_port = htons(port);
-
+
addr_len = sizeof(struct sockaddr_in);
-
+
break;
case AF_UNIX:
srv_socket->addr.un.sun_family = AF_UNIX;
strcpy(srv_socket->addr.un.sun_path, host);
-
+
#ifdef SUN_LEN
addr_len = SUN_LEN(&srv_socket->addr.un);
#else
/* stevens says: */
- addr_len = strlen(host) + 1 + sizeof(srv_socket->addr.un.sun_family);
+ addr_len = strlen(host) + sizeof(srv_socket->addr.un.sun_family);
#endif
- /* check if the socket exists and try to connect to it. */
- if (-1 != (fd = connect(srv_socket->fd, (struct sockaddr *) &(srv_socket->addr), addr_len))) {
- close(fd);
-
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "server socket is still in use:",
- host);
-
-
- goto error_free_socket;
- }
-
- /* connect failed */
- switch(errno) {
- case ECONNREFUSED:
- unlink(host);
- break;
- case ENOENT:
- break;
- default:
- log_error_write(srv, __FILE__, __LINE__, "sds",
- "testing socket failed:",
- host, strerror(errno));
-
- goto error_free_socket;
- }
-
break;
default:
- goto error_free_socket;
+ addr_len = 0;
+
+ return -1;
}
-
+
if (0 != bind(srv_socket->fd, (struct sockaddr *) &(srv_socket->addr), addr_len)) {
- switch(srv_socket->addr.plain.sa_family) {
- case AF_UNIX:
- log_error_write(srv, __FILE__, __LINE__, "sds",
- "can't bind to socket:",
- host, strerror(errno));
- break;
- default:
- log_error_write(srv, __FILE__, __LINE__, "ssds",
- "can't bind to port:",
- host, port, strerror(errno));
- break;
- }
- goto error_free_socket;
+ log_error_write(srv, __FILE__, __LINE__, "sds", "can't bind to port", port, strerror(errno));
+ return -1;
}
-
+
if (-1 == listen(srv_socket->fd, 128 * 8)) {
log_error_write(srv, __FILE__, __LINE__, "ss", "listen failed: ", strerror(errno));
- goto error_free_socket;
+ return -1;
}
-
+
if (s->is_ssl) {
#ifdef USE_OPENSSL
- if (NULL == (srv_socket->ssl_ctx = s->ssl_ctx)) {
+ if (srv->ssl_is_init == 0) {
+ SSL_load_error_strings();
+ SSL_library_init();
+ srv->ssl_is_init = 1;
+
+ if (0 == RAND_status()) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ "not enough entropy in the pool");
+ return -1;
+ }
+ }
+
+ if (NULL == (s->ssl_ctx = SSL_CTX_new(SSLv23_server_method()))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ ERR_error_string(ERR_get_error(), NULL));
+ return -1;
+ }
+
+ if (buffer_is_empty(s->ssl_pemfile)) {
log_error_write(srv, __FILE__, __LINE__, "s", "ssl.pemfile has to be set");
- goto error_free_socket;
+ return -1;
}
+
+ if (!buffer_is_empty(s->ssl_ca_file)) {
+ if (1 != SSL_CTX_load_verify_locations(s->ssl_ctx, s->ssl_ca_file->ptr, NULL)) {
+ log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
+ ERR_error_string(ERR_get_error(), NULL), s->ssl_ca_file);
+ return -1;
+ }
+ }
+
+ if (SSL_CTX_use_certificate_file(s->ssl_ctx, s->ssl_pemfile->ptr, SSL_FILETYPE_PEM) < 0) {
+ log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
+ ERR_error_string(ERR_get_error(), NULL), s->ssl_pemfile);
+ return -1;
+ }
+
+ if (SSL_CTX_use_PrivateKey_file (s->ssl_ctx, s->ssl_pemfile->ptr, SSL_FILETYPE_PEM) < 0) {
+ log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
+ ERR_error_string(ERR_get_error(), NULL), s->ssl_pemfile);
+ return -1;
+ }
+
+ if (SSL_CTX_check_private_key(s->ssl_ctx) != 1) {
+ log_error_write(srv, __FILE__, __LINE__, "sssb", "SSL:",
+ "Private key does not match the certificate public key, reason:",
+ ERR_error_string(ERR_get_error(), NULL),
+ s->ssl_pemfile);
+ return -1;
+ }
+ srv_socket->ssl_ctx = s->ssl_ctx;
#else
-
+
buffer_free(srv_socket->srv_token);
free(srv_socket);
-
+
buffer_free(b);
-
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
"ssl requested but openssl support is not compiled in");
-
- goto error_free_socket;
-#endif
-#ifdef TCP_DEFER_ACCEPT
- } else if (s->defer_accept) {
- int v = s->defer_accept;
- if (-1 == setsockopt(srv_socket->fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, &v, sizeof(v))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "can't set TCP_DEFER_ACCEPT: ", strerror(errno));
- }
+
+ return -1;
#endif
} else {
#ifdef SO_ACCEPTFILTER
- /* FreeBSD accf_http filter */
- struct accept_filter_arg afa;
+ /*
+ * FreeBSD accf_http filter
+ *
+ */
memset(&afa, 0, sizeof(afa));
strcpy(afa.af_name, "httpready");
if (setsockopt(srv_socket->fd, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa)) < 0) {
@@ -427,9 +351,10 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
}
#endif
}
-
+
srv_socket->is_ssl = s->is_ssl;
-
+ srv_socket->fde_ndx = -1;
+
if (srv->srv_sockets.size == 0) {
srv->srv_sockets.size = 4;
srv->srv_sockets.used = 0;
@@ -438,51 +363,36 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
srv->srv_sockets.size += 4;
srv->srv_sockets.ptr = realloc(srv->srv_sockets.ptr, srv->srv_sockets.size * sizeof(server_socket));
}
-
+
srv->srv_sockets.ptr[srv->srv_sockets.used++] = srv_socket;
-
+
buffer_free(b);
-
+
return 0;
-
-error_free_socket:
- if (srv_socket->fd != -1) {
- /* check if server fd are already registered */
- if (srv_socket->fde_ndx != -1) {
- fdevent_event_del(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd);
- fdevent_unregister(srv->ev, srv_socket->fd);
- }
-
- close(srv_socket->fd);
- }
- buffer_free(srv_socket->srv_token);
- free(srv_socket);
-
- return -1;
}
int network_close(server *srv) {
size_t i;
for (i = 0; i < srv->srv_sockets.used; i++) {
server_socket *srv_socket = srv->srv_sockets.ptr[i];
-
+
if (srv_socket->fd != -1) {
/* check if server fd are already registered */
if (srv_socket->fde_ndx != -1) {
fdevent_event_del(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd);
fdevent_unregister(srv->ev, srv_socket->fd);
}
-
+
close(srv_socket->fd);
}
-
+
buffer_free(srv_socket->srv_token);
-
+
free(srv_socket);
}
-
+
free(srv->srv_sockets.ptr);
-
+
return 0;
}
@@ -499,62 +409,11 @@ int network_init(server *srv) {
buffer *b;
size_t i;
network_backend_t backend;
-
-#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
-#ifndef OPENSSL_NO_ECDH
- EC_KEY *ecdh;
- int nid;
-#endif
-#endif
-
-#ifdef USE_OPENSSL
- DH *dh;
- BIO *bio;
-
- /* 1024-bit MODP Group with 160-bit prime order subgroup (RFC5114)
- * -----BEGIN DH PARAMETERS-----
- * MIIBDAKBgQCxC4+WoIDgHd6S3l6uXVTsUsmfvPsGo8aaap3KUtI7YWBz4oZ1oj0Y
- * mDjvHi7mUsAT7LSuqQYRIySXXDzUm4O/rMvdfZDEvXCYSI6cIZpzck7/1vrlZEc4
- * +qMaT/VbzMChUa9fDci0vUW/N982XBpl5oz9p21NpwjfH7K8LkpDcQKBgQCk0cvV
- * w/00EmdlpELvuZkF+BBN0lisUH/WQGz/FCZtMSZv6h5cQVZLd35pD1UE8hMWAhe0
- * sBuIal6RVH+eJ0n01/vX07mpLuGQnQ0iY/gKdqaiTAh6CR9THb8KAWm2oorWYqTR
- * jnOvoy13nVkY0IvIhY9Nzvl8KiSFXm7rIrOy5QICAKA=
- * -----END DH PARAMETERS-----
- */
-
- static const unsigned char dh1024_p[]={
- 0xB1,0x0B,0x8F,0x96,0xA0,0x80,0xE0,0x1D,0xDE,0x92,0xDE,0x5E,
- 0xAE,0x5D,0x54,0xEC,0x52,0xC9,0x9F,0xBC,0xFB,0x06,0xA3,0xC6,
- 0x9A,0x6A,0x9D,0xCA,0x52,0xD2,0x3B,0x61,0x60,0x73,0xE2,0x86,
- 0x75,0xA2,0x3D,0x18,0x98,0x38,0xEF,0x1E,0x2E,0xE6,0x52,0xC0,
- 0x13,0xEC,0xB4,0xAE,0xA9,0x06,0x11,0x23,0x24,0x97,0x5C,0x3C,
- 0xD4,0x9B,0x83,0xBF,0xAC,0xCB,0xDD,0x7D,0x90,0xC4,0xBD,0x70,
- 0x98,0x48,0x8E,0x9C,0x21,0x9A,0x73,0x72,0x4E,0xFF,0xD6,0xFA,
- 0xE5,0x64,0x47,0x38,0xFA,0xA3,0x1A,0x4F,0xF5,0x5B,0xCC,0xC0,
- 0xA1,0x51,0xAF,0x5F,0x0D,0xC8,0xB4,0xBD,0x45,0xBF,0x37,0xDF,
- 0x36,0x5C,0x1A,0x65,0xE6,0x8C,0xFD,0xA7,0x6D,0x4D,0xA7,0x08,
- 0xDF,0x1F,0xB2,0xBC,0x2E,0x4A,0x43,0x71,
- };
-
- static const unsigned char dh1024_g[]={
- 0xA4,0xD1,0xCB,0xD5,0xC3,0xFD,0x34,0x12,0x67,0x65,0xA4,0x42,
- 0xEF,0xB9,0x99,0x05,0xF8,0x10,0x4D,0xD2,0x58,0xAC,0x50,0x7F,
- 0xD6,0x40,0x6C,0xFF,0x14,0x26,0x6D,0x31,0x26,0x6F,0xEA,0x1E,
- 0x5C,0x41,0x56,0x4B,0x77,0x7E,0x69,0x0F,0x55,0x04,0xF2,0x13,
- 0x16,0x02,0x17,0xB4,0xB0,0x1B,0x88,0x6A,0x5E,0x91,0x54,0x7F,
- 0x9E,0x27,0x49,0xF4,0xD7,0xFB,0xD7,0xD3,0xB9,0xA9,0x2E,0xE1,
- 0x90,0x9D,0x0D,0x22,0x63,0xF8,0x0A,0x76,0xA6,0xA2,0x4C,0x08,
- 0x7A,0x09,0x1F,0x53,0x1D,0xBF,0x0A,0x01,0x69,0xB6,0xA2,0x8A,
- 0xD6,0x62,0xA4,0xD1,0x8E,0x73,0xAF,0xA3,0x2D,0x77,0x9D,0x59,
- 0x18,0xD0,0x8B,0xC8,0x85,0x8F,0x4D,0xCE,0xF9,0x7C,0x2A,0x24,
- 0x85,0x5E,0x6E,0xEB,0x22,0xB3,0xB2,0xE5,
- };
-#endif
-
- struct nb_map {
- network_backend_t nb;
- const char *name;
- } network_backends[] = {
+
+ struct nb_map {
+ network_backend_t nb;
+ const char *name;
+ } network_backends[] = {
/* lowest id wins */
#if defined USE_LINUX_SENDFILE
{ NETWORK_BACKEND_LINUX_SENDFILE, "linux-sendfile" },
@@ -571,218 +430,18 @@ int network_init(server *srv) {
{ NETWORK_BACKEND_WRITE, "write" },
{ NETWORK_BACKEND_UNSET, NULL }
};
-
-#ifdef USE_OPENSSL
- /* load SSL certificates */
- for (i = 0; i < srv->config_context->used; i++) {
- specific_config *s = srv->config_storage[i];
-#ifndef SSL_OP_NO_COMPRESSION
-# define SSL_OP_NO_COMPRESSION 0
-#endif
- long ssloptions =
- SSL_OP_ALL | SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | SSL_OP_NO_COMPRESSION;
-
- if (buffer_is_empty(s->ssl_pemfile)) continue;
-
-#ifdef OPENSSL_NO_TLSEXT
- {
- data_config *dc = (data_config *)srv->config_context->data[i];
- if (COMP_HTTP_HOST == dc->comp) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- "can't use ssl.pemfile with $HTTP[\"host\"], openssl version does not support TLS extensions");
- return -1;
- }
- }
-#endif
-
- if (srv->ssl_is_init == 0) {
- SSL_load_error_strings();
- SSL_library_init();
- OpenSSL_add_all_algorithms();
- srv->ssl_is_init = 1;
-
- if (0 == RAND_status()) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- "not enough entropy in the pool");
- return -1;
- }
- }
-
- if (NULL == (s->ssl_ctx = SSL_CTX_new(SSLv23_server_method()))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- ERR_error_string(ERR_get_error(), NULL));
- return -1;
- }
-
- SSL_CTX_set_options(s->ssl_ctx, ssloptions);
- SSL_CTX_set_info_callback(s->ssl_ctx, ssl_info_callback);
-
- if (!s->ssl_use_sslv2) {
- /* disable SSLv2 */
- if (!(SSL_OP_NO_SSLv2 & SSL_CTX_set_options(s->ssl_ctx, SSL_OP_NO_SSLv2))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- ERR_error_string(ERR_get_error(), NULL));
- return -1;
- }
- }
-
- if (!s->ssl_use_sslv3) {
- /* disable SSLv3 */
- if (!(SSL_OP_NO_SSLv3 & SSL_CTX_set_options(s->ssl_ctx, SSL_OP_NO_SSLv3))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- ERR_error_string(ERR_get_error(), NULL));
- return -1;
- }
- }
-
- if (!buffer_is_empty(s->ssl_cipher_list)) {
- /* Disable support for low encryption ciphers */
- if (SSL_CTX_set_cipher_list(s->ssl_ctx, s->ssl_cipher_list->ptr) != 1) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- ERR_error_string(ERR_get_error(), NULL));
- return -1;
- }
-
- if (s->ssl_honor_cipher_order) {
- SSL_CTX_set_options(s->ssl_ctx, SSL_OP_CIPHER_SERVER_PREFERENCE);
- }
- }
-
- /* Support for Diffie-Hellman key exchange */
- if (!buffer_is_empty(s->ssl_dh_file)) {
- /* DH parameters from file */
- bio = BIO_new_file((char *) s->ssl_dh_file->ptr, "r");
- if (bio == NULL) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL: Unable to open file", s->ssl_dh_file->ptr);
- return -1;
- }
- dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
- BIO_free(bio);
- if (dh == NULL) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL: PEM_read_bio_DHparams failed", s->ssl_dh_file->ptr);
- return -1;
- }
- } else {
- /* Default DH parameters from RFC5114 */
- dh = DH_new();
- if (dh == NULL) {
- log_error_write(srv, __FILE__, __LINE__, "s", "SSL: DH_new () failed");
- return -1;
- }
- dh->p = BN_bin2bn(dh1024_p,sizeof(dh1024_p), NULL);
- dh->g = BN_bin2bn(dh1024_g,sizeof(dh1024_g), NULL);
- dh->length = 160;
- if ((dh->p == NULL) || (dh->g == NULL)) {
- DH_free(dh);
- log_error_write(srv, __FILE__, __LINE__, "s", "SSL: BN_bin2bn () failed");
- return -1;
- }
- }
- SSL_CTX_set_tmp_dh(s->ssl_ctx,dh);
- SSL_CTX_set_options(s->ssl_ctx,SSL_OP_SINGLE_DH_USE);
- DH_free(dh);
-
-#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
-#ifndef OPENSSL_NO_ECDH
- /* Support for Elliptic-Curve Diffie-Hellman key exchange */
- if (!buffer_is_empty(s->ssl_ec_curve)) {
- /* OpenSSL only supports the "named curves" from RFC 4492, section 5.1.1. */
- nid = OBJ_sn2nid((char *) s->ssl_ec_curve->ptr);
- if (nid == 0) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL: Unknown curve name", s->ssl_ec_curve->ptr);
- return -1;
- }
- } else {
- /* Default curve */
- nid = OBJ_sn2nid("prime256v1");
- }
- ecdh = EC_KEY_new_by_curve_name(nid);
- if (ecdh == NULL) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL: Unable to create curve", s->ssl_ec_curve->ptr);
- return -1;
- }
- SSL_CTX_set_tmp_ecdh(s->ssl_ctx,ecdh);
- SSL_CTX_set_options(s->ssl_ctx,SSL_OP_SINGLE_ECDH_USE);
- EC_KEY_free(ecdh);
-#endif
-#endif
-
- if (!buffer_is_empty(s->ssl_ca_file)) {
- if (1 != SSL_CTX_load_verify_locations(s->ssl_ctx, s->ssl_ca_file->ptr, NULL)) {
- log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
- ERR_error_string(ERR_get_error(), NULL), s->ssl_ca_file);
- return -1;
- }
- if (s->ssl_verifyclient) {
- STACK_OF(X509_NAME) *certs = SSL_load_client_CA_file(s->ssl_ca_file->ptr);
- if (!certs) {
- log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
- ERR_error_string(ERR_get_error(), NULL), s->ssl_ca_file);
- }
- if (SSL_CTX_set_session_id_context(s->ssl_ctx, (void*) &srv, sizeof(srv)) != 1) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- ERR_error_string(ERR_get_error(), NULL));
- return -1;
- }
- SSL_CTX_set_client_CA_list(s->ssl_ctx, certs);
- SSL_CTX_set_verify(
- s->ssl_ctx,
- SSL_VERIFY_PEER | (s->ssl_verifyclient_enforce ? SSL_VERIFY_FAIL_IF_NO_PEER_CERT : 0),
- NULL
- );
- SSL_CTX_set_verify_depth(s->ssl_ctx, s->ssl_verifyclient_depth);
- }
- } else if (s->ssl_verifyclient) {
- log_error_write(
- srv, __FILE__, __LINE__, "s",
- "SSL: You specified ssl.verifyclient.activate but no ca_file"
- );
- }
-
- if (SSL_CTX_use_certificate_file(s->ssl_ctx, s->ssl_pemfile->ptr, SSL_FILETYPE_PEM) < 0) {
- log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
- ERR_error_string(ERR_get_error(), NULL), s->ssl_pemfile);
- return -1;
- }
-
- if (SSL_CTX_use_PrivateKey_file (s->ssl_ctx, s->ssl_pemfile->ptr, SSL_FILETYPE_PEM) < 0) {
- log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
- ERR_error_string(ERR_get_error(), NULL), s->ssl_pemfile);
- return -1;
- }
-
- if (SSL_CTX_check_private_key(s->ssl_ctx) != 1) {
- log_error_write(srv, __FILE__, __LINE__, "sssb", "SSL:",
- "Private key does not match the certificate public key, reason:",
- ERR_error_string(ERR_get_error(), NULL),
- s->ssl_pemfile);
- return -1;
- }
- SSL_CTX_set_default_read_ahead(s->ssl_ctx, 1);
- SSL_CTX_set_mode(s->ssl_ctx, SSL_CTX_get_mode(s->ssl_ctx) | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
-
-# ifndef OPENSSL_NO_TLSEXT
- if (!SSL_CTX_set_tlsext_servername_callback(s->ssl_ctx, network_ssl_servername_callback) ||
- !SSL_CTX_set_tlsext_servername_arg(s->ssl_ctx, srv)) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- "failed to initialize TLS servername callback, openssl library does not support TLS servername extension");
- return -1;
- }
-# endif
- }
-#endif
-
+
b = buffer_init();
-
+
buffer_copy_string_buffer(b, srv->srvconf.bindhost);
- buffer_append_string_len(b, CONST_STR_LEN(":"));
+ buffer_append_string(b, ":");
buffer_append_long(b, srv->srvconf.port);
-
+
if (0 != network_server_init(srv, b, srv->config_storage[0])) {
return -1;
}
buffer_free(b);
-
+
#ifdef USE_OPENSSL
srv->network_ssl_backend_write = network_write_chunkqueue_openssl;
#endif
@@ -802,8 +461,8 @@ int network_init(server *srv) {
if (NULL == network_backends[i].name) {
/* we don't know it */
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "server.network-backend has a unknown value:",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "server.network-backend has a unknown value:",
srv->srvconf.network_backend);
return -1;
@@ -821,17 +480,17 @@ int network_init(server *srv) {
#endif
#ifdef USE_LINUX_SENDFILE
case NETWORK_BACKEND_LINUX_SENDFILE:
- srv->network_backend_write = network_write_chunkqueue_linuxsendfile;
+ srv->network_backend_write = network_write_chunkqueue_linuxsendfile;
break;
#endif
#ifdef USE_FREEBSD_SENDFILE
case NETWORK_BACKEND_FREEBSD_SENDFILE:
- srv->network_backend_write = network_write_chunkqueue_freebsdsendfile;
+ srv->network_backend_write = network_write_chunkqueue_freebsdsendfile;
break;
#endif
#ifdef USE_SOLARIS_SENDFILEV
case NETWORK_BACKEND_SOLARIS_SENDFILEV:
- srv->network_backend_write = network_write_chunkqueue_solarissendfilev;
+ srv->network_backend_write = network_write_chunkqueue_solarissendfilev;
break;
#endif
default:
@@ -842,85 +501,63 @@ int network_init(server *srv) {
for (i = 1; i < srv->config_context->used; i++) {
data_config *dc = (data_config *)srv->config_context->data[i];
specific_config *s = srv->config_storage[i];
- size_t j;
-
+
/* not our stage */
if (COMP_SERVER_SOCKET != dc->comp) continue;
-
- if (dc->cond != CONFIG_COND_EQ) continue;
-
- /* check if we already know this socket,
- * if yes, don't init it */
- for (j = 0; j < srv->srv_sockets.used; j++) {
- if (buffer_is_equal(srv->srv_sockets.ptr[j]->srv_token, dc->string)) {
- break;
- }
+
+ if (dc->cond != CONFIG_COND_EQ) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "only == is allowed for $SERVER[\"socket\"].");
+
+ return -1;
}
-
- if (j == srv->srv_sockets.used) {
- if (0 != network_server_init(srv, dc->string, s)) return -1;
+
+ if (0 != network_server_init(srv, dc->string, s)) {
+ return -1;
}
}
-
+
+
return 0;
}
int network_register_fdevents(server *srv) {
size_t i;
-
+
if (-1 == fdevent_reset(srv->ev)) {
return -1;
}
-
+
/* register fdevents after reset */
for (i = 0; i < srv->srv_sockets.used; i++) {
server_socket *srv_socket = srv->srv_sockets.ptr[i];
-
+
fdevent_register(srv->ev, srv_socket->fd, network_server_handle_fdevent, srv_socket);
- fdevent_event_set(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd, FDEVENT_IN);
+ fdevent_event_add(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd, FDEVENT_IN);
}
return 0;
}
-int network_write_chunkqueue(server *srv, connection *con, chunkqueue *cq, off_t max_bytes) {
+int network_write_chunkqueue(server *srv, connection *con, chunkqueue *cq) {
int ret = -1;
off_t written = 0;
-#ifdef TCP_CORK
+#ifdef TCP_CORK
int corked = 0;
#endif
server_socket *srv_socket = con->srv_socket;
- if (con->conf.global_kbytes_per_second) {
- off_t limit = con->conf.global_kbytes_per_second * 1024 - *(con->conf.global_bytes_per_second_cnt_ptr);
- if (limit <= 0) {
- /* we reached the global traffic limit */
-
- con->traffic_limit_reached = 1;
- joblist_append(srv, con);
-
- return 1;
- } else {
- if (max_bytes > limit) max_bytes = limit;
- }
- }
-
- if (con->conf.kbytes_per_second) {
- off_t limit = con->conf.kbytes_per_second * 1024 - con->bytes_written_cur_second;
- if (limit <= 0) {
- /* we reached the traffic limit */
+ if (con->conf.global_kbytes_per_second &&
+ *(con->conf.global_bytes_per_second_cnt_ptr) > con->conf.global_kbytes_per_second * 1024) {
+ /* we reached the global traffic limit */
- con->traffic_limit_reached = 1;
- joblist_append(srv, con);
+ con->traffic_limit_reached = 1;
+ joblist_append(srv, con);
- return 1;
- } else {
- if (max_bytes > limit) max_bytes = limit;
- }
- }
+ return 1;
+ }
written = cq->bytes_out;
-#ifdef TCP_CORK
+#ifdef TCP_CORK
/* Linux: put a cork into the socket as we want to combine the write() calls
* but only if we really have multiple chunks
*/
@@ -929,20 +566,20 @@ int network_write_chunkqueue(server *srv, connection *con, chunkqueue *cq, off_t
setsockopt(con->fd, IPPROTO_TCP, TCP_CORK, &corked, sizeof(corked));
}
#endif
-
+
if (srv_socket->is_ssl) {
#ifdef USE_OPENSSL
- ret = srv->network_ssl_backend_write(srv, con, con->ssl, cq, max_bytes);
+ ret = srv->network_ssl_backend_write(srv, con, con->ssl, cq);
#endif
} else {
- ret = srv->network_backend_write(srv, con, con->fd, cq, max_bytes);
+ ret = srv->network_backend_write(srv, con, con->fd, cq);
}
-
+
if (ret >= 0) {
chunkqueue_remove_finished_chunks(cq);
ret = chunkqueue_is_empty(cq) ? 0 : 1;
}
-
+
#ifdef TCP_CORK
if (corked) {
corked = 0;
@@ -955,6 +592,13 @@ int network_write_chunkqueue(server *srv, connection *con, chunkqueue *cq, off_t
con->bytes_written_cur_second += written;
*(con->conf.global_bytes_per_second_cnt_ptr) += written;
-
+
+ if (con->conf.kbytes_per_second &&
+ (con->bytes_written_cur_second > con->conf.kbytes_per_second * 1024)) {
+ /* we reached the traffic limit */
+
+ con->traffic_limit_reached = 1;
+ joblist_append(srv, con);
+ }
return ret;
}
diff --git a/src/network.h b/src/network.h
index d9d4e7a..99c7596 100644
--- a/src/network.h
+++ b/src/network.h
@@ -3,7 +3,7 @@
#include "server.h"
-int network_write_chunkqueue(server *srv, connection *con, chunkqueue *c, off_t max_bytes);
+int network_write_chunkqueue(server *srv, connection *con, chunkqueue *c);
int network_init(server *srv);
int network_close(server *srv);
diff --git a/src/network_backends.h b/src/network_backends.h
index 5813253..94650a7 100644
--- a/src/network_backends.h
+++ b/src/network_backends.h
@@ -2,9 +2,8 @@
#define _NETWORK_BACKENDS_H_
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
#endif
-#include "settings.h"
#include <sys/types.h>
@@ -15,7 +14,7 @@
# include <sys/uio.h>
#endif
-#if defined HAVE_SYS_UIO_H && defined HAVE_SENDFILE && defined HAVE_WRITEV && (defined(__FreeBSD__) || defined(__DragonFly__))
+#if defined HAVE_SYS_UIO_H && defined HAVE_SENDFILE && defined HAVE_WRITEV && defined(__FreeBSD__)
# define USE_FREEBSD_SENDFILE
# include <sys/uio.h>
#endif
@@ -31,7 +30,7 @@
# include <sys/uio.h>
#endif
-#if defined HAVE_SYS_MMAN_H && defined HAVE_MMAP && defined ENABLE_MMAP
+#if defined HAVE_SYS_MMAN_H && defined HAVE_MMAP
# define USE_MMAP
# include <sys/mman.h>
/* NetBSD 1.3.x needs it */
@@ -46,19 +45,14 @@
#include "base.h"
-/* return values:
- * >= 0 : no error
- * -1 : error (on our side)
- * -2 : remote close
- */
-int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
-int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
-int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
-int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
-int network_write_chunkqueue_solarissendfilev(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
+int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqueue *cq);
+int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkqueue *cq);
+int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd, chunkqueue *cq);
+int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, int fd, chunkqueue *cq);
+int network_write_chunkqueue_solarissendfilev(server *srv, connection *con, int fd, chunkqueue *cq);
#ifdef USE_OPENSSL
-int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chunkqueue *cq, off_t max_bytes);
+int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chunkqueue *cq);
#endif
#endif
diff --git a/src/network_freebsd_sendfile.c b/src/network_freebsd_sendfile.c
index 7b165fc..a6994c0 100644
--- a/src/network_freebsd_sendfile.c
+++ b/src/network_freebsd_sendfile.c
@@ -2,11 +2,6 @@
#ifdef USE_FREEBSD_SENDFILE
-#include "network.h"
-#include "fdevent.h"
-#include "log.h"
-#include "stat_cache.h"
-
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -23,38 +18,46 @@
#include <string.h>
#include <stdlib.h>
+#include "network.h"
+#include "fdevent.h"
+#include "log.h"
+#include "stat_cache.h"
+
#ifndef UIO_MAXIOV
-# if defined(__FreeBSD__) || defined(__DragonFly__)
-/* FreeBSD 4.7, 4.9 defined it in sys/uio.h only if _KERNEL is specified */
+# ifdef __FreeBSD__
+/* FreeBSD 4.7, 4.9 defined it in sys/uio.h only if _KERNEL is specified */
# define UIO_MAXIOV 1024
# endif
#endif
-int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes) {
+int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, int fd, chunkqueue *cq) {
chunk *c;
-
- for(c = cq->first; (max_bytes > 0) && (NULL != c); c = c->next) {
+ size_t chunks_written = 0;
+
+ for(c = cq->first; c; c = c->next, chunks_written++) {
int chunk_finished = 0;
-
+
switch(c->type) {
case MEM_CHUNK: {
char * offset;
- off_t toSend;
+ size_t toSend;
ssize_t r;
-
+
size_t num_chunks, i;
struct iovec chunks[UIO_MAXIOV];
chunk *tc;
size_t num_bytes = 0;
-
- /* build writev list
- *
+
+ /* we can't send more then SSIZE_MAX bytes in one chunk */
+
+ /* build writev list
+ *
* 1. limit: num_chunks < UIO_MAXIOV
- * 2. limit: num_bytes < max_bytes
+ * 2. limit: num_bytes < SSIZE_MAX
*/
for(num_chunks = 0, tc = c; tc && tc->type == MEM_CHUNK && num_chunks < UIO_MAXIOV; num_chunks++, tc = tc->next);
-
+
for(tc = c, i = 0; i < num_chunks; tc = tc->next, i++) {
if (tc->mem->used == 0) {
chunks[i].iov_base = tc->mem->ptr;
@@ -62,160 +65,143 @@ int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, int f
} else {
offset = tc->mem->ptr + tc->offset;
toSend = tc->mem->used - 1 - tc->offset;
-
+
chunks[i].iov_base = offset;
-
+
/* protect the return value of writev() */
- if (toSend > max_bytes ||
- (off_t) num_bytes + toSend > max_bytes) {
- chunks[i].iov_len = max_bytes - num_bytes;
-
+ if (toSend > SSIZE_MAX ||
+ num_bytes + toSend > SSIZE_MAX) {
+ chunks[i].iov_len = SSIZE_MAX - num_bytes;
+
num_chunks = i + 1;
break;
} else {
chunks[i].iov_len = toSend;
}
-
+
num_bytes += toSend;
}
}
-
+
if ((r = writev(fd, chunks, num_chunks)) < 0) {
switch (errno) {
case EAGAIN:
case EINTR:
r = 0;
break;
- case ENOTCONN:
case EPIPE:
case ECONNRESET:
return -2;
default:
- log_error_write(srv, __FILE__, __LINE__, "ssd",
+ log_error_write(srv, __FILE__, __LINE__, "ssd",
"writev failed:", strerror(errno), fd);
-
+
return -1;
}
r = 0;
}
-
+
/* check which chunks have been written */
cq->bytes_out += r;
- max_bytes -= r;
-
+
for(i = 0, tc = c; i < num_chunks; i++, tc = tc->next) {
if (r >= (ssize_t)chunks[i].iov_len) {
/* written */
r -= chunks[i].iov_len;
tc->offset += chunks[i].iov_len;
-
+
if (chunk_finished) {
/* skip the chunks from further touches */
+ chunks_written++;
c = c->next;
} else {
/* chunks_written + c = c->next is done in the for()*/
- chunk_finished = 1;
+ chunk_finished++;
}
} else {
/* partially written */
-
+
tc->offset += r;
chunk_finished = 0;
-
+
break;
}
}
-
+
break;
}
case FILE_CHUNK: {
off_t offset, r;
- off_t toSend;
+ size_t toSend;
stat_cache_entry *sce = NULL;
-
+ int ifd;
+
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, c->file.name, &sce)) {
log_error_write(srv, __FILE__, __LINE__, "sb",
strerror(errno), c->file.name);
return -1;
}
-
+
offset = c->file.start + c->offset;
- toSend = c->file.length - c->offset;
- if (toSend > max_bytes) toSend = max_bytes;
-
- if (-1 == c->file.fd) {
- if (-1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno));
-
- return -1;
- }
-
-#ifdef FD_CLOEXEC
- fcntl(c->file.fd, F_SETFD, FD_CLOEXEC);
-#endif
+ /* limit the toSend to 2^31-1 bytes in a chunk */
+ toSend = c->file.length - c->offset > ((1 << 30) - 1) ?
+ ((1 << 30) - 1) : c->file.length - c->offset;
+
+ if (offset > sce->st.st_size) {
+ log_error_write(srv, __FILE__, __LINE__, "sb", "file was shrinked:", c->file.name);
+
+ return -1;
}
-
+
+ if (-1 == (ifd = open(c->file.name->ptr, O_RDONLY))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno));
+
+ return -1;
+ }
+
r = 0;
-
+
/* FreeBSD sendfile() */
- if (-1 == sendfile(c->file.fd, fd, offset, toSend, NULL, &r, 0)) {
+ if (-1 == sendfile(ifd, fd, offset, toSend, NULL, &r, 0)) {
switch(errno) {
case EAGAIN:
- case EINTR:
- /* for EAGAIN/EINTR r still contains the sent bytes */
- break; /* try again later */
- case EPIPE:
+ break;
case ENOTCONN:
+ close(ifd);
return -2;
default:
log_error_write(srv, __FILE__, __LINE__, "ssd", "sendfile: ", strerror(errno), errno);
+ close(ifd);
return -1;
}
- } else if (r == 0) {
- /* We got an event to write but we wrote nothing
- *
- * - the file shrinked -> error
- * - the remote side closed inbetween -> remote-close */
-
- if (HANDLER_ERROR == stat_cache_get_entry(srv, con, c->file.name, &sce)) {
- /* file is gone ? */
- return -1;
- }
-
- if (offset >= sce->st.st_size) {
- /* file shrinked, close the connection */
- return -1;
- }
-
- return -2;
}
-
+ close(ifd);
+
c->offset += r;
cq->bytes_out += r;
- max_bytes -= r;
-
+
if (c->offset == c->file.length) {
chunk_finished = 1;
}
-
+
break;
}
default:
-
+
log_error_write(srv, __FILE__, __LINE__, "ds", c, "type not known");
-
+
return -1;
}
-
+
if (!chunk_finished) {
/* not finished yet */
-
+
break;
}
}
- return 0;
+ return chunks_written;
}
#endif
diff --git a/src/network_linux_sendfile.c b/src/network_linux_sendfile.c
index 9105603..5628a94 100644
--- a/src/network_linux_sendfile.c
+++ b/src/network_linux_sendfile.c
@@ -1,12 +1,6 @@
#include "network_backends.h"
#ifdef USE_LINUX_SENDFILE
-
-#include "network.h"
-#include "fdevent.h"
-#include "log.h"
-#include "stat_cache.h"
-
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -22,37 +16,41 @@
#include <netdb.h>
#include <string.h>
#include <stdlib.h>
-#include <fcntl.h>
-/* on linux 2.4.29 + debian/ubuntu we have crashes if this is enabled */
-#undef HAVE_POSIX_FADVISE
+#include "network.h"
+#include "fdevent.h"
+#include "log.h"
+#include "stat_cache.h"
-int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes) {
+int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd, chunkqueue *cq) {
chunk *c;
-
- for(c = cq->first; (max_bytes > 0) && (NULL != c); c = c->next) {
+ size_t chunks_written = 0;
+
+ for(c = cq->first; c; c = c->next, chunks_written++) {
int chunk_finished = 0;
-
+
switch(c->type) {
case MEM_CHUNK: {
char * offset;
- off_t toSend;
+ size_t toSend;
ssize_t r;
-
+
size_t num_chunks, i;
struct iovec chunks[UIO_MAXIOV];
chunk *tc;
size_t num_bytes = 0;
-
- /* build writev list
- *
+
+ /* we can't send more then SSIZE_MAX bytes in one chunk */
+
+ /* build writev list
+ *
* 1. limit: num_chunks < UIO_MAXIOV
- * 2. limit: num_bytes < max_bytes
+ * 2. limit: num_bytes < SSIZE_MAX
*/
- for (num_chunks = 0, tc = c;
- tc && tc->type == MEM_CHUNK && num_chunks < UIO_MAXIOV;
+ for (num_chunks = 0, tc = c;
+ tc && tc->type == MEM_CHUNK && num_chunks < UIO_MAXIOV;
tc = tc->next, num_chunks++);
-
+
for (tc = c, i = 0; i < num_chunks; tc = tc->next, i++) {
if (tc->mem->used == 0) {
chunks[i].iov_base = tc->mem->ptr;
@@ -60,24 +58,24 @@ int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd,
} else {
offset = tc->mem->ptr + tc->offset;
toSend = tc->mem->used - 1 - tc->offset;
-
+
chunks[i].iov_base = offset;
-
+
/* protect the return value of writev() */
- if (toSend > max_bytes ||
- (off_t) num_bytes + toSend > max_bytes) {
- chunks[i].iov_len = max_bytes - num_bytes;
-
+ if (toSend > SSIZE_MAX ||
+ num_bytes + toSend > SSIZE_MAX) {
+ chunks[i].iov_len = SSIZE_MAX - num_bytes;
+
num_chunks = i + 1;
break;
} else {
chunks[i].iov_len = toSend;
}
-
+
num_bytes += toSend;
}
}
-
+
if ((r = writev(fd, chunks, num_chunks)) < 0) {
switch (errno) {
case EAGAIN:
@@ -88,131 +86,97 @@ int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd,
case ECONNRESET:
return -2;
default:
- log_error_write(srv, __FILE__, __LINE__, "ssd",
+ log_error_write(srv, __FILE__, __LINE__, "ssd",
"writev failed:", strerror(errno), fd);
-
+
return -1;
}
}
-
+
/* check which chunks have been written */
cq->bytes_out += r;
- max_bytes -= r;
for(i = 0, tc = c; i < num_chunks; i++, tc = tc->next) {
if (r >= (ssize_t)chunks[i].iov_len) {
/* written */
r -= chunks[i].iov_len;
tc->offset += chunks[i].iov_len;
-
+
if (chunk_finished) {
/* skip the chunks from further touches */
+ chunks_written++;
c = c->next;
} else {
/* chunks_written + c = c->next is done in the for()*/
- chunk_finished = 1;
+ chunk_finished++;
}
} else {
/* partially written */
-
+
tc->offset += r;
chunk_finished = 0;
-
+
break;
}
}
-
+
break;
}
case FILE_CHUNK: {
ssize_t r;
off_t offset;
- off_t toSend;
+ size_t toSend;
stat_cache_entry *sce = NULL;
-
+
+ if (HANDLER_ERROR == stat_cache_get_entry(srv, con, c->file.name, &sce)) {
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ strerror(errno), c->file.name);
+ return -1;
+ }
+
offset = c->file.start + c->offset;
- toSend = c->file.length - c->offset;
- if (toSend > max_bytes) toSend = max_bytes;
-
- /* open file if not already opened */
+ /* limit the toSend to 2^31-1 bytes in a chunk */
+ toSend = c->file.length - c->offset > ((1 << 30) - 1) ?
+ ((1 << 30) - 1) : c->file.length - c->offset;
+
+ if (offset > sce->st.st_size) {
+ log_error_write(srv, __FILE__, __LINE__, "sb", "file was shrinked:", c->file.name);
+
+ return -1;
+ }
+
+ /* open file if not already opened */
if (-1 == c->file.fd) {
if (-1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno));
-
+
return -1;
}
#ifdef FD_CLOEXEC
fcntl(c->file.fd, F_SETFD, FD_CLOEXEC);
#endif
-#ifdef HAVE_POSIX_FADVISE
- /* tell the kernel that we want to stream the file */
- if (-1 == posix_fadvise(c->file.fd, 0, 0, POSIX_FADV_SEQUENTIAL)) {
- if (ENOSYS != errno) {
- log_error_write(srv, __FILE__, __LINE__, "ssd",
- "posix_fadvise failed:", strerror(errno), c->file.fd);
- }
- }
-#endif
}
-
+
+ /* Linux sendfile() */
if (-1 == (r = sendfile(fd, c->file.fd, &offset, toSend))) {
switch (errno) {
case EAGAIN:
case EINTR:
- /* ok, we can't send more, let's try later again */
r = 0;
break;
case EPIPE:
case ECONNRESET:
return -2;
default:
- log_error_write(srv, __FILE__, __LINE__, "ssd",
+ log_error_write(srv, __FILE__, __LINE__, "ssd",
"sendfile failed:", strerror(errno), fd);
return -1;
}
- } else if (r == 0) {
- int oerrno = errno;
- /* We got an event to write but we wrote nothing
- *
- * - the file shrinked -> error
- * - the remote side closed inbetween -> remote-close */
-
- if (HANDLER_ERROR == stat_cache_get_entry(srv, con, c->file.name, &sce)) {
- /* file is gone ? */
- return -1;
- }
-
- if (offset > sce->st.st_size) {
- /* file shrinked, close the connection */
- errno = oerrno;
-
- return -1;
- }
-
- errno = oerrno;
- return -2;
}
-
-#ifdef HAVE_POSIX_FADVISE
-#if 0
-#define K * 1024
-#define M * 1024 K
-#define READ_AHEAD 4 M
- /* check if we need a new chunk */
- if ((c->offset & ~(READ_AHEAD - 1)) != ((c->offset + r) & ~(READ_AHEAD - 1))) {
- /* tell the kernel that we want to stream the file */
- if (-1 == posix_fadvise(c->file.fd, (c->offset + r) & ~(READ_AHEAD - 1), READ_AHEAD, POSIX_FADV_NOREUSE)) {
- log_error_write(srv, __FILE__, __LINE__, "ssd",
- "posix_fadvise failed:", strerror(errno), c->file.fd);
- }
- }
-#endif
-#endif
-
+
c->offset += r;
cq->bytes_out += r;
- max_bytes -= r;
-
+
if (c->offset == c->file.length) {
chunk_finished = 1;
@@ -223,24 +187,24 @@ int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd,
c->file.fd = -1;
}
}
-
+
break;
}
default:
-
+
log_error_write(srv, __FILE__, __LINE__, "ds", c, "type not known");
-
+
return -1;
}
-
+
if (!chunk_finished) {
/* not finished yet */
-
+
break;
}
}
- return 0;
+ return chunks_written;
}
#endif
diff --git a/src/network_openssl.c b/src/network_openssl.c
index 7bed710..b6a1b2f 100644
--- a/src/network_openssl.c
+++ b/src/network_openssl.c
@@ -1,12 +1,6 @@
#include "network_backends.h"
#ifdef USE_OPENSSL
-
-#include "network.h"
-#include "fdevent.h"
-#include "log.h"
-#include "stat_cache.h"
-
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -24,16 +18,22 @@
#include <stdlib.h>
#include <assert.h>
-# include <openssl/ssl.h>
-# include <openssl/err.h>
+#include "network.h"
+#include "fdevent.h"
+#include "log.h"
+#include "stat_cache.h"
+
+# include <openssl/ssl.h>
+# include <openssl/err.h>
-int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chunkqueue *cq, off_t max_bytes) {
+int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chunkqueue *cq) {
int ssl_r;
chunk *c;
+ size_t chunks_written = 0;
/* this is a 64k sendbuffer
*
- * it has to stay at the same location all the time to satisfy the needs
+ * it has to stay at the same location all the time to satisfy the needs
* of SSL_write to pass the SAME parameter in case of a _WANT_WRITE
*
* the buffer is allocated once, is NOT realloced and is NOT freed at shutdown
@@ -43,14 +43,14 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chu
* In reality we would like to use mmap() but we don't have a guarantee that
* we get the same mmap() address for each call. On openbsd the mmap() address
* even randomized.
- * That means either we keep the mmap() open or we do a read() into a
- * constant buffer
+ * That means either we keep the mmap() open or we do a read() into a
+ * constant buffer
* */
#define LOCAL_SEND_BUFSIZE (64 * 1024)
static char *local_send_buffer = NULL;
/* the remote side closed the connection before without shutdown request
- * - IE
+ * - IE
* - wget
* if keep-alive is disabled */
@@ -58,43 +58,34 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chu
SSL_set_shutdown(ssl, SSL_RECEIVED_SHUTDOWN);
}
- for(c = cq->first; (max_bytes > 0) && (NULL != c); c = c->next) {
+ for(c = cq->first; c; c = c->next) {
int chunk_finished = 0;
-
+
switch(c->type) {
case MEM_CHUNK: {
char * offset;
- off_t toSend;
+ size_t toSend;
ssize_t r;
-
- if (c->mem->used == 0 || c->mem->used == 1) {
+
+ if (c->mem->used == 0) {
chunk_finished = 1;
break;
}
-
+
offset = c->mem->ptr + c->offset;
toSend = c->mem->used - 1 - c->offset;
- if (toSend > max_bytes) toSend = max_bytes;
-
+
/**
* SSL_write man-page
- *
+ *
* WARNING
* When an SSL_write() operation has to be repeated because of
* SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE, it must be
* repeated with the same arguments.
- *
+ *
*/
-
- ERR_clear_error();
- r = SSL_write(ssl, offset, toSend);
-
- if (con->renegotiations > 1 && con->conf.ssl_disable_client_renegotiation) {
- log_error_write(srv, __FILE__, __LINE__, "s", "SSL: renegotiation initiated by client");
- return -1;
- }
-
- if (r <= 0) {
+
+ if ((r = SSL_write(ssl, offset, toSend)) <= 0) {
unsigned long err;
switch ((ssl_r = SSL_get_error(ssl, r))) {
@@ -104,7 +95,7 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chu
/* perhaps we have error waiting in our error-queue */
if (0 != (err = ERR_get_error())) {
do {
- log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
+ log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
ssl_r, r,
ERR_error_string(err, NULL));
} while((err = ERR_get_error()));
@@ -112,47 +103,45 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chu
/* no, but we have errno */
switch(errno) {
case EPIPE:
- case ECONNRESET:
return -2;
default:
- log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL:",
+ log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL:",
ssl_r, r, errno,
strerror(errno));
break;
}
} else {
/* neither error-queue nor errno ? */
- log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL (error):",
+ log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL (error):",
ssl_r, r, errno,
strerror(errno));
}
-
+
return -1;
case SSL_ERROR_ZERO_RETURN:
/* clean shutdown on the remote side */
-
+
if (r == 0) return -2;
-
+
/* fall through */
default:
while((err = ERR_get_error())) {
- log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
+ log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
ssl_r, r,
ERR_error_string(err, NULL));
}
-
+
return -1;
}
} else {
c->offset += r;
cq->bytes_out += r;
- max_bytes -= r;
}
-
+
if (c->offset == (off_t)c->mem->used - 1) {
chunk_finished = 1;
}
-
+
break;
}
case FILE_CHUNK: {
@@ -161,7 +150,7 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chu
stat_cache_entry *sce = NULL;
int ifd;
int write_wait = 0;
-
+
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, c->file.name, &sce)) {
log_error_write(srv, __FILE__, __LINE__, "sb",
strerror(errno), c->file.name);
@@ -175,14 +164,13 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chu
do {
off_t offset = c->file.start + c->offset;
- off_t toSend = c->file.length - c->offset;
- if (toSend > max_bytes) toSend = max_bytes;
+ off_t toSend = c->file.length - c->offset;
if (toSend > LOCAL_SEND_BUFSIZE) toSend = LOCAL_SEND_BUFSIZE;
-
+
if (-1 == (ifd = open(c->file.name->ptr, O_RDONLY))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "open failed:", strerror(errno));
-
+
return -1;
}
@@ -195,18 +183,10 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chu
}
s = local_send_buffer;
-
+
close(ifd);
-
- ERR_clear_error();
- r = SSL_write(ssl, s, toSend);
-
- if (con->renegotiations > 1 && con->conf.ssl_disable_client_renegotiation) {
- log_error_write(srv, __FILE__, __LINE__, "s", "SSL: renegotiation initiated by client");
- return -1;
- }
-
- if (r <= 0) {
+
+ if ((r = SSL_write(ssl, s, toSend)) <= 0) {
unsigned long err;
switch ((ssl_r = SSL_get_error(ssl, r))) {
@@ -217,7 +197,7 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chu
/* perhaps we have error waiting in our error-queue */
if (0 != (err = ERR_get_error())) {
do {
- log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
+ log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
ssl_r, r,
ERR_error_string(err, NULL));
} while((err = ERR_get_error()));
@@ -225,64 +205,64 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chu
/* no, but we have errno */
switch(errno) {
case EPIPE:
- case ECONNRESET:
return -2;
default:
- log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL:",
+ log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL:",
ssl_r, r, errno,
strerror(errno));
break;
}
} else {
/* neither error-queue nor errno ? */
- log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL (error):",
+ log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL (error):",
ssl_r, r, errno,
strerror(errno));
}
-
+
return -1;
case SSL_ERROR_ZERO_RETURN:
/* clean shutdown on the remote side */
-
+
if (r == 0) return -2;
-
+
/* fall thourgh */
default:
while((err = ERR_get_error())) {
- log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
+ log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
ssl_r, r,
ERR_error_string(err, NULL));
}
-
+
return -1;
}
} else {
c->offset += r;
cq->bytes_out += r;
- max_bytes -= r;
}
-
+
if (c->offset == c->file.length) {
chunk_finished = 1;
}
- } while (!chunk_finished && !write_wait && max_bytes > 0);
-
+ } while(!chunk_finished && !write_wait);
+
break;
}
default:
log_error_write(srv, __FILE__, __LINE__, "s", "type not known");
-
+
return -1;
}
-
+
if (!chunk_finished) {
/* not finished yet */
-
+
break;
}
+
+ chunks_written++;
}
- return 0;
+ return chunks_written;
}
#endif
diff --git a/src/network_solaris_sendfilev.c b/src/network_solaris_sendfilev.c
index 2003200..0ab669f 100644
--- a/src/network_solaris_sendfilev.c
+++ b/src/network_solaris_sendfilev.c
@@ -2,11 +2,6 @@
#ifdef USE_SOLARIS_SENDFILEV
-#include "network.h"
-#include "fdevent.h"
-#include "log.h"
-#include "stat_cache.h"
-
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -24,47 +19,53 @@
#include <stdlib.h>
#include <limits.h>
+#include "network.h"
+#include "fdevent.h"
+#include "log.h"
+#include "stat_cache.h"
+
#ifndef UIO_MAXIOV
-# define UIO_MAXIOV IOV_MAX
+#define UIO_MAXIOV IOV_MAX
#endif
/**
- * a very simple sendfilev() interface for solaris which can be optimised a lot more
+ * a very simple sendfilev() interface for solaris which can be optimised a lot more
* as solaris sendfilev() supports 'sending everythin in one syscall()'
- *
- * If you want such an interface and need the performance, just give me an account on
- * a solaris box.
+ *
+ * If you want such an interface and need the performance, just give me an account on
+ * a solaris box.
* - jan@kneschke.de
*/
-int network_write_chunkqueue_solarissendfilev(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes) {
+int network_write_chunkqueue_solarissendfilev(server *srv, connection *con, int fd, chunkqueue *cq) {
chunk *c;
-
- for(c = cq->first; (max_bytes > 0) && (NULL != c); c = c->next) {
+ size_t chunks_written = 0;
+
+ for(c = cq->first; c; c = c->next, chunks_written++) {
int chunk_finished = 0;
-
+
switch(c->type) {
case MEM_CHUNK: {
char * offset;
- off_t toSend;
+ size_t toSend;
ssize_t r;
-
+
size_t num_chunks, i;
struct iovec chunks[UIO_MAXIOV];
chunk *tc;
-
+
size_t num_bytes = 0;
-
+
/* we can't send more then SSIZE_MAX bytes in one chunk */
-
- /* build writev list
- *
+
+ /* build writev list
+ *
* 1. limit: num_chunks < UIO_MAXIOV
* 2. limit: num_bytes < SSIZE_MAX
*/
for(num_chunks = 0, tc = c; tc && tc->type == MEM_CHUNK && num_chunks < UIO_MAXIOV; num_chunks++, tc = tc->next);
-
+
for(tc = c, i = 0; i < num_chunks; tc = tc->next, i++) {
if (tc->mem->used == 0) {
chunks[i].iov_base = tc->mem->ptr;
@@ -72,24 +73,24 @@ int network_write_chunkqueue_solarissendfilev(server *srv, connection *con, int
} else {
offset = tc->mem->ptr + tc->offset;
toSend = tc->mem->used - 1 - tc->offset;
-
+
chunks[i].iov_base = offset;
-
+
/* protect the return value of writev() */
- if (toSend > max_bytes ||
- (off_t) num_bytes + toSend > max_bytes) {
- chunks[i].iov_len = max_bytes - num_bytes;
-
+ if (toSend > SSIZE_MAX ||
+ num_bytes + toSend > SSIZE_MAX) {
+ chunks[i].iov_len = SSIZE_MAX - num_bytes;
+
num_chunks = i + 1;
break;
} else {
chunks[i].iov_len = toSend;
}
-
+
num_bytes += toSend;
}
}
-
+
if ((r = writev(fd, chunks, num_chunks)) < 0) {
switch (errno) {
case EAGAIN:
@@ -100,68 +101,68 @@ int network_write_chunkqueue_solarissendfilev(server *srv, connection *con, int
case ECONNRESET:
return -2;
default:
- log_error_write(srv, __FILE__, __LINE__, "ssd",
+ log_error_write(srv, __FILE__, __LINE__, "ssd",
"writev failed:", strerror(errno), fd);
-
+
return -1;
}
}
-
+
/* check which chunks have been written */
cq->bytes_out += r;
-
+
for(i = 0, tc = c; i < num_chunks; i++, tc = tc->next) {
if (r >= (ssize_t)chunks[i].iov_len) {
/* written */
r -= chunks[i].iov_len;
tc->offset += chunks[i].iov_len;
-
+
if (chunk_finished) {
/* skip the chunks from further touches */
+ chunks_written++;
c = c->next;
} else {
/* chunks_written + c = c->next is done in the for()*/
- chunk_finished = 1;
+ chunk_finished++;
}
} else {
/* partially written */
-
+
tc->offset += r;
chunk_finished = 0;
-
+
break;
}
}
-
+
break;
}
case FILE_CHUNK: {
ssize_t r;
- off_t offset, toSend;
- size_t written;
+ off_t offset;
+ size_t toSend, written;
sendfilevec_t fvec;
stat_cache_entry *sce = NULL;
int ifd;
-
+
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, c->file.name, &sce)) {
log_error_write(srv, __FILE__, __LINE__, "sb",
strerror(errno), c->file.name);
return -1;
}
-
+
offset = c->file.start + c->offset;
toSend = c->file.length - c->offset;
- if (toSend > max_bytes) toSend = max_bytes;
-
+
if (offset > sce->st.st_size) {
log_error_write(srv, __FILE__, __LINE__, "sb", "file was shrinked:", c->file.name);
-
+
return -1;
}
if (-1 == (ifd = open(c->file.name->ptr, O_RDONLY))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno));
-
+
return -1;
}
@@ -169,45 +170,44 @@ int network_write_chunkqueue_solarissendfilev(server *srv, connection *con, int
fvec.sfv_flag = 0;
fvec.sfv_off = offset;
fvec.sfv_len = toSend;
-
+
/* Solaris sendfilev() */
if (-1 == (r = sendfilev(fd, &fvec, 1, &written))) {
if (errno != EAGAIN) {
log_error_write(srv, __FILE__, __LINE__, "ssd", "sendfile: ", strerror(errno), errno);
-
+
close(ifd);
return -1;
}
-
+
r = 0;
}
-
+
close(ifd);
c->offset += written;
cq->bytes_out += written;
- max_bytes -= written;
-
+
if (c->offset == c->file.length) {
chunk_finished = 1;
}
-
+
break;
}
default:
-
+
log_error_write(srv, __FILE__, __LINE__, "ds", c, "type not known");
-
+
return -1;
}
-
+
if (!chunk_finished) {
/* not finished yet */
-
+
break;
}
}
- return 0;
+ return chunks_written;
}
#endif
diff --git a/src/network_write.c b/src/network_write.c
index 6aa6cfa..90fc2ac 100644
--- a/src/network_write.c
+++ b/src/network_write.c
@@ -1,12 +1,3 @@
-#include "network_backends.h"
-
-#include "network.h"
-#include "fdevent.h"
-#include "log.h"
-#include "stat_cache.h"
-
-#include "sys-socket.h"
-
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
@@ -16,69 +7,64 @@
#include <string.h>
#include <stdlib.h>
+#include "network.h"
+#include "fdevent.h"
+#include "log.h"
+#include "stat_cache.h"
+
+#include "sys-socket.h"
+
+#include "network_backends.h"
+
#ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
+#include <sys/resource.h>
#endif
-int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes) {
+int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqueue *cq) {
chunk *c;
-
- for(c = cq->first; (max_bytes > 0) && (NULL != c); c = c->next) {
+ size_t chunks_written = 0;
+
+ for(c = cq->first; c; c = c->next) {
int chunk_finished = 0;
-
+
switch(c->type) {
case MEM_CHUNK: {
char * offset;
- off_t toSend;
+ size_t toSend;
ssize_t r;
-
+
if (c->mem->used == 0) {
chunk_finished = 1;
break;
}
-
+
offset = c->mem->ptr + c->offset;
toSend = c->mem->used - 1 - c->offset;
- if (toSend > max_bytes) toSend = max_bytes;
-
-#ifdef __WIN32
+#ifdef __WIN32
if ((r = send(fd, offset, toSend, 0)) < 0) {
- /* no error handling for windows... */
- log_error_write(srv, __FILE__, __LINE__, "ssd", "send failed: ", strerror(errno), fd);
-
+ log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed: ", strerror(errno), fd);
+
return -1;
}
#else
if ((r = write(fd, offset, toSend)) < 0) {
- switch (errno) {
- case EAGAIN:
- case EINTR:
- r = 0;
- break;
- case EPIPE:
- case ECONNRESET:
- return -2;
- default:
- log_error_write(srv, __FILE__, __LINE__, "ssd",
- "write failed:", strerror(errno), fd);
-
- return -1;
- }
+ log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed: ", strerror(errno), fd);
+
+ return -1;
}
#endif
-
+
c->offset += r;
cq->bytes_out += r;
- max_bytes -= r;
-
+
if (c->offset == (off_t)c->mem->used - 1) {
chunk_finished = 1;
}
-
+
break;
}
case FILE_CHUNK: {
@@ -87,127 +73,92 @@ int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqu
#endif
ssize_t r;
off_t offset;
- off_t toSend;
+ size_t toSend;
stat_cache_entry *sce = NULL;
int ifd;
-
+
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, c->file.name, &sce)) {
log_error_write(srv, __FILE__, __LINE__, "sb",
strerror(errno), c->file.name);
return -1;
}
-
+
offset = c->file.start + c->offset;
toSend = c->file.length - c->offset;
-
- if (toSend > max_bytes) toSend = max_bytes;
-
+
if (offset > sce->st.st_size) {
log_error_write(srv, __FILE__, __LINE__, "sb", "file was shrinked:", c->file.name);
-
+
return -1;
}
if (-1 == (ifd = open(c->file.name->ptr, O_RDONLY))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno));
-
+
return -1;
}
-
-#ifdef USE_MMAP
+
+#if defined USE_MMAP
if (MAP_FAILED == (p = mmap(0, sce->st.st_size, PROT_READ, MAP_SHARED, ifd, 0))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "mmap failed: ", strerror(errno));
close(ifd);
-
+
return -1;
}
close(ifd);
if ((r = write(fd, p + offset, toSend)) <= 0) {
- switch (errno) {
- case EAGAIN:
- case EINTR:
- r = 0;
- break;
- case EPIPE:
- case ECONNRESET:
- munmap(p, sce->st.st_size);
- return -2;
- default:
- log_error_write(srv, __FILE__, __LINE__, "ssd",
- "write failed:", strerror(errno), fd);
- munmap(p, sce->st.st_size);
-
- return -1;
- }
+ log_error_write(srv, __FILE__, __LINE__, "ss", "write failed: ", strerror(errno));
+ munmap(p, sce->st.st_size);
+ return -1;
}
-
+
munmap(p, sce->st.st_size);
-#else /* USE_MMAP */
+#else
buffer_prepare_copy(srv->tmp_buf, toSend);
-
+
lseek(ifd, offset, SEEK_SET);
if (-1 == (toSend = read(ifd, srv->tmp_buf->ptr, toSend))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "read: ", strerror(errno));
close(ifd);
-
+
return -1;
}
close(ifd);
-#ifdef __WIN32
- if ((r = send(fd, srv->tmp_buf->ptr, toSend, 0)) < 0) {
- /* no error handling for windows... */
- log_error_write(srv, __FILE__, __LINE__, "ssd", "send failed: ", strerror(errno), fd);
-
+ if (-1 == (r = send(fd, srv->tmp_buf->ptr, toSend, 0))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "write: ", strerror(errno));
+
return -1;
}
-#else /* __WIN32 */
- if ((r = write(fd, srv->tmp_buf->ptr, toSend)) < 0) {
- switch (errno) {
- case EAGAIN:
- case EINTR:
- r = 0;
- break;
- case EPIPE:
- case ECONNRESET:
- return -2;
- default:
- log_error_write(srv, __FILE__, __LINE__, "ssd",
- "write failed:", strerror(errno), fd);
-
- return -1;
- }
- }
-#endif /* __WIN32 */
-#endif /* USE_MMAP */
-
+#endif
c->offset += r;
cq->bytes_out += r;
- max_bytes -= r;
-
+
if (c->offset == c->file.length) {
chunk_finished = 1;
}
-
+
break;
}
default:
-
+
log_error_write(srv, __FILE__, __LINE__, "ds", c, "type not known");
-
+
return -1;
}
-
+
if (!chunk_finished) {
/* not finished yet */
-
+
break;
}
+
+ chunks_written++;
}
- return 0;
+ return chunks_written;
}
#if 0
diff --git a/src/network_writev.c b/src/network_writev.c
index 65bb19d..fcd06c4 100644
--- a/src/network_writev.c
+++ b/src/network_writev.c
@@ -2,11 +2,6 @@
#ifdef USE_WRITEV
-#include "network.h"
-#include "fdevent.h"
-#include "log.h"
-#include "stat_cache.h"
-
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
@@ -26,53 +21,63 @@
#include <stdio.h>
#include <assert.h>
+#include "network.h"
+#include "fdevent.h"
+#include "log.h"
+#include "stat_cache.h"
+
+#ifndef UIO_MAXIOV
+# if defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+/* FreeBSD 4.7 defines it in sys/uio.h only if _KERNEL is specified */
+# define UIO_MAXIOV 1024
+# elif defined(__sgi)
+/* IRIX 6.5 has sysconf(_SC_IOV_MAX) which might return 512 or bigger */
+# define UIO_MAXIOV 512
+# elif defined(__sun)
+/* Solaris (and SunOS?) defines IOV_MAX instead */
+# ifndef IOV_MAX
+# define UIO_MAXIOV 16
+# else
+# define UIO_MAXIOV IOV_MAX
+# endif
+# elif defined(IOV_MAX)
+# define UIO_MAXIOV IOV_MAX
+# else
+# error UIO_MAXIOV nor IOV_MAX are defined
+# endif
+#endif
+
#if 0
#define LOCAL_BUFFERING 1
#endif
-int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes) {
+int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkqueue *cq) {
chunk *c;
-
- for(c = cq->first; (max_bytes > 0) && (NULL != c); c = c->next) {
+ size_t chunks_written = 0;
+
+ for(c = cq->first; c; c = c->next) {
int chunk_finished = 0;
-
+
switch(c->type) {
case MEM_CHUNK: {
char * offset;
- off_t toSend;
+ size_t toSend;
ssize_t r;
-
+
size_t num_chunks, i;
- struct iovec *chunks;
+ struct iovec chunks[UIO_MAXIOV];
chunk *tc;
size_t num_bytes = 0;
-#if defined(_SC_IOV_MAX) /* IRIX, MacOS X, FreeBSD, Solaris, ... */
- const size_t max_chunks = sysconf(_SC_IOV_MAX);
-#elif defined(IOV_MAX) /* Linux x86 (glibc-2.3.6-3) */
- const size_t max_chunks = IOV_MAX;
-#elif defined(MAX_IOVEC) /* Linux ia64 (glibc-2.3.3-98.28) */
- const size_t max_chunks = MAX_IOVEC;
-#elif defined(UIO_MAXIOV) /* Linux x86 (glibc-2.2.5-233) */
- const size_t max_chunks = UIO_MAXIOV;
-#elif (defined(__FreeBSD__) && __FreeBSD_version < 500000) || defined(__DragonFly__) || defined(__APPLE__)
- /* - FreeBSD 4.x
- * - MacOS X 10.3.x
- * (covered in -DKERNEL)
- * */
- const size_t max_chunks = 1024; /* UIO_MAXIOV value from sys/uio.h */
-#else
-#error "sysconf() doesnt return _SC_IOV_MAX ..., check the output of 'man writev' for the EINVAL error and send the output to jan@kneschke.de"
-#endif
-
- /* build writev list
- *
- * 1. limit: num_chunks < max_chunks
- * 2. limit: num_bytes < max_bytes
+
+ /* we can't send more then SSIZE_MAX bytes in one chunk */
+
+ /* build writev list
+ *
+ * 1. limit: num_chunks < UIO_MAXIOV
+ * 2. limit: num_bytes < SSIZE_MAX
*/
- for (num_chunks = 0, tc = c; tc && tc->type == MEM_CHUNK && num_chunks < max_chunks; num_chunks++, tc = tc->next);
-
- chunks = calloc(num_chunks, sizeof(*chunks));
-
+ for(num_chunks = 0, tc = c; tc && tc->type == MEM_CHUNK && num_chunks < UIO_MAXIOV; num_chunks++, tc = tc->next);
+
for(tc = c, i = 0; i < num_chunks; tc = tc->next, i++) {
if (tc->mem->used == 0) {
chunks[i].iov_base = tc->mem->ptr;
@@ -80,24 +85,24 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
} else {
offset = tc->mem->ptr + tc->offset;
toSend = tc->mem->used - 1 - tc->offset;
-
+
chunks[i].iov_base = offset;
-
+
/* protect the return value of writev() */
- if (toSend > max_bytes ||
- (off_t) num_bytes + toSend > max_bytes) {
- chunks[i].iov_len = max_bytes - num_bytes;
-
+ if (toSend > SSIZE_MAX ||
+ num_bytes + toSend > SSIZE_MAX) {
+ chunks[i].iov_len = SSIZE_MAX - num_bytes;
+
num_chunks = i + 1;
break;
} else {
chunks[i].iov_len = toSend;
}
-
+
num_bytes += toSend;
}
}
-
+
if ((r = writev(fd, chunks, num_chunks)) < 0) {
switch (errno) {
case EAGAIN:
@@ -106,46 +111,43 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
break;
case EPIPE:
case ECONNRESET:
- free(chunks);
return -2;
default:
- log_error_write(srv, __FILE__, __LINE__, "ssd",
+ log_error_write(srv, __FILE__, __LINE__, "ssd",
"writev failed:", strerror(errno), fd);
-
- free(chunks);
+
return -1;
}
}
-
+
cq->bytes_out += r;
- max_bytes -= r;
/* check which chunks have been written */
-
+
for(i = 0, tc = c; i < num_chunks; i++, tc = tc->next) {
if (r >= (ssize_t)chunks[i].iov_len) {
/* written */
r -= chunks[i].iov_len;
tc->offset += chunks[i].iov_len;
-
+
if (chunk_finished) {
/* skip the chunks from further touches */
+ chunks_written++;
c = c->next;
} else {
/* chunks_written + c = c->next is done in the for()*/
- chunk_finished = 1;
+ chunk_finished++;
}
} else {
/* partially written */
-
+
tc->offset += r;
chunk_finished = 0;
break;
}
}
- free(chunks);
-
+
break;
}
case FILE_CHUNK: {
@@ -157,7 +159,7 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
#define KByte * 1024
#define MByte * 1024 KByte
#define GByte * 1024 MByte
- const off_t we_want_to_mmap = 512 KByte;
+ const off_t we_want_to_mmap = 512 KByte;
char *start = NULL;
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, c->file.name, &sce)) {
@@ -167,16 +169,16 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
}
abs_offset = c->file.start + c->offset;
-
+
if (abs_offset > sce->st.st_size) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"file was shrinked:", c->file.name);
-
+
return -1;
}
- /* mmap the buffer
- * - first mmap
+ /* mmap the buffer
+ * - first mmap
* - new mmap as the we are at the end of the last one */
if (c->file.mmap.start == MAP_FAILED ||
abs_offset == (off_t)(c->file.mmap.offset + c->file.mmap.length)) {
@@ -186,7 +188,7 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
* adaptive mem-mapping
* the problem:
* we mmap() the whole file. If someone has alot large files and 32bit
- * machine the virtual address area will be unrun and we will have a failing
+ * machine the virtual address area will be unrun and we will have a failing
* mmap() call.
* solution:
* only mmap 16M in one chunk and move the window as soon as we have finished
@@ -232,7 +234,7 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
if (-1 == c->file.fd) { /* open the file if not already open */
if (-1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) {
log_error_write(srv, __FILE__, __LINE__, "sbs", "open failed for:", c->file.name, strerror(errno));
-
+
return -1;
}
#ifdef FD_CLOEXEC
@@ -243,7 +245,7 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
if (MAP_FAILED == (c->file.mmap.start = mmap(0, to_mmap, PROT_READ, MAP_SHARED, c->file.fd, c->file.mmap.offset))) {
/* close it here, otherwise we'd have to set FD_CLOEXEC */
- log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed:",
+ log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed:",
strerror(errno), c->file.name, c->file.fd);
return -1;
@@ -255,12 +257,10 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
#else
#ifdef HAVE_MADVISE
/* don't advise files < 64Kb */
- if (c->file.mmap.length > (64 KByte)) {
- /* darwin 7 is returning EINVAL all the time and I don't know how to
- * detect this at runtime.i
- *
- * ignore the return value for now */
- madvise(c->file.mmap.start, c->file.mmap.length, MADV_WILLNEED);
+ if (c->file.mmap.length > (64 KByte) &&
+ 0 != madvise(c->file.mmap.start, c->file.mmap.length, MADV_WILLNEED)) {
+ log_error_write(srv, __FILE__, __LINE__, "ssbd", "madvise failed:",
+ strerror(errno), c->file.name, c->file.fd);
}
#endif
#endif
@@ -272,17 +272,15 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
toSend = (c->file.mmap.offset + c->file.mmap.length) - (abs_offset);
if (toSend < 0) {
- log_error_write(srv, __FILE__, __LINE__, "soooo",
+ log_error_write(srv, __FILE__, __LINE__, "soooo",
"toSend is negative:",
toSend,
c->file.mmap.length,
abs_offset,
- c->file.mmap.offset);
+ c->file.mmap.offset);
assert(toSend < 0);
}
- if (toSend > max_bytes) toSend = max_bytes;
-
#ifdef LOCAL_BUFFERING
start = c->mem->ptr;
#else
@@ -299,17 +297,16 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
case ECONNRESET:
return -2;
default:
- log_error_write(srv, __FILE__, __LINE__, "ssd",
+ log_error_write(srv, __FILE__, __LINE__, "ssd",
"write failed:", strerror(errno), fd);
-
+
return -1;
}
}
-
+
c->offset += r;
cq->bytes_out += r;
- max_bytes -= r;
-
+
if (c->offset == c->file.length) {
chunk_finished = 1;
@@ -319,24 +316,26 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
c->file.mmap.start = MAP_FAILED;
}
}
-
+
break;
}
default:
-
+
log_error_write(srv, __FILE__, __LINE__, "ds", c, "type not known");
-
+
return -1;
}
-
+
if (!chunk_finished) {
/* not finished yet */
-
+
break;
}
+
+ chunks_written++;
}
- return 0;
+ return chunks_written;
}
#endif
diff --git a/src/plugin.c b/src/plugin.c
index 55f8b03..b375017 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -1,36 +1,39 @@
-#include "plugin.h"
-#include "log.h"
-
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+#include "plugin.h"
+#include "log.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef HAVE_VALGRIND_VALGRIND_H
-# include <valgrind/valgrind.h>
+#include <valgrind/valgrind.h>
#endif
#ifndef __WIN32
-# include <dlfcn.h>
+#include <dlfcn.h>
#endif
/*
- *
+ *
* if you change this enum to add a new callback, be sure
* - that PLUGIN_FUNC_SIZEOF is the last entry
* - that you add PLUGIN_TO_SLOT twice:
- * 1. as callback-dispatcher
+ * 1. as callback-dispatcher
* 2. in plugins_call_init()
- *
+ *
*/
typedef struct {
PLUGIN_DATA;
} plugin_data;
-typedef enum {
+typedef enum {
PLUGIN_FUNC_UNSET,
- PLUGIN_FUNC_HANDLE_URI_CLEAN,
- PLUGIN_FUNC_HANDLE_URI_RAW,
+ PLUGIN_FUNC_HANDLE_URI_CLEAN,
+ PLUGIN_FUNC_HANDLE_URI_RAW,
PLUGIN_FUNC_HANDLE_REQUEST_DONE,
PLUGIN_FUNC_HANDLE_CONNECTION_CLOSE,
PLUGIN_FUNC_HANDLE_TRIGGER,
@@ -41,18 +44,18 @@ typedef enum {
PLUGIN_FUNC_HANDLE_DOCROOT,
PLUGIN_FUNC_HANDLE_PHYSICAL,
PLUGIN_FUNC_CONNECTION_RESET,
- PLUGIN_FUNC_INIT,
+ PLUGIN_FUNC_INIT,
PLUGIN_FUNC_CLEANUP,
PLUGIN_FUNC_SET_DEFAULTS,
-
+
PLUGIN_FUNC_SIZEOF
} plugin_t;
static plugin *plugin_init(void) {
plugin *p;
-
+
p = calloc(1, sizeof(*p));
-
+
return p;
}
@@ -63,16 +66,14 @@ static void plugin_free(plugin *p) {
/*if (RUNNING_ON_VALGRIND) use_dlclose = 0;*/
#endif
-#ifndef LIGHTTPD_STATIC
- if (use_dlclose && p->lib) {
+ if (use_dlclose && p->lib) {
#ifdef __WIN32
FreeLibrary(p->lib);
#else
dlclose(p->lib);
#endif
}
-#endif
-
+
free(p);
}
@@ -86,69 +87,46 @@ static int plugins_register(server *srv, plugin *p) {
srv->plugins.size += 4;
srv->plugins.ptr = realloc(srv->plugins.ptr, srv->plugins.size * sizeof(*ps));
}
-
+
ps = srv->plugins.ptr;
ps[srv->plugins.used++] = p;
-
+
return 0;
}
/**
- *
- *
- *
+ *
+ *
+ *
*/
-#ifdef LIGHTTPD_STATIC
-int plugins_load(server *srv) {
- plugin *p;
-#define PLUGIN_INIT(x)\
- p = plugin_init(); \
- if (x ## _plugin_init(p)) { \
- log_error_write(srv, __FILE__, __LINE__, "ss", #x, "plugin init failed" ); \
- plugin_free(p); \
- return -1;\
- }\
- plugins_register(srv, p);
-
-#include "plugin-static.h"
- return 0;
-}
-#else
int plugins_load(server *srv) {
plugin *p;
int (*init)(plugin *pl);
const char *error;
- size_t i, j;
-
+ size_t i;
+
for (i = 0; i < srv->srvconf.modules->used; i++) {
data_string *d = (data_string *)srv->srvconf.modules->data[i];
char *modules = d->value->ptr;
-
- for (j = 0; j < i; j++) {
- if (buffer_is_equal(d->value, ((data_string *) srv->srvconf.modules->data[j])->value)) {
- log_error_write(srv, __FILE__, __LINE__, "sbs", "Cannot load plugin", d->value, "more than once, please fix your config (we may not accept such configs in future releases");
- continue;
- }
- }
-
+
buffer_copy_string_buffer(srv->tmp_buf, srv->srvconf.modules_dir);
- buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN("/"));
+ buffer_append_string(srv->tmp_buf, "/");
buffer_append_string(srv->tmp_buf, modules);
#if defined(__WIN32) || defined(__CYGWIN__)
- buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN(".dll"));
+ buffer_append_string(srv->tmp_buf, ".dll");
#else
- buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN(".so"));
+ buffer_append_string(srv->tmp_buf, ".so");
#endif
-
+
p = plugin_init();
#ifdef __WIN32
if (NULL == (p->lib = LoadLibrary(srv->tmp_buf->ptr))) {
LPVOID lpMsgBuf;
FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
@@ -156,28 +134,28 @@ int plugins_load(server *srv) {
(LPTSTR) &lpMsgBuf,
0, NULL );
- log_error_write(srv, __FILE__, __LINE__, "ssb", "LoadLibrary() failed",
+ log_error_write(srv, __FILE__, __LINE__, "ssb", "LoadLibrary() failed",
lpMsgBuf, srv->tmp_buf);
-
+
plugin_free(p);
-
+
return -1;
}
-#else
- if (NULL == (p->lib = dlopen(srv->tmp_buf->ptr, RTLD_NOW|RTLD_GLOBAL))) {
- log_error_write(srv, __FILE__, __LINE__, "sbs", "dlopen() failed for:",
+#else
+ if (NULL == (p->lib = dlopen(srv->tmp_buf->ptr, RTLD_LAZY))) {
+ log_error_write(srv, __FILE__, __LINE__, "sbs", "dlopen() failed for:",
srv->tmp_buf, dlerror());
-
+
plugin_free(p);
-
+
return -1;
}
-
+
#endif
buffer_reset(srv->tmp_buf);
buffer_copy_string(srv->tmp_buf, modules);
- buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN("_plugin_init"));
+ buffer_append_string(srv->tmp_buf, "_plugin_init");
#ifdef __WIN32
init = GetProcAddress(p->lib, srv->tmp_buf->ptr);
@@ -185,7 +163,7 @@ int plugins_load(server *srv) {
if (init == NULL) {
LPVOID lpMsgBuf;
FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
@@ -194,28 +172,28 @@ int plugins_load(server *srv) {
0, NULL );
log_error_write(srv, __FILE__, __LINE__, "sbs", "getprocaddress failed:", srv->tmp_buf, lpMsgBuf);
-
+
plugin_free(p);
return -1;
}
#else
#if 1
- init = (int (*)(plugin *))(intptr_t)dlsym(p->lib, srv->tmp_buf->ptr);
+ init = (int (*)(plugin *))dlsym(p->lib, srv->tmp_buf->ptr);
#else
*(void **)(&init) = dlsym(p->lib, srv->tmp_buf->ptr);
#endif
if ((error = dlerror()) != NULL) {
log_error_write(srv, __FILE__, __LINE__, "s", error);
-
+
plugin_free(p);
return -1;
}
-
+
#endif
if ((*init)(p)) {
log_error_write(srv, __FILE__, __LINE__, "ss", modules, "plugin init failed" );
-
+
plugin_free(p);
return -1;
}
@@ -224,10 +202,9 @@ int plugins_load(server *srv) {
#endif
plugins_register(srv, p);
}
-
+
return 0;
}
-#endif
#define PLUGIN_TO_SLOT(x, y) \
handler_t plugins_call_##y(server *srv, connection *con) {\
@@ -257,8 +234,8 @@ int plugins_load(server *srv) {
}
/**
- * plugins that use
- *
+ * plugins that use
+ *
* - server *srv
* - connection *con
* - void *p_d (plugin_data *)
@@ -305,12 +282,12 @@ PLUGIN_TO_SLOT(PLUGIN_FUNC_CONNECTION_RESET, connection_reset)
}
/**
- * plugins that use
- *
+ * plugins that use
+ *
* - server *srv
* - void *p_d (plugin_data *)
*/
-
+
PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_TRIGGER, handle_trigger)
PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_SIGHUP, handle_sighup)
PLUGIN_TO_SLOT(PLUGIN_FUNC_CLEANUP, cleanup)
@@ -318,18 +295,18 @@ PLUGIN_TO_SLOT(PLUGIN_FUNC_SET_DEFAULTS, set_defaults)
#undef PLUGIN_TO_SLOT
-#if 0
+#if 0
/**
- *
+ *
* special handler
- *
+ *
*/
handler_t plugins_call_handle_fdevent(server *srv, const fd_conn *fdc) {
size_t i;
plugin **ps;
-
+
ps = srv->plugins.ptr;
-
+
for (i = 0; i < srv->plugins.used; i++) {
plugin *p = ps[i];
if (p->handle_fdevent) {
@@ -348,34 +325,34 @@ handler_t plugins_call_handle_fdevent(server *srv, const fd_conn *fdc) {
}
}
}
-
+
return HANDLER_GO_ON;
}
#endif
/**
- *
+ *
* - call init function of all plugins to init the plugin-internals
* - added each plugin that supports has callback to the corresponding slot
- *
+ *
* - is only called once.
*/
handler_t plugins_call_init(server *srv) {
size_t i;
plugin **ps;
-
+
ps = srv->plugins.ptr;
-
+
/* fill slots */
-
+
srv->plugin_slots = calloc(PLUGIN_FUNC_SIZEOF, sizeof(ps));
-
+
for (i = 0; i < srv->plugins.used; i++) {
size_t j;
/* check which calls are supported */
-
+
plugin *p = ps[i];
-
+
#define PLUGIN_TO_SLOT(x, y) \
if (p->y) { \
plugin **slot = ((plugin ***)(srv->plugin_slots))[x]; \
@@ -388,11 +365,11 @@ handler_t plugins_call_init(server *srv) {
slot[j] = p;\
break;\
}\
- }
-
-
- PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_URI_CLEAN, handle_uri_clean);
- PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_URI_RAW, handle_uri_raw);
+ }
+
+
+ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_URI_CLEAN, handle_uri_clean);
+ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_URI_RAW, handle_uri_raw);
PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_REQUEST_DONE, handle_request_done);
PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_CONNECTION_CLOSE, handle_connection_close);
PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_TRIGGER, handle_trigger);
@@ -406,19 +383,19 @@ handler_t plugins_call_init(server *srv) {
PLUGIN_TO_SLOT(PLUGIN_FUNC_CLEANUP, cleanup);
PLUGIN_TO_SLOT(PLUGIN_FUNC_SET_DEFAULTS, set_defaults);
#undef PLUGIN_TO_SLOT
-
+
if (p->init) {
if (NULL == (p->data = p->init())) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"plugin-init failed for module", p->name);
return HANDLER_ERROR;
}
-
+
/* used for con->mode, DIRECT == 0, plugins above that */
((plugin_data *)(p->data))->id = i + 1;
-
+
if (p->version != LIGHTTPD_VERSION_ID) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"plugin-version doesn't match lighttpd-version for", p->name);
return HANDLER_ERROR;
}
@@ -426,29 +403,29 @@ handler_t plugins_call_init(server *srv) {
p->data = NULL;
}
}
-
+
return HANDLER_GO_ON;
}
void plugins_free(server *srv) {
size_t i;
plugins_call_cleanup(srv);
-
+
for (i = 0; i < srv->plugins.used; i++) {
plugin *p = ((plugin **)srv->plugins.ptr)[i];
-
+
plugin_free(p);
}
-
+
for (i = 0; srv->plugin_slots && i < PLUGIN_FUNC_SIZEOF; i++) {
plugin **slot = ((plugin ***)(srv->plugin_slots))[i];
-
+
if (slot) free(slot);
}
-
+
free(srv->plugin_slots);
srv->plugin_slots = NULL;
-
+
free(srv->plugins.ptr);
srv->plugins.ptr = NULL;
srv->plugins.used = 0;
diff --git a/src/plugin.h b/src/plugin.h
index aa64bee..b43129a 100644
--- a/src/plugin.h
+++ b/src/plugin.h
@@ -25,19 +25,19 @@
#define URIHANDLER_FUNC CONNECTION_FUNC
#define PLUGIN_DATA size_t id
-
+
typedef struct {
size_t version;
-
+
buffer *name; /* name of the plugin */
-
+
void *(* init) ();
handler_t (* set_defaults) (server *srv, void *p_d);
handler_t (* cleanup) (server *srv, void *p_d);
/* is called ... */
handler_t (* handle_trigger) (server *srv, void *p_d); /* once a second */
handler_t (* handle_sighup) (server *srv, void *p_d); /* at a signup */
-
+
handler_t (* handle_uri_raw) (server *srv, connection *con, void *p_d); /* after uri_raw is set */
handler_t (* handle_uri_clean) (server *srv, connection *con, void *p_d); /* after uri is set */
handler_t (* handle_docroot) (server *srv, connection *con, void *p_d); /* getting the document-root */
@@ -45,18 +45,18 @@ typedef struct {
handler_t (* handle_request_done) (server *srv, connection *con, void *p_d); /* at the end of a request */
handler_t (* handle_connection_close)(server *srv, connection *con, void *p_d); /* at the end of a connection */
handler_t (* handle_joblist) (server *srv, connection *con, void *p_d); /* after all events are handled */
-
-
-
- handler_t (* handle_subrequest_start)(server *srv, connection *con, void *p_d);
-
- /* when a handler for the request
+
+
+
+ handler_t (* handle_subrequest_start)(server *srv, connection *con, void *p_d);
+
+ /* when a handler for the request
* has to be found
*/
handler_t (* handle_subrequest) (server *srv, connection *con, void *p_d); /* */
handler_t (* connection_reset) (server *srv, connection *con, void *p_d); /* */
void *data;
-
+
/* dlopen handle */
void *lib;
} plugin;
diff --git a/src/proc_open.c b/src/proc_open.c
index 3c065d0..ecea815 100644
--- a/src/proc_open.c
+++ b/src/proc_open.c
@@ -1,17 +1,15 @@
-#include "proc_open.h"
-
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
-#include <string.h>
#include <errno.h>
+#include "proc_open.h"
#ifdef WIN32
-# include <io.h>
-# include <fcntl.h>
+#include <io.h>
+#include <fcntl.h>
#else
-# include <sys/wait.h>
-# include <unistd.h>
+#include <sys/wait.h>
+#include <unistd.h>
#endif
@@ -150,14 +148,11 @@ int proc_open(proc_handler_t *proc, const char *command) {
STARTUPINFO si;
BOOL procok;
SECURITY_ATTRIBUTES security;
- const char *shell = NULL;
- const char *windir = NULL;
+ const char *shell;
buffer *cmdline;
- if (NULL == (shell = getenv(SHELLENV)) &&
- NULL == (windir = getenv("SystemRoot")) &&
- NULL == (windir = getenv("windir"))) {
- fprintf(stderr, "One of %s,%%SystemRoot,%%windir is required", SHELLENV);
+ if (NULL == (shell = getenv(SHELLENV))) {
+ fprintf(stderr, "env %s is required", SHELLENV);
return -1;
}
@@ -182,23 +177,17 @@ int proc_open(proc_handler_t *proc, const char *command) {
memset(&pi, 0, sizeof(pi));
cmdline = buffer_init();
- if (shell) {
- buffer_append_string(cmdline, shell);
- } else {
- buffer_append_string(cmdline, windir);
- buffer_append_string_len(cmdline, CONST_STR_LEN("\\system32\\cmd.exe"));
- }
+ buffer_append_string(cmdline, shell);
buffer_append_string_len(cmdline, CONST_STR_LEN(" /c "));
buffer_append_string(cmdline, command);
procok = CreateProcess(NULL, cmdline->ptr, &security, &security, TRUE,
NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi);
+ buffer_free(cmdline);
if (FALSE == procok) {
- fprintf(stderr, "failed to CreateProcess: %s", cmdline->ptr);
- buffer_free(cmdline);
+ fprintf(stderr, "failed to CreateProcess");
return -1;
}
- buffer_free(cmdline);
proc->child = pi.hProcess;
CloseHandle(pi.hThread);
@@ -237,7 +226,8 @@ int proc_open(proc_handler_t *proc, const char *command) {
const char *shell;
if (NULL == (shell = getenv(SHELLENV))) {
- shell = "/bin/sh";
+ fprintf(stderr, "env %s is required", SHELLENV);
+ return -1;
}
if (proc_open_pipes(proc) != 0) {
@@ -257,8 +247,7 @@ int proc_open(proc_handler_t *proc, const char *command) {
*/
proc_close_parents(proc);
- execl(shell, shell, "-c", command, (char *)NULL);
- fprintf(stderr, "failed to execute shell: %s -c %s: %s\n", shell, command, strerror(errno));
+ execl(shell, shell, "-c", command, NULL);
_exit(127);
} else if (child < 0) {
@@ -290,40 +279,31 @@ static void proc_read_fd_to_buffer(int fd, buffer *b) {
}
/* }}} */
/* {{{ proc_open_buffer */
-int proc_open_buffer(const char *command, buffer *in, buffer *out, buffer *err) {
- proc_handler_t proc;
+int proc_open_buffer(proc_handler_t *proc, const char *command, buffer *in, buffer *out, buffer *err) {
+
+ UNUSED(err);
- if (proc_open(&proc, command) != 0) {
+ if (proc_open(proc, command) != 0) {
return -1;
}
if (in) {
- if (write(proc.in.fd, (void *)in->ptr, in->used) < 0) {
+ if (write(proc->in.fd, (void *)in->ptr, in->used) < 0) {
perror("error writing pipe");
return -1;
}
}
- pipe_close(&proc.in);
+ pipe_close(&proc->in);
if (out) {
- proc_read_fd_to_buffer(proc.out.fd, out);
+ proc_read_fd_to_buffer(proc->out.fd, out);
}
- pipe_close(&proc.out);
+ pipe_close(&proc->out);
if (err) {
- proc_read_fd_to_buffer(proc.err.fd, err);
- } else {
- buffer *tmp = buffer_init();
- proc_read_fd_to_buffer(proc.err.fd, tmp);
- if (tmp->used > 0 && write(2, (void*)tmp->ptr, tmp->used) < 0) {
- perror("error writing pipe");
- return -1;
- }
- buffer_free(tmp);
+ proc_read_fd_to_buffer(proc->err.fd, err);
}
- pipe_close(&proc.err);
-
- proc_close(&proc);
+ pipe_close(&proc->err);
return 0;
}
@@ -378,7 +358,7 @@ int main() {
RESET();
fprintf(stdout, "test: echo 321 with read\n"); fflush(stdout);
- if (proc_open_buffer("echo 321", NULL, out, err) != 0) {
+ if (proc_open_buffer(&proc, "echo 321", NULL, out, err) != 0) {
ERROR_OUT();
}
fprintf(stdout, "result: ->%s<-\n\n", out->ptr); fflush(stdout);
@@ -386,7 +366,7 @@ int main() {
fprintf(stdout, "test: echo 123 | " CMD_CAT "\n"); fflush(stdout);
buffer_copy_string_len(in, CONST_STR_LEN("123\n"));
- if (proc_open_buffer(CMD_CAT, in, out, err) != 0) {
+ if (proc_open_buffer(&proc, CMD_CAT, in, out, err) != 0) {
ERROR_OUT();
}
fprintf(stdout, "result: ->%s<-\n\n", out->ptr); fflush(stdout);
diff --git a/src/proc_open.h b/src/proc_open.h
index af70738..e07421a 100644
--- a/src/proc_open.h
+++ b/src/proc_open.h
@@ -22,4 +22,4 @@ typedef struct {
int proc_close(proc_handler_t *ht);
int proc_open(proc_handler_t *ht, const char *command);
-int proc_open_buffer(const char *command, buffer *in, buffer *out, buffer *err);
+int proc_open_buffer(proc_handler_t *ht, const char *command, buffer *in, buffer *out, buffer *err);
diff --git a/src/request.c b/src/request.c
index e76a98f..0935725 100644
--- a/src/request.c
+++ b/src/request.c
@@ -1,7 +1,3 @@
-#include "request.h"
-#include "keyvalue.h"
-#include "log.h"
-
#include <sys/stat.h>
#include <limits.h>
@@ -10,15 +6,19 @@
#include <stdio.h>
#include <ctype.h>
+#include "request.h"
+#include "keyvalue.h"
+#include "log.h"
+
static int request_check_hostname(server *srv, connection *con, buffer *host) {
enum { DOMAINLABEL, TOPLABEL } stage = TOPLABEL;
size_t i;
int label_len = 0;
size_t host_len;
char *colon;
- int is_ip = -1; /* -1 don't know yet, 0 no, 1 yes */
+ int is_ip = -1; /* -1 don't know yet, 0 no, 1 yes */
int level = 0;
-
+
UNUSED(srv);
UNUSED(con);
@@ -32,33 +32,33 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
* IPv6address = "[" ... "]"
* port = *digit
*/
-
+
/* no Host: */
if (!host || host->used == 0) return 0;
-
+
host_len = host->used - 1;
-
+
/* IPv6 adress */
if (host->ptr[0] == '[') {
char *c = host->ptr + 1;
int colon_cnt = 0;
-
+
/* check portnumber */
for (; *c && *c != ']'; c++) {
if (*c == ':') {
if (++colon_cnt > 7) {
return -1;
}
- } else if (!light_isxdigit(*c) && '.' != *c) {
+ } else if (!light_isxdigit(*c)) {
return -1;
}
}
-
+
/* missing ] */
if (!*c) {
return -1;
}
-
+
/* check port */
if (*(c+1) == ':') {
for (c += 2; *c; c++) {
@@ -69,50 +69,39 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
}
return 0;
}
-
+
if (NULL != (colon = memchr(host->ptr, ':', host_len))) {
char *c = colon + 1;
-
+
/* check portnumber */
for (; *c; c++) {
if (!light_isdigit(*c)) return -1;
}
-
+
/* remove the port from the host-len */
host_len = colon - host->ptr;
}
-
+
/* Host is empty */
if (host_len == 0) return -1;
-
- /* if the hostname ends in a "." strip it */
- if (host->ptr[host_len-1] == '.') {
- /* shift port info one left */
- if (NULL != colon) memmove(colon-1, colon, host->used - host_len);
- else host->ptr[host_len-1] = '\0';
- host_len -= 1;
- host->used -= 1;
- }
-
- if (host_len == 0) return -1;
-
+
/* scan from the right and skip the \0 */
- for (i = host_len; i-- > 0; ) {
+ for (i = host_len - 1; i + 1 > 0; i--) {
const char c = host->ptr[i];
switch (stage) {
- case TOPLABEL:
+ case TOPLABEL:
if (c == '.') {
/* only switch stage, if this is not the last character */
if (i != host_len - 1) {
if (label_len == 0) {
return -1;
}
-
+
/* check the first character at right of the dot */
if (is_ip == 0) {
- if (!light_isalnum(host->ptr[i+1])) {
- return -1;
+ if (!light_isalpha(host->ptr[i+1])) {
+ return -1;
}
} else if (!light_isdigit(host->ptr[i+1])) {
is_ip = 0;
@@ -122,9 +111,9 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
/* just digits */
is_ip = 1;
}
-
+
stage = DOMAINLABEL;
-
+
label_len = 0;
level++;
} else if (i == 0) {
@@ -133,7 +122,7 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
}
} else if (i == 0) {
/* the first character of the hostname */
- if (!light_isalnum(c)) {
+ if (!light_isalpha(c)) {
return -1;
}
label_len++;
@@ -146,7 +135,7 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
}
label_len++;
}
-
+
break;
case DOMAINLABEL:
if (is_ip == 1) {
@@ -154,7 +143,7 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
if (label_len == 0) {
return -1;
}
-
+
label_len = 0;
level++;
} else if (!light_isdigit(c)) {
@@ -167,12 +156,12 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
if (label_len == 0) {
return -1;
}
-
+
/* c is either - or alphanum here */
if ('-' == host->ptr[i+1]) {
return -1;
}
-
+
label_len = 0;
level++;
} else if (i == 0) {
@@ -187,20 +176,20 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
label_len++;
}
}
-
+
break;
}
}
-
+
/* a IP has to consist of 4 parts */
if (is_ip == 1 && level != 3) {
return -1;
}
-
+
if (label_len == 0) {
return -1;
}
-
+
return 0;
}
@@ -208,59 +197,57 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
#define DUMP_HEADER
#endif
-static int http_request_split_value(array *vals, buffer *b) {
+int http_request_split_value(array *vals, buffer *b) {
char *s;
size_t i;
int state = 0;
- /*
- * parse
- *
+ /*
+ * parse
+ *
* val1, val2, val3, val4
- *
+ *
* into a array (more or less a explode() incl. striping of whitespaces
*/
-
+
if (b->used == 0) return 0;
-
+
s = b->ptr;
-
+
for (i =0; i < b->used - 1; ) {
char *start = NULL, *end = NULL;
data_string *ds;
-
+
switch (state) {
case 0: /* ws */
-
+
/* skip ws */
for (; (*s == ' ' || *s == '\t') && i < b->used - 1; i++, s++);
-
-
+
+
state = 1;
break;
case 1: /* value */
start = s;
-
+
for (; *s != ',' && i < b->used - 1; i++, s++);
- if (start == s) break; /* empty fields are skipped */
end = s - 1;
-
- for (; end > start && (*end == ' ' || *end == '\t'); end--);
- if (start == end) break; /* empty fields are skipped */
-
+
+ for (; (*end == ' ' || *end == '\t') && end > start; end--);
+
if (NULL == (ds = (data_string *)array_get_unused_element(vals, TYPE_STRING))) {
ds = data_string_init();
}
buffer_copy_string_len(ds->value, start, end-start+1);
array_insert_unique(vals, (data_unset *)ds);
-
+
if (*s == ',') {
state = 0;
i++;
s++;
} else {
/* end of string */
-
+
state = 2;
}
break;
@@ -272,11 +259,11 @@ static int http_request_split_value(array *vals, buffer *b) {
return 0;
}
-static int request_uri_is_valid_char(unsigned char c) {
+int request_uri_is_valid_char(unsigned char c) {
if (c <= 32) return 0;
if (c == 127) return 0;
if (c == 255) return 0;
-
+
return 1;
}
@@ -284,28 +271,28 @@ int http_request_parse(server *srv, connection *con) {
char *uri = NULL, *proto = NULL, *method = NULL, con_length_set;
int is_key = 1, key_len = 0, is_ws_after_key = 0, in_folding;
char *value = NULL, *key = NULL;
- char *reqline_host = NULL;
- int reqline_hostlen = 0;
-
+
enum { HTTP_CONNECTION_UNSET, HTTP_CONNECTION_KEEPALIVE, HTTP_CONNECTION_CLOSE } keep_alive_set = HTTP_CONNECTION_UNSET;
-
+
int line = 0;
-
+
int request_line_stage = 0;
size_t i, first;
-
+
int done = 0;
-
- /*
- * Request: "^(GET|POST|HEAD) ([^ ]+(\\?[^ ]+|)) (HTTP/1\\.[01])$"
- * Option : "^([-a-zA-Z]+): (.+)$"
+
+ data_string *ds = NULL;
+
+ /*
+ * Request: "^(GET|POST|HEAD) ([^ ]+(\\?[^ ]+|)) (HTTP/1\\.[01])$"
+ * Option : "^([-a-zA-Z]+): (.+)$"
* End : "^$"
*/
if (con->conf.log_request_header) {
- log_error_write(srv, __FILE__, __LINE__, "sdsdSb",
- "fd:", con->fd,
- "request-len:", con->request.request->used,
+ log_error_write(srv, __FILE__, __LINE__, "sdsdSb",
+ "fd:", con->fd,
+ "request-len:", con->request.request->used,
"\n", con->request.request);
}
@@ -313,13 +300,13 @@ int http_request_parse(server *srv, connection *con) {
con->request.request->ptr[0] == '\r' &&
con->request.request->ptr[1] == '\n') {
/* we are in keep-alive and might get \r\n after a previous POST request.*/
-
+
buffer_copy_string_len(con->parse_request, con->request.request->ptr + 2, con->request.request->used - 1 - 2);
} else {
/* fill the local request buffer */
buffer_copy_string_buffer(con->parse_request, con->request.request);
}
-
+
keep_alive_set = 0;
con_length_set = 0;
@@ -331,109 +318,67 @@ int http_request_parse(server *srv, connection *con) {
* */
for (i = 0, first = 0; i < con->parse_request->used && line == 0; i++) {
char *cur = con->parse_request->ptr + i;
-
+
switch(*cur) {
- case '\r':
+ case '\r':
if (con->parse_request->ptr[i+1] == '\n') {
http_method_t r;
char *nuri = NULL;
size_t j;
-
+
/* \r\n -> \0\0 */
con->parse_request->ptr[i] = '\0';
con->parse_request->ptr[i+1] = '\0';
-
+
buffer_copy_string_len(con->request.request_line, con->parse_request->ptr, i);
-
+
if (request_line_stage != 2) {
con->http_status = 400;
con->response.keep_alive = 0;
con->keep_alive = 0;
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s", "incomplete request line -> 400");
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s", "incomplete request line -> 400");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
}
return 0;
}
-
+
proto = con->parse_request->ptr + first;
-
+
*(uri - 1) = '\0';
*(proto - 1) = '\0';
-
+
/* we got the first one :) */
if (-1 == (r = get_http_method_key(method))) {
con->http_status = 501;
con->response.keep_alive = 0;
con->keep_alive = 0;
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s", "unknown http-method -> 501");
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s", "unknown http-method -> 501");
- log_error_write(srv, __FILE__, __LINE__, "Sb",
- "request-header:\n",
- con->request.request);
- }
-
- return 0;
- }
-
- con->request.http_method = r;
-
- /*
- * RFC2616 says:
- *
- * HTTP-Version = "HTTP" "/" 1*DIGIT "." 1*DIGIT
- *
- * */
- if (0 == strncmp(proto, "HTTP/", sizeof("HTTP/") - 1)) {
- char * major = proto + sizeof("HTTP/") - 1;
- char * minor = strchr(major, '.');
- char *err = NULL;
- int major_num = 0, minor_num = 0;
-
- int invalid_version = 0;
-
- if (NULL == minor || /* no dot */
- minor == major || /* no major */
- *(minor + 1) == '\0' /* no minor */) {
- invalid_version = 1;
- } else {
- *minor = '\0';
- major_num = strtol(major, &err, 10);
-
- if (*err != '\0') invalid_version = 1;
-
- *minor++ = '.';
- minor_num = strtol(minor, &err, 10);
-
- if (*err != '\0') invalid_version = 1;
- }
-
- if (invalid_version) {
- con->http_status = 400;
- con->keep_alive = 0;
-
- if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s", "unknown protocol -> 400");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
}
- return 0;
- }
-
- if (major_num == 1 && minor_num == 1) {
+
+ return 0;
+ }
+
+ con->request.http_method = r;
+
+ if (0 == strncmp(proto, "HTTP/1.", sizeof("HTTP/1.") - 1)) {
+ if (proto[7] == '1') {
con->request.http_version = con->conf.allow_http11 ? HTTP_VERSION_1_1 : HTTP_VERSION_1_0;
- } else if (major_num == 1 && minor_num == 0) {
+ } else if (proto[7] == '0') {
con->request.http_version = HTTP_VERSION_1_0;
- } else {
+ } else {
con->http_status = 505;
+ log_error_write(srv, __FILE__, __LINE__, "s", "unknown HTTP version -> 505");
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s", "unknown HTTP version -> 505");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
@@ -444,69 +389,62 @@ int http_request_parse(server *srv, connection *con) {
con->http_status = 400;
con->keep_alive = 0;
+ log_error_write(srv, __FILE__, __LINE__, "s", "unknown protocol -> 400");
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s", "unknown protocol -> 400");
- log_error_write(srv, __FILE__, __LINE__, "Sb",
- "request-header:\n",
- con->request.request);
- }
+ log_error_write(srv, __FILE__, __LINE__, "Sb",
+ "request-header:\n",
+ con->request.request);
+ }
return 0;
}
-
+
if (0 == strncmp(uri, "http://", 7) &&
NULL != (nuri = strchr(uri + 7, '/'))) {
- reqline_host = uri + 7;
- reqline_hostlen = nuri - reqline_host;
-
- buffer_copy_string_len(con->request.uri, nuri, proto - nuri - 1);
- } else if (0 == strncmp(uri, "https://", 8) &&
- NULL != (nuri = strchr(uri + 8, '/'))) {
- reqline_host = uri + 8;
- reqline_hostlen = nuri - reqline_host;
-
+ /* ignore the host-part */
+
buffer_copy_string_len(con->request.uri, nuri, proto - nuri - 1);
} else {
/* everything looks good so far */
buffer_copy_string_len(con->request.uri, uri, proto - uri - 1);
}
-
+
/* check uri for invalid characters */
for (j = 0; j < con->request.uri->used - 1; j++) {
if (!request_uri_is_valid_char(con->request.uri->ptr[j])) {
unsigned char buf[2];
con->http_status = 400;
con->keep_alive = 0;
-
+
+ buf[0] = con->request.uri->ptr[j];
+ buf[1] = '\0';
+
+ if (con->request.uri->ptr[j] > 32 &&
+ con->request.uri->ptr[j] != 127) {
+ /* the character is printable -> print it */
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "invalid character in URI -> 400",
+ buf);
+ } else {
+ /* a control-character, print ascii-code */
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "invalid character in URI -> 400",
+ con->request.uri->ptr[j]);
+ }
+
if (srv->srvconf.log_request_header_on_error) {
- buf[0] = con->request.uri->ptr[j];
- buf[1] = '\0';
-
- if (con->request.uri->ptr[j] > 32 &&
- con->request.uri->ptr[j] != 127) {
- /* the character is printable -> print it */
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "invalid character in URI -> 400",
- buf);
- } else {
- /* a control-character, print ascii-code */
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "invalid character in URI -> 400",
- con->request.uri->ptr[j]);
- }
-
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
}
-
+
return 0;
}
}
-
+
buffer_copy_string_buffer(con->request.orig_uri, con->request.uri);
-
+
con->http_status = 0;
-
+
i++;
line++;
first = i+1;
@@ -514,14 +452,14 @@ int http_request_parse(server *srv, connection *con) {
break;
case ' ':
switch(request_line_stage) {
- case 0:
+ case 0:
/* GET|POST|... */
- method = con->parse_request->ptr + first;
+ method = con->parse_request->ptr + first;
first = i + 1;
break;
case 1:
/* /foobar/... */
- uri = con->parse_request->ptr + first;
+ uri = con->parse_request->ptr + first;
first = i + 1;
break;
default:
@@ -529,21 +467,21 @@ int http_request_parse(server *srv, connection *con) {
con->http_status = 400;
con->response.keep_alive = 0;
con->keep_alive = 0;
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s", "overlong request line -> 400");
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s", "overlong request line -> 400");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
}
return 0;
}
-
+
request_line_stage++;
break;
}
}
-
+
in_folding = 0;
if (con->request.uri->used == 1) {
@@ -551,8 +489,8 @@ int http_request_parse(server *srv, connection *con) {
con->response.keep_alive = 0;
con->keep_alive = 0;
+ log_error_write(srv, __FILE__, __LINE__, "s", "no uri specified -> 400");
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s", "no uri specified -> 400");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
@@ -560,43 +498,30 @@ int http_request_parse(server *srv, connection *con) {
return 0;
}
- if (reqline_host) {
- /* Insert as host header */
- data_string *ds;
-
- if (NULL == (ds = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
- ds = data_string_init();
- }
-
- buffer_copy_string_len(ds->key, CONST_STR_LEN("Host"));
- buffer_copy_string_len(ds->value, reqline_host, reqline_hostlen);
- array_insert_unique(con->request.headers, (data_unset *)ds);
- con->request.http_host = ds->value;
- }
-
+
for (; i < con->parse_request->used && !done; i++) {
char *cur = con->parse_request->ptr + i;
-
+
if (is_key) {
size_t j;
int got_colon = 0;
-
+
/**
* 1*<any CHAR except CTLs or separators>
* CTLs == 0-31 + 127
- *
+ *
*/
switch(*cur) {
case ':':
is_key = 0;
-
+
value = cur + 1;
-
+
if (is_ws_after_key == 0) {
key_len = i - first;
}
is_ws_after_key = 0;
-
+
break;
case '(':
case ')':
@@ -617,8 +542,8 @@ int http_request_parse(server *srv, connection *con) {
con->http_status = 400;
con->keep_alive = 0;
con->response.keep_alive = 0;
-
- log_error_write(srv, __FILE__, __LINE__, "sbsds",
+
+ log_error_write(srv, __FILE__, __LINE__, "sbsds",
"invalid character in key", con->request.request, cur, *cur, "-> 400");
return 0;
case ' ':
@@ -627,13 +552,13 @@ int http_request_parse(server *srv, connection *con) {
is_key = 0;
in_folding = 1;
value = cur;
-
+
break;
}
-
-
+
+
key_len = i - first;
-
+
/* skip every thing up to the : */
for (j = 1; !got_colon; j++) {
switch(con->parse_request->ptr[j + i]) {
@@ -643,49 +568,39 @@ int http_request_parse(server *srv, connection *con) {
continue;
case ':':
/* ok, done */
-
+
i += j - 1;
got_colon = 1;
-
+
break;
default:
/* error */
-
- if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s", "WS character in key -> 400");
- log_error_write(srv, __FILE__, __LINE__, "Sb",
- "request-header:\n",
- con->request.request);
- }
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s", "WS character in key -> 400");
+
con->http_status = 400;
con->response.keep_alive = 0;
con->keep_alive = 0;
-
+
return 0;
}
}
-
+
break;
case '\r':
if (con->parse_request->ptr[i+1] == '\n' && i == first) {
/* End of Header */
con->parse_request->ptr[i] = '\0';
con->parse_request->ptr[i+1] = '\0';
-
+
i++;
-
+
done = 1;
-
+
break;
} else {
- if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s", "CR without LF -> 400");
- log_error_write(srv, __FILE__, __LINE__, "Sb",
- "request-header:\n",
- con->request.request);
- }
-
+ log_error_write(srv, __FILE__, __LINE__, "s", "CR without LF -> 400");
+
con->http_status = 400;
con->keep_alive = 0;
con->response.keep_alive = 0;
@@ -726,16 +641,10 @@ int http_request_parse(server *srv, connection *con) {
con->http_status = 400;
con->keep_alive = 0;
con->response.keep_alive = 0;
-
- if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "sbsds",
+
+ log_error_write(srv, __FILE__, __LINE__, "sbsds",
"CTL character in key", con->request.request, cur, *cur, "-> 400");
-
- log_error_write(srv, __FILE__, __LINE__, "Sb",
- "request-header:\n",
- con->request.request);
- }
-
+
return 0;
default:
/* ok */
@@ -743,64 +652,30 @@ int http_request_parse(server *srv, connection *con) {
}
} else {
switch(*cur) {
- case '\r':
+ case '\r':
if (con->parse_request->ptr[i+1] == '\n') {
- data_string *ds = NULL;
-
/* End of Headerline */
con->parse_request->ptr[i] = '\0';
con->parse_request->ptr[i+1] = '\0';
-
+
if (in_folding) {
- buffer *key_b;
- /**
- * we use a evil hack to handle the line-folding
- *
- * As array_insert_unique() deletes 'ds' in the case of a duplicate
- * ds points somewhere and we get a evil crash. As a solution we keep the old
- * "key" and get the current value from the hash and append us
- *
- * */
-
- if (!key || !key_len) {
+ if (!ds) {
/* 400 */
-
- if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s", "WS at the start of first line -> 400");
-
- log_error_write(srv, __FILE__, __LINE__, "Sb",
- "request-header:\n",
- con->request.request);
- }
-
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s", "WS at the start of first line -> 400");
+
con->http_status = 400;
con->keep_alive = 0;
con->response.keep_alive = 0;
return 0;
}
-
- key_b = buffer_init();
- buffer_copy_string_len(key_b, key, key_len);
-
- if (NULL != (ds = (data_string *)array_get_element(con->request.headers, key_b->ptr))) {
- buffer_append_string(ds->value, value);
- }
-
- buffer_free(key_b);
+ buffer_append_string(ds->value, value);
} else {
int s_len;
key = con->parse_request->ptr + first;
-
+
s_len = cur - value;
-
- /* strip trailing white-spaces */
- for (; s_len > 0 &&
- (value[s_len - 1] == ' ' ||
- value[s_len - 1] == '\t'); s_len--);
-
- value[s_len] = '\0';
-
+
if (s_len > 0) {
int cmp = 0;
if (NULL == (ds = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
@@ -808,87 +683,86 @@ int http_request_parse(server *srv, connection *con) {
}
buffer_copy_string_len(ds->key, key, key_len);
buffer_copy_string_len(ds->value, value, s_len);
-
- /* retreive values
- *
- *
+
+ /* retreive values
+ *
+ *
* the list of options is sorted to simplify the search
*/
-
+
if (0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Connection")))) {
array *vals;
size_t vi;
-
+
/* split on , */
-
+
vals = srv->split_vals;
array_reset(vals);
-
+
http_request_split_value(vals, ds->value);
-
+
for (vi = 0; vi < vals->used; vi++) {
data_string *dsv = (data_string *)vals->data[vi];
-
+
if (0 == buffer_caseless_compare(CONST_BUF_LEN(dsv->value), CONST_STR_LEN("keep-alive"))) {
keep_alive_set = HTTP_CONNECTION_KEEPALIVE;
-
+
break;
} else if (0 == buffer_caseless_compare(CONST_BUF_LEN(dsv->value), CONST_STR_LEN("close"))) {
keep_alive_set = HTTP_CONNECTION_CLOSE;
-
+
break;
}
}
-
+
} else if (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Content-Length")))) {
char *err;
unsigned long int r;
size_t j;
-
+
if (con_length_set) {
con->http_status = 400;
con->keep_alive = 0;
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "duplicate Content-Length-header -> 400");
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "duplicate Content-Length-header -> 400");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
}
- array_insert_unique(con->request.headers, (data_unset *)ds);
return 0;
}
-
+
if (ds->value->used == 0) SEGFAULT();
-
+
for (j = 0; j < ds->value->used - 1; j++) {
char c = ds->value->ptr[j];
if (!isdigit((unsigned char)c)) {
- log_error_write(srv, __FILE__, __LINE__, "sbs",
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
"content-length broken:", ds->value, "-> 400");
-
+
con->http_status = 400;
con->keep_alive = 0;
-
+
array_insert_unique(con->request.headers, (data_unset *)ds);
return 0;
}
}
-
+
r = strtoul(ds->value->ptr, &err, 10);
-
+
if (*err == '\0') {
con_length_set = 1;
con->request.content_length = r;
} else {
- log_error_write(srv, __FILE__, __LINE__, "sbs",
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
"content-length broken:", ds->value, "-> 400");
-
+
con->http_status = 400;
con->keep_alive = 0;
-
+
array_insert_unique(con->request.headers, (data_unset *)ds);
return 0;
}
@@ -899,84 +773,62 @@ int http_request_parse(server *srv, connection *con) {
} else {
con->http_status = 400;
con->keep_alive = 0;
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "duplicate Content-Type-header -> 400");
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "duplicate Content-Type-header -> 400");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
}
- array_insert_unique(con->request.headers, (data_unset *)ds);
return 0;
}
} else if (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Expect")))) {
- /* HTTP 2616 8.2.3
+ /* HTTP 2616 8.2.3
* Expect: 100-continue
- *
+ *
* -> (10.1.1) 100 (read content, process request, send final status-code)
* -> (10.4.18) 417 (close)
- *
+ *
* (not handled at all yet, we always send 417 here)
- *
- * What has to be added ?
- * 1. handling of chunked request body
- * 2. out-of-order sending from the HTTP/1.1 100 Continue
- * header
- *
*/
-
- if (srv->srvconf.reject_expect_100_with_417 && 0 == buffer_caseless_compare(CONST_BUF_LEN(ds->value), CONST_STR_LEN("100-continue"))) {
- con->http_status = 417;
- con->keep_alive = 0;
- array_insert_unique(con->request.headers, (data_unset *)ds);
- return 0;
- }
+
+ con->http_status = 417;
+ con->keep_alive = 0;
+
+ array_insert_unique(con->request.headers, (data_unset *)ds);
+ return 0;
} else if (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Host")))) {
- if (reqline_host) {
- /* ignore all host: headers as we got the host in the request line */
- ds->free((data_unset*) ds);
- ds = NULL;
- } else if (!con->request.http_host) {
+ if (!con->request.http_host) {
con->request.http_host = ds->value;
} else {
con->http_status = 400;
con->keep_alive = 0;
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "duplicate Host-header -> 400");
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "duplicate Host-header -> 400");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
}
- array_insert_unique(con->request.headers, (data_unset *)ds);
return 0;
}
} else if (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("If-Modified-Since")))) {
- /* Proxies sometimes send dup headers
- * if they are the same we ignore the second
- * if not, we raise an error */
+ /* if dup, only the first one will survive */
if (!con->request.http_if_modified_since) {
con->request.http_if_modified_since = ds->value->ptr;
- } else if (0 == strcasecmp(con->request.http_if_modified_since,
- ds->value->ptr)) {
- /* ignore it if they are the same */
-
- ds->free((data_unset *)ds);
- ds = NULL;
} else {
con->http_status = 400;
con->keep_alive = 0;
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "duplicate If-Modified-Since header -> 400");
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "duplicate If-Modified-Since header -> 400");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
}
- array_insert_unique(con->request.headers, (data_unset *)ds);
return 0;
}
} else if (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("If-None-Match")))) {
@@ -984,58 +836,59 @@ int http_request_parse(server *srv, connection *con) {
if (!con->request.http_if_none_match) {
con->request.http_if_none_match = ds->value->ptr;
} else {
- ds->free((data_unset*) ds);
- ds = NULL;
+ con->http_status = 400;
+ con->keep_alive = 0;
+
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "duplicate If-None-Match-header -> 400");
+ if (srv->srvconf.log_request_header_on_error) {
+ log_error_write(srv, __FILE__, __LINE__, "Sb",
+ "request-header:\n",
+ con->request.request);
+ }
+ return 0;
}
} else if (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Range")))) {
if (!con->request.http_range) {
/* bytes=.*-.* */
-
+
if (0 == strncasecmp(ds->value->ptr, "bytes=", 6) &&
NULL != strchr(ds->value->ptr+6, '-')) {
-
+
/* if dup, only the first one will survive */
con->request.http_range = ds->value->ptr + 6;
}
} else {
con->http_status = 400;
con->keep_alive = 0;
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "duplicate Host-header -> 400");
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "duplicate Range-header -> 400");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
}
- array_insert_unique(con->request.headers, (data_unset *)ds);
return 0;
}
}
-
- if (ds) array_insert_unique(con->request.headers, (data_unset *)ds);
+
+ array_insert_unique(con->request.headers, (data_unset *)ds);
} else {
/* empty header-fields are not allowed by HTTP-RFC, we just ignore them */
}
}
-
+
i++;
first = i+1;
is_key = 1;
value = 0;
-#if 0
- /**
- * for Bug 1230 keep the key_len a live
- */
- key_len = 0;
-#endif
+ key_len = 0;
in_folding = 0;
} else {
- if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "sbs",
- "CR without LF", con->request.request, "-> 400");
- }
-
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
+ "CR without LF", con->request.request, "-> 400");
+
con->http_status = 400;
con->keep_alive = 0;
con->response.keep_alive = 0;
@@ -1047,45 +900,34 @@ int http_request_parse(server *srv, connection *con) {
/* strip leading WS */
if (value == cur) value = cur+1;
default:
- if (*cur >= 0 && *cur < 32 && *cur != '\t') {
- if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "sds",
- "invalid char in header", (int)*cur, "-> 400");
- }
-
- con->http_status = 400;
- con->keep_alive = 0;
-
- return 0;
- }
break;
}
}
}
-
+
con->header_len = i;
-
+
/* do some post-processing */
if (con->request.http_version == HTTP_VERSION_1_1) {
if (keep_alive_set != HTTP_CONNECTION_CLOSE) {
/* no Connection-Header sent */
-
+
/* HTTP/1.1 -> keep-alive default TRUE */
con->keep_alive = 1;
} else {
con->keep_alive = 0;
}
-
+
/* RFC 2616, 14.23 */
if (con->request.http_host == NULL ||
buffer_is_empty(con->request.http_host)) {
con->http_status = 400;
con->response.keep_alive = 0;
con->keep_alive = 0;
-
+
+ log_error_write(srv, __FILE__, __LINE__, "s", "HTTP/1.1 but Host missing -> 400");
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s", "HTTP/1.1 but Host missing -> 400");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
@@ -1095,21 +937,21 @@ int http_request_parse(server *srv, connection *con) {
} else {
if (keep_alive_set == HTTP_CONNECTION_KEEPALIVE) {
/* no Connection-Header sent */
-
+
/* HTTP/1.0 -> keep-alive default FALSE */
con->keep_alive = 1;
} else {
con->keep_alive = 0;
}
}
-
+
/* check hostname field if it is set */
if (NULL != con->request.http_host &&
0 != request_check_hostname(srv, con, con->request.http_host)) {
-
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "Invalid Hostname -> 400");
+
if (srv->srvconf.log_request_header_on_error) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "Invalid Hostname -> 400");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
@@ -1118,77 +960,66 @@ int http_request_parse(server *srv, connection *con) {
con->http_status = 400;
con->response.keep_alive = 0;
con->keep_alive = 0;
-
+
return 0;
}
-
- switch(con->request.http_method) {
- case HTTP_METHOD_GET:
- case HTTP_METHOD_HEAD:
- /* content-length is forbidden for those */
- if (con_length_set && con->request.content_length != 0) {
- /* content-length is missing */
- log_error_write(srv, __FILE__, __LINE__, "s",
- "GET/HEAD with content-length -> 400");
-
- con->keep_alive = 0;
- con->http_status = 400;
- return 0;
+
+ /* check if we have read post data */
+ if (con->request.http_method == HTTP_METHOD_POST
+ || (con->request.http_method != HTTP_METHOD_GET
+ && con->request.http_method != HTTP_METHOD_HEAD
+ && con->request.http_method != HTTP_METHOD_OPTIONS
+ && con_length_set)) {
+
+#if 0
+ if (con->request.http_content_type == NULL) {
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "Content-Length request, but content-type not set");
}
- break;
- case HTTP_METHOD_POST:
- /* content-length is required for them */
- if (!con_length_set) {
+#endif
+
+ if (con_length_set == 0) {
/* content-length is missing */
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"POST-request, but content-length missing -> 411");
-
con->keep_alive = 0;
+
con->http_status = 411;
return 0;
-
}
- break;
- default:
- /* the may have a content-length */
- break;
- }
-
-
- /* check if we have read post data */
- if (con_length_set) {
+
/* don't handle more the SSIZE_MAX bytes in content-length */
if (con->request.content_length > SSIZE_MAX) {
- con->http_status = 413;
+ con->http_status = 413;
con->keep_alive = 0;
- log_error_write(srv, __FILE__, __LINE__, "sos",
- "request-size too long:", (off_t) con->request.content_length, "-> 413");
+ log_error_write(srv, __FILE__, __LINE__, "sds",
+ "request-size too long:", con->request.content_length, "-> 413");
return 0;
}
/* divide by 1024 as srvconf.max_request_size is in kBytes */
if (srv->srvconf.max_request_size != 0 &&
(con->request.content_length >> 10) > srv->srvconf.max_request_size) {
- /* the request body itself is larger then
+ /* the request body itself is larger then
* our our max_request_size
*/
-
+
con->http_status = 413;
con->keep_alive = 0;
-
- log_error_write(srv, __FILE__, __LINE__, "sos",
- "request-size too long:", (off_t) con->request.content_length, "-> 413");
+
+ log_error_write(srv, __FILE__, __LINE__, "sds",
+ "request-size too long:", con->request.content_length, "-> 413");
return 0;
}
-
-
+
+
/* we have content */
if (con->request.content_length != 0) {
return 1;
}
}
-
+
return 0;
}
@@ -1196,9 +1027,9 @@ int http_request_header_finished(server *srv, connection *con) {
UNUSED(srv);
if (con->request.request->used < 5) return 0;
-
+
if (0 == memcmp(con->request.request->ptr + con->request.request->used - 5, "\r\n\r\n", 4)) return 1;
if (NULL != strstr(con->request.request->ptr, "\r\n\r\n")) return 1;
-
+
return 0;
}
diff --git a/src/response.c b/src/response.c
index e829cfd..2617842 100644
--- a/src/response.c
+++ b/src/response.c
@@ -1,14 +1,3 @@
-#include "response.h"
-#include "keyvalue.h"
-#include "log.h"
-#include "stat_cache.h"
-#include "chunk.h"
-
-#include "configfile.h"
-#include "connections.h"
-
-#include "plugin.h"
-
#include <sys/types.h>
#include <sys/stat.h>
@@ -24,269 +13,164 @@
#include <stdio.h>
+#include "response.h"
+#include "keyvalue.h"
+#include "log.h"
+#include "stat_cache.h"
+#include "chunk.h"
+
+#include "connections.h"
+
+#include "plugin.h"
+
#include "sys-socket.h"
-#include "version.h"
int http_response_write_header(server *srv, connection *con) {
buffer *b;
size_t i;
int have_date = 0;
int have_server = 0;
-
+
b = chunkqueue_get_prepend_buffer(con->write_queue);
-
+
if (con->request.http_version == HTTP_VERSION_1_1) {
- buffer_copy_string_len(b, CONST_STR_LEN("HTTP/1.1 "));
+ BUFFER_COPY_STRING_CONST(b, "HTTP/1.1 ");
} else {
- buffer_copy_string_len(b, CONST_STR_LEN("HTTP/1.0 "));
+ BUFFER_COPY_STRING_CONST(b, "HTTP/1.0 ");
}
buffer_append_long(b, con->http_status);
- buffer_append_string_len(b, CONST_STR_LEN(" "));
+ BUFFER_APPEND_STRING_CONST(b, " ");
buffer_append_string(b, get_http_status_name(con->http_status));
-
- /* disable keep-alive if requested */
- if (con->request_count > con->conf.max_keep_alive_requests || 0 == con->conf.max_keep_alive_idle) {
- con->keep_alive = 0;
- } else {
- con->keep_alive_idle = con->conf.max_keep_alive_idle;
- }
-
+
if (con->request.http_version != HTTP_VERSION_1_1 || con->keep_alive == 0) {
- if (con->keep_alive) {
- response_header_overwrite(srv, con, CONST_STR_LEN("Connection"), CONST_STR_LEN("keep-alive"));
- } else {
- response_header_overwrite(srv, con, CONST_STR_LEN("Connection"), CONST_STR_LEN("close"));
- }
+ BUFFER_APPEND_STRING_CONST(b, "\r\nConnection: ");
+ buffer_append_string(b, con->keep_alive ? "keep-alive" : "close");
}
-
+
if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
- response_header_overwrite(srv, con, CONST_STR_LEN("Transfer-Encoding"), CONST_STR_LEN("chunked"));
+ BUFFER_APPEND_STRING_CONST(b, "\r\nTransfer-Encoding: chunked");
}
-
-
+
+
/* add all headers */
for (i = 0; i < con->response.headers->used; i++) {
data_string *ds;
-
+
ds = (data_string *)con->response.headers->data[i];
-
+
if (ds->value->used && ds->key->used &&
- 0 != strncasecmp(ds->key->ptr, CONST_STR_LEN("X-LIGHTTPD-")) &&
- 0 != strncasecmp(ds->key->ptr, CONST_STR_LEN("X-Sendfile"))) {
- if (0 == strcasecmp(ds->key->ptr, "Date")) have_date = 1;
- if (0 == strcasecmp(ds->key->ptr, "Server")) have_server = 1;
- if (0 == strcasecmp(ds->key->ptr, "Content-Encoding") && 304 == con->http_status) continue;
+ 0 != strncmp(ds->key->ptr, "X-LIGHTTPD-", sizeof("X-LIGHTTPD-") - 1)) {
+ if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Date"))) have_date = 1;
+ if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Server"))) have_server = 1;
- buffer_append_string_len(b, CONST_STR_LEN("\r\n"));
+ BUFFER_APPEND_STRING_CONST(b, "\r\n");
buffer_append_string_buffer(b, ds->key);
- buffer_append_string_len(b, CONST_STR_LEN(": "));
-#if 0
- /**
- * the value might contain newlines, encode them with at least one white-space
- */
- buffer_append_string_encoded(b, CONST_BUF_LEN(ds->value), ENCODING_HTTP_HEADER);
-#else
+ BUFFER_APPEND_STRING_CONST(b, ": ");
buffer_append_string_buffer(b, ds->value);
+#if 0
+ log_error_write(srv, __FILE__, __LINE__, "bb",
+ ds->key, ds->value);
#endif
}
}
-
+
if (!have_date) {
/* HTTP/1.1 requires a Date: header */
- buffer_append_string_len(b, CONST_STR_LEN("\r\nDate: "));
-
+ BUFFER_APPEND_STRING_CONST(b, "\r\nDate: ");
+
/* cache the generated timestamp */
if (srv->cur_ts != srv->last_generated_date_ts) {
buffer_prepare_copy(srv->ts_date_str, 255);
-
- strftime(srv->ts_date_str->ptr, srv->ts_date_str->size - 1,
+
+ strftime(srv->ts_date_str->ptr, srv->ts_date_str->size - 1,
"%a, %d %b %Y %H:%M:%S GMT", gmtime(&(srv->cur_ts)));
-
+
srv->ts_date_str->used = strlen(srv->ts_date_str->ptr) + 1;
-
+
srv->last_generated_date_ts = srv->cur_ts;
}
-
+
buffer_append_string_buffer(b, srv->ts_date_str);
}
if (!have_server) {
if (buffer_is_empty(con->conf.server_tag)) {
- buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_DESC));
- } else if (con->conf.server_tag->used > 1) {
- buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: "));
- buffer_append_string_encoded(b, CONST_BUF_LEN(con->conf.server_tag), ENCODING_HTTP_HEADER);
+ BUFFER_APPEND_STRING_CONST(b, "\r\nServer: " PACKAGE_NAME "/" PACKAGE_VERSION);
+ } else {
+ BUFFER_APPEND_STRING_CONST(b, "\r\nServer: ");
+ buffer_append_string_buffer(b, con->conf.server_tag);
}
}
-
- buffer_append_string_len(b, CONST_STR_LEN("\r\n\r\n"));
-
-
+
+ BUFFER_APPEND_STRING_CONST(b, "\r\n\r\n");
+
+
con->bytes_header = b->used - 1;
-
+
if (con->conf.log_response_header) {
log_error_write(srv, __FILE__, __LINE__, "sSb", "Response-Header:", "\n", b);
}
-
+
return 0;
}
-#ifdef USE_OPENSSL
-static void https_add_ssl_entries(connection *con) {
- X509 *xs;
- X509_NAME *xn;
- X509_NAME_ENTRY *xe;
- int i, nentries;
-
- if (
- SSL_get_verify_result(con->ssl) != X509_V_OK
- || !(xs = SSL_get_peer_certificate(con->ssl))
- ) {
- return;
- }
-
- xn = X509_get_subject_name(xs);
- for (i = 0, nentries = X509_NAME_entry_count(xn); i < nentries; ++i) {
- int xobjnid;
- const char * xobjsn;
- data_string *envds;
-
- if (!(xe = X509_NAME_get_entry(xn, i))) {
- continue;
- }
- xobjnid = OBJ_obj2nid((ASN1_OBJECT*)X509_NAME_ENTRY_get_object(xe));
- xobjsn = OBJ_nid2sn(xobjnid);
- if (!xobjsn) {
- continue;
- }
-
- if (NULL == (envds = (data_string *)array_get_unused_element(con->environment, TYPE_STRING))) {
- envds = data_string_init();
- }
- buffer_copy_string_len(envds->key, CONST_STR_LEN("SSL_CLIENT_S_DN_"));
- buffer_append_string(envds->key, xobjsn);
- buffer_copy_string_len(
- envds->value,
- (const char *)xe->value->data, xe->value->length
- );
- /* pick one of the exported values as "authed user", for example
- * ssl.verifyclient.username = "SSL_CLIENT_S_DN_UID" or "SSL_CLIENT_S_DN_emailAddress"
- */
- if (buffer_is_equal(con->conf.ssl_verifyclient_username, envds->key)) {
- buffer_copy_string_buffer(con->authed_user, envds->value);
- }
- array_insert_unique(con->environment, (data_unset *)envds);
- }
- if (con->conf.ssl_verifyclient_export_cert) {
- BIO *bio;
- if (NULL != (bio = BIO_new(BIO_s_mem()))) {
- data_string *envds;
- int n;
-
- PEM_write_bio_X509(bio, xs);
- n = BIO_pending(bio);
-
- if (NULL == (envds = (data_string *)array_get_unused_element(con->environment, TYPE_STRING))) {
- envds = data_string_init();
- }
-
- buffer_copy_string_len(envds->key, CONST_STR_LEN("SSL_CLIENT_CERT"));
- buffer_prepare_copy(envds->value, n+1);
- BIO_read(bio, envds->value->ptr, n);
- BIO_free(bio);
- envds->value->ptr[n] = '\0';
- envds->value->used = n+1;
- array_insert_unique(con->environment, (data_unset *)envds);
- }
- }
- X509_free(xs);
-}
-#endif
handler_t http_response_prepare(server *srv, connection *con) {
handler_t r;
-
+
/* looks like someone has already done a decision */
- if (con->mode == DIRECT &&
+ if (con->mode == DIRECT &&
(con->http_status != 0 && con->http_status != 200)) {
/* remove a packets in the queue */
if (con->file_finished == 0) {
chunkqueue_reset(con->write_queue);
}
-
+
return HANDLER_FINISHED;
}
-
+
/* no decision yet, build conf->filename */
if (con->mode == DIRECT && con->physical.path->used == 0) {
char *qstr;
-
- /* we only come here when we have the parse the full request again
- *
- * a HANDLER_COMEBACK from mod_rewrite and mod_fastcgi might be a
- * problem here as mod_setenv might get called multiple times
- *
- * fastcgi-auth might lead to a COMEBACK too
- * fastcgi again dead server too
- *
- * mod_compress might add headers twice too
- *
- * */
-
- config_cond_cache_reset(srv, con);
- config_setup_connection(srv, con); /* Perhaps this could be removed at other places. */
-
+
if (con->conf.log_condition_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "run condition");
}
config_patch_connection(srv, con, COMP_SERVER_SOCKET); /* SERVERsocket */
-
+
/**
* prepare strings
- *
- * - uri.path_raw
+ *
+ * - uri.path_raw
* - uri.path (secure)
* - uri.query
- *
+ *
*/
-
- /**
+
+ /**
* Name according to RFC 2396
- *
+ *
* - scheme
* - authority
* - path
* - query
- *
- * (scheme)://(authority)(path)?(query)#fragment
- *
- *
+ *
+ * (scheme)://(authority)(path)?(query)
+ *
+ *
*/
-
- if (con->conf.is_ssl) {
- buffer_copy_string_len(con->uri.scheme, CONST_STR_LEN("https"));
- } else {
- buffer_copy_string_len(con->uri.scheme, CONST_STR_LEN("http"));
- }
+
+ buffer_copy_string(con->uri.scheme, con->conf.is_ssl ? "https" : "http");
buffer_copy_string_buffer(con->uri.authority, con->request.http_host);
buffer_to_lower(con->uri.authority);
-
- config_patch_connection(srv, con, COMP_HTTP_SCHEME); /* Scheme: */
+
config_patch_connection(srv, con, COMP_HTTP_HOST); /* Host: */
- config_patch_connection(srv, con, COMP_HTTP_REMOTE_IP); /* Client-IP */
+ config_patch_connection(srv, con, COMP_HTTP_REMOTEIP); /* Client-IP */
config_patch_connection(srv, con, COMP_HTTP_REFERER); /* Referer: */
- config_patch_connection(srv, con, COMP_HTTP_USER_AGENT);/* User-Agent: */
- config_patch_connection(srv, con, COMP_HTTP_LANGUAGE); /* Accept-Language: */
+ config_patch_connection(srv, con, COMP_HTTP_USERAGENT); /* User-Agent: */
config_patch_connection(srv, con, COMP_HTTP_COOKIE); /* Cookie: */
- config_patch_connection(srv, con, COMP_HTTP_REQUEST_METHOD); /* REQUEST_METHOD */
-
- /** their might be a fragment which has to be cut away */
- if (NULL != (qstr = strchr(con->request.uri->ptr, '#'))) {
- con->request.uri->used = qstr - con->request.uri->ptr;
- con->request.uri->ptr[con->request.uri->used++] = '\0';
- }
-
+
/** extract query string from request.uri */
if (NULL != (qstr = strchr(con->request.uri->ptr, '?'))) {
buffer_copy_string (con->uri.query, qstr + 1);
@@ -304,16 +188,22 @@ handler_t http_response_prepare(server *srv, connection *con) {
log_error_write(srv, __FILE__, __LINE__, "sb", "URI-path : ", con->uri.path_raw);
log_error_write(srv, __FILE__, __LINE__, "sb", "URI-query : ", con->uri.query);
}
-
-
+
+ /* disable keep-alive if requested */
+
+ if (con->request_count > con->conf.max_keep_alive_requests) {
+ con->keep_alive = 0;
+ }
+
+
/**
- *
- * call plugins
- *
+ *
+ * call plugins
+ *
* - based on the raw URL
- *
+ *
*/
-
+
switch(r = plugins_call_handle_uri_raw(srv, con)) {
case HANDLER_GO_ON:
break;
@@ -327,14 +217,14 @@ handler_t http_response_prepare(server *srv, connection *con) {
break;
}
- /* build filename
+ /* build filename
*
* - decode url-encodings (e.g. %20 -> ' ')
* - remove path-modifiers (e.g. /../)
*/
-
-
-
+
+
+
if (con->request.http_method == HTTP_METHOD_OPTIONS &&
con->uri.path_raw->ptr[0] == '*' && con->uri.path_raw->ptr[1] == '\0') {
/* OPTIONS * ... */
@@ -350,28 +240,16 @@ handler_t http_response_prepare(server *srv, connection *con) {
log_error_write(srv, __FILE__, __LINE__, "sb", "URI-path : ", con->uri.path);
}
-#ifdef USE_OPENSSL
- if (con->conf.is_ssl && con->conf.ssl_verifyclient) {
- https_add_ssl_entries(con);
- }
-#endif
-
/**
- *
- * call plugins
- *
+ *
+ * call plugins
+ *
* - based on the clean URL
- *
+ *
*/
-
+
config_patch_connection(srv, con, COMP_HTTP_URL); /* HTTPurl */
- config_patch_connection(srv, con, COMP_HTTP_QUERY_STRING); /* HTTPqs */
-
- /* do we have to downgrade to 1.0 ? */
- if (!con->conf.allow_http11) {
- con->request.http_version = HTTP_VERSION_1_0;
- }
-
+
switch(r = plugins_call_handle_uri_clean(srv, con)) {
case HANDLER_GO_ON:
break;
@@ -384,11 +262,11 @@ handler_t http_response_prepare(server *srv, connection *con) {
log_error_write(srv, __FILE__, __LINE__, "");
break;
}
-
+
if (con->request.http_method == HTTP_METHOD_OPTIONS &&
con->uri.path->ptr[0] == '*' && con->uri.path_raw->ptr[1] == '\0') {
/* option requests are handled directly without checking of the path */
-
+
response_header_insert(srv, con, CONST_STR_LEN("Allow"), CONST_STR_LEN("OPTIONS, GET, HEAD, POST"));
con->http_status = 200;
@@ -398,74 +276,38 @@ handler_t http_response_prepare(server *srv, connection *con) {
}
/***
- *
- * border
- *
+ *
+ * border
+ *
* logical filename (URI) becomes a physical filename here
- *
- *
- *
+ *
+ *
+ *
*/
-
-
-
-
+
+
+
+
/* 1. stat()
* ... ISREG() -> ok, go on
* ... ISDIR() -> index-file -> redirect
- *
- * 2. pathinfo()
+ *
+ * 2. pathinfo()
* ... ISREG()
- *
+ *
* 3. -> 404
- *
+ *
*/
-
+
/*
* SEARCH DOCUMENT ROOT
*/
-
+
/* set a default */
-
+
buffer_copy_string_buffer(con->physical.doc_root, con->conf.document_root);
buffer_copy_string_buffer(con->physical.rel_path, con->uri.path);
-
-#if defined(__WIN32) || defined(__CYGWIN__)
- /* strip dots from the end and spaces
- *
- * windows/dos handle those filenames as the same file
- *
- * foo == foo. == foo..... == "foo... " == "foo.. ./"
- *
- * This will affect in some cases PATHINFO
- *
- * on native windows we could prepend the filename with \\?\ to circumvent
- * this behaviour. I have no idea how to push this through cygwin
- *
- * */
-
- if (con->physical.rel_path->used > 1) {
- buffer *b = con->physical.rel_path;
- size_t i;
-
- if (b->used > 2 &&
- b->ptr[b->used-2] == '/' &&
- (b->ptr[b->used-3] == ' ' ||
- b->ptr[b->used-3] == '.')) {
- b->ptr[b->used--] = '\0';
- }
-
- for (i = b->used - 2; b->used > 1; i--) {
- if (b->ptr[i] == ' ' ||
- b->ptr[i] == '.') {
- b->ptr[b->used--] = '\0';
- } else {
- break;
- }
- }
- }
-#endif
-
+
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- before doc_root");
log_error_write(srv, __FILE__, __LINE__, "sb", "Doc-Root :", con->physical.doc_root);
@@ -487,12 +329,12 @@ handler_t http_response_prepare(server *srv, connection *con) {
log_error_write(srv, __FILE__, __LINE__, "");
break;
}
-
- /* MacOS X and Windows can't distiguish between upper and lower-case
- *
+
+ /* MacOS X and Windows can't distiguish between upper and lower-case
+ *
* convert to lower-case
*/
- if (con->conf.force_lowercase_filenames) {
+ if (con->conf.force_lower_case) {
buffer_to_lower(con->physical.rel_path);
}
@@ -500,13 +342,13 @@ handler_t http_response_prepare(server *srv, connection *con) {
if (buffer_is_empty(con->server_name)) {
buffer_copy_string_buffer(con->server_name, con->uri.authority);
}
-
- /**
- * create physical filename
+
+ /**
+ * create physical filename
* -> physical.path = docroot + rel_path
- *
+ *
*/
-
+
buffer_copy_string_buffer(con->physical.path, con->physical.doc_root);
BUFFER_APPEND_SLASH(con->physical.path);
buffer_copy_string_buffer(con->physical.basedir, con->physical.path);
@@ -536,7 +378,7 @@ handler_t http_response_prepare(server *srv, connection *con) {
log_error_write(srv, __FILE__, __LINE__, "");
break;
}
-
+
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- logical -> physical");
log_error_write(srv, __FILE__, __LINE__, "sb", "Doc-Root :", con->physical.doc_root);
@@ -544,57 +386,41 @@ handler_t http_response_prepare(server *srv, connection *con) {
log_error_write(srv, __FILE__, __LINE__, "sb", "Path :", con->physical.path);
}
}
-
- /*
+
+ /*
* Noone catched away the file from normal path of execution yet (like mod_access)
- *
+ *
* Go on and check of the file exists at all
*/
-
+
if (con->mode == DIRECT) {
char *slash = NULL;
char *pathinfo = NULL;
int found = 0;
stat_cache_entry *sce = NULL;
-
+
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- handling physical path");
log_error_write(srv, __FILE__, __LINE__, "sb", "Path :", con->physical.path);
}
-
+
if (HANDLER_ERROR != stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
/* file exists */
-
+
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- file found");
log_error_write(srv, __FILE__, __LINE__, "sb", "Path :", con->physical.path);
}
-#ifdef HAVE_LSTAT
- if ((sce->is_symlink != 0) && !con->conf.follow_symlink) {
- con->http_status = 403;
-
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s", "-- access denied due symlink restriction");
- log_error_write(srv, __FILE__, __LINE__, "sb", "Path :", con->physical.path);
- }
-
- buffer_reset(con->physical.path);
- return HANDLER_FINISHED;
- };
-#endif
+
if (S_ISDIR(sce->st.st_mode)) {
- if (con->uri.path->ptr[con->uri.path->used - 2] != '/') {
+ if (con->physical.path->ptr[con->physical.path->used - 2] != '/') {
/* redirect to .../ */
-
+
http_response_redirect_to_directory(srv, con);
-
+
return HANDLER_FINISHED;
}
-#ifdef HAVE_LSTAT
- } else if (!S_ISREG(sce->st.st_mode) && !sce->is_symlink) {
-#else
} else if (!S_ISREG(sce->st.st_mode)) {
-#endif
/* any special handling of non-reg files ?*/
@@ -603,12 +429,12 @@ handler_t http_response_prepare(server *srv, connection *con) {
switch (errno) {
case EACCES:
con->http_status = 403;
-
+
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- access denied");
log_error_write(srv, __FILE__, __LINE__, "sb", "Path :", con->physical.path);
}
-
+
buffer_reset(con->physical.path);
return HANDLER_FINISHED;
case ENOENT:
@@ -628,85 +454,74 @@ handler_t http_response_prepare(server *srv, connection *con) {
/* we have no idea what happend. let's tell the user so. */
con->http_status = 500;
buffer_reset(con->physical.path);
-
+
log_error_write(srv, __FILE__, __LINE__, "ssbsb",
"file not found ... or so: ", strerror(errno),
con->uri.path,
"->", con->physical.path);
-
+
return HANDLER_FINISHED;
}
-
+
/* not found, perhaps PATHINFO */
-
+
buffer_copy_string_buffer(srv->tmp_buf, con->physical.path);
-
+
do {
+ struct stat st;
+
if (slash) {
buffer_copy_string_len(con->physical.path, srv->tmp_buf->ptr, slash - srv->tmp_buf->ptr);
} else {
buffer_copy_string_buffer(con->physical.path, srv->tmp_buf);
}
-
- if (HANDLER_ERROR != stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
- found = S_ISREG(sce->st.st_mode);
+
+ if (0 == stat(con->physical.path->ptr, &(st)) &&
+ S_ISREG(st.st_mode)) {
+ found = 1;
break;
}
-
+
if (pathinfo != NULL) {
*pathinfo = '\0';
}
slash = strrchr(srv->tmp_buf->ptr, '/');
-
+
if (pathinfo != NULL) {
/* restore '/' */
*pathinfo = '/';
}
-
+
if (slash) pathinfo = slash;
- } while ((found == 0) && (slash != NULL) && ((size_t)(slash - srv->tmp_buf->ptr) > (con->physical.basedir->used - 2)));
-
+ } while ((found == 0) && (slash != NULL) && (slash - srv->tmp_buf->ptr > con->physical.basedir->used - 2));
+
if (found == 0) {
/* no it really doesn't exists */
con->http_status = 404;
-
+
if (con->conf.log_file_not_found) {
log_error_write(srv, __FILE__, __LINE__, "sbsb",
"file not found:", con->uri.path,
"->", con->physical.path);
}
-
+
buffer_reset(con->physical.path);
-
+
return HANDLER_FINISHED;
}
-
-#ifdef HAVE_LSTAT
- if ((sce->is_symlink != 0) && !con->conf.follow_symlink) {
- con->http_status = 403;
-
- if (con->conf.log_request_handling) {
- log_error_write(srv, __FILE__, __LINE__, "s", "-- access denied due symlink restriction");
- log_error_write(srv, __FILE__, __LINE__, "sb", "Path :", con->physical.path);
- }
-
- buffer_reset(con->physical.path);
- return HANDLER_FINISHED;
- };
-#endif
-
+
/* we have a PATHINFO */
if (pathinfo) {
buffer_copy_string(con->request.pathinfo, pathinfo);
-
+
/*
* shorten uri.path
*/
-
+
con->uri.path->used -= strlen(pathinfo);
con->uri.path->ptr[con->uri.path->used - 1] = '\0';
}
-
+
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- after pathinfo check");
log_error_write(srv, __FILE__, __LINE__, "sb", "Path :", con->physical.path);
@@ -714,12 +529,12 @@ handler_t http_response_prepare(server *srv, connection *con) {
log_error_write(srv, __FILE__, __LINE__, "sb", "Pathinfo :", con->request.pathinfo);
}
}
-
+
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- handling subrequest");
log_error_write(srv, __FILE__, __LINE__, "sb", "Path :", con->physical.path);
}
-
+
/* call the handlers */
switch(r = plugins_call_handle_subrequest_start(srv, con)) {
case HANDLER_GO_ON:
@@ -730,27 +545,21 @@ handler_t http_response_prepare(server *srv, connection *con) {
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- subrequest finished");
}
-
+
/* something strange happend */
return r;
}
-
+
/* if we are still here, no one wanted the file, status 403 is ok I think */
-
- if (con->mode == DIRECT && con->http_status == 0) {
- switch (con->request.http_method) {
- case HTTP_METHOD_OPTIONS:
- con->http_status = 200;
- break;
- default:
- con->http_status = 403;
- }
-
+
+ if (con->mode == DIRECT) {
+ con->http_status = 403;
+
return HANDLER_FINISHED;
}
-
+
}
-
+
switch(r = plugins_call_handle_subrequest(srv, con)) {
case HANDLER_GO_ON:
/* request was not handled, looks like we are done */
@@ -761,7 +570,7 @@ handler_t http_response_prepare(server *srv, connection *con) {
/* something strange happend */
return r;
}
-
+
/* can't happen */
return HANDLER_COMEBACK;
}
diff --git a/src/response.h b/src/response.h
index 289add8..c9ff234 100644
--- a/src/response.h
+++ b/src/response.h
@@ -1,16 +1,15 @@
#ifndef _RESPONSE_H_
#define _RESPONSE_H_
-#include "server.h"
-
#include <time.h>
+#include "server.h"
+
int http_response_parse(server *srv, connection *con);
int http_response_write_header(server *srv, connection *con);
int response_header_insert(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen);
int response_header_overwrite(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen);
-int response_header_append(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen);
handler_t http_response_prepare(server *srv, connection *con);
int http_response_redirect_to_directory(server *srv, connection *con);
diff --git a/src/server.c b/src/server.c
index 2878d18..5c515e3 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1,20 +1,3 @@
-#include "server.h"
-#include "buffer.h"
-#include "network.h"
-#include "log.h"
-#include "keyvalue.h"
-#include "response.h"
-#include "request.h"
-#include "chunk.h"
-#include "http_chunk.h"
-#include "fdevent.h"
-#include "connections.h"
-#include "stat_cache.h"
-#include "plugin.h"
-#include "joblist.h"
-#include "network_backends.h"
-#include "version.h"
-
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
@@ -31,33 +14,40 @@
#include <stdio.h>
+#include "server.h"
+#include "buffer.h"
+#include "network.h"
+#include "log.h"
+#include "keyvalue.h"
+#include "response.h"
+#include "request.h"
+#include "chunk.h"
+#include "http_chunk.h"
+#include "fdevent.h"
+#include "connections.h"
+#include "stat_cache.h"
+#include "plugin.h"
+#include "joblist.h"
+
#ifdef HAVE_GETOPT_H
-# include <getopt.h>
+#include <getopt.h>
#endif
#ifdef HAVE_VALGRIND_VALGRIND_H
-# include <valgrind/valgrind.h>
+#include <valgrind/valgrind.h>
#endif
#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
+#include <sys/wait.h>
#endif
#ifdef HAVE_PWD_H
-# include <grp.h>
-# include <pwd.h>
+#include <grp.h>
+#include <pwd.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
-#endif
-
-#ifdef HAVE_SYS_PRCTL_H
-# include <sys/prctl.h>
-#endif
-
-#ifdef USE_OPENSSL
-# include <openssl/err.h>
+#include <sys/resource.h>
#endif
#ifndef __sgi
@@ -65,78 +55,29 @@
/* #define USE_ALARM */
#endif
-#ifdef HAVE_GETUID
-# ifndef HAVE_ISSETUGID
-
-static int l_issetugid() {
- return (geteuid() != getuid() || getegid() != getgid());
-}
-
-# define issetugid l_issetugid
-# endif
-#endif
-
static volatile sig_atomic_t srv_shutdown = 0;
static volatile sig_atomic_t graceful_shutdown = 0;
static volatile sig_atomic_t handle_sig_alarm = 1;
static volatile sig_atomic_t handle_sig_hup = 0;
-static volatile sig_atomic_t forwarded_sig_hup = 0;
#if defined(HAVE_SIGACTION) && defined(SA_SIGINFO)
-static volatile siginfo_t last_sigterm_info;
-static volatile siginfo_t last_sighup_info;
-
static void sigaction_handler(int sig, siginfo_t *si, void *context) {
- static siginfo_t empty_siginfo;
+ UNUSED(si);
UNUSED(context);
- if (!si) si = &empty_siginfo;
-
switch (sig) {
- case SIGTERM:
- srv_shutdown = 1;
- last_sigterm_info = *si;
- break;
- case SIGINT:
- if (graceful_shutdown) {
- srv_shutdown = 1;
- } else {
- graceful_shutdown = 1;
- }
- last_sigterm_info = *si;
-
- break;
- case SIGALRM:
- handle_sig_alarm = 1;
- break;
- case SIGHUP:
- /**
- * we send the SIGHUP to all procs in the process-group
- * this includes ourself
- *
- * make sure we only send it once and don't create a
- * infinite loop
- */
- if (!forwarded_sig_hup) {
- handle_sig_hup = 1;
- last_sighup_info = *si;
- } else {
- forwarded_sig_hup = 0;
- }
- break;
- case SIGCHLD:
- break;
+ case SIGTERM: srv_shutdown = 1; break;
+ case SIGINT: graceful_shutdown = 1; break;
+ case SIGALRM: handle_sig_alarm = 1; break;
+ case SIGHUP: handle_sig_hup = 1; break;
+ case SIGCHLD: break;
}
}
#elif defined(HAVE_SIGNAL) || defined(HAVE_SIGACTION)
static void signal_handler(int sig) {
switch (sig) {
case SIGTERM: srv_shutdown = 1; break;
- case SIGINT:
- if (graceful_shutdown) srv_shutdown = 1;
- else graceful_shutdown = 1;
-
- break;
+ case SIGINT: graceful_shutdown = 1; break;
case SIGALRM: handle_sig_alarm = 1; break;
case SIGHUP: handle_sig_hup = 1; break;
case SIGCHLD: break;
@@ -156,26 +97,27 @@ static void daemonize(void) {
signal(SIGTSTP, SIG_IGN);
#endif
if (0 != fork()) exit(0);
-
+
if (-1 == setsid()) exit(0);
signal(SIGHUP, SIG_IGN);
if (0 != fork()) exit(0);
-
+
if (0 != chdir("/")) exit(0);
+
+ umask(0);
}
#endif
static server *server_init(void) {
int i;
- FILE *frandom = NULL;
-
+
server *srv = calloc(1, sizeof(*srv));
assert(srv);
#define CLEAN(x) \
srv->x = buffer_init();
-
+
CLEAN(response_header);
CLEAN(parse_full_path);
CLEAN(ts_debug_str);
@@ -185,84 +127,65 @@ static server *server_init(void) {
CLEAN(tmp_buf);
srv->empty_string = buffer_init_string("");
CLEAN(cond_check_buf);
-
+
CLEAN(srvconf.errorlog_file);
- CLEAN(srvconf.breakagelog_file);
CLEAN(srvconf.groupname);
CLEAN(srvconf.username);
CLEAN(srvconf.changeroot);
CLEAN(srvconf.bindhost);
CLEAN(srvconf.event_handler);
CLEAN(srvconf.pid_file);
-
+
CLEAN(tmp_chunk_len);
#undef CLEAN
-
+
#define CLEAN(x) \
srv->x = array_init();
-
+
CLEAN(config_context);
CLEAN(config_touched);
- CLEAN(status);
#undef CLEAN
-
+
for (i = 0; i < FILE_CACHE_MAX; i++) {
- srv->mtime_cache[i].mtime = (time_t)-1;
srv->mtime_cache[i].str = buffer_init();
}
-
- if ((NULL != (frandom = fopen("/dev/urandom", "rb")) || NULL != (frandom = fopen("/dev/random", "rb")))
- && 1 == fread(srv->entropy, sizeof(srv->entropy), 1, frandom)) {
- unsigned int e;
- memcpy(&e, srv->entropy, sizeof(e) < sizeof(srv->entropy) ? sizeof(e) : sizeof(srv->entropy));
- srand(e);
- srv->is_real_entropy = 1;
- } else {
- unsigned int j;
- srand(time(NULL) ^ getpid());
- srv->is_real_entropy = 0;
- for (j = 0; j < sizeof(srv->entropy); j++)
- srv->entropy[j] = rand();
- }
- if (frandom) fclose(frandom);
-
+
srv->cur_ts = time(NULL);
srv->startup_ts = srv->cur_ts;
-
+
srv->conns = calloc(1, sizeof(*srv->conns));
assert(srv->conns);
-
+
srv->joblist = calloc(1, sizeof(*srv->joblist));
assert(srv->joblist);
-
+
srv->fdwaitqueue = calloc(1, sizeof(*srv->fdwaitqueue));
assert(srv->fdwaitqueue);
-
+
srv->srvconf.modules = array_init();
srv->srvconf.modules_dir = buffer_init_string(LIBRARY_DIR);
srv->srvconf.network_backend = buffer_init();
srv->srvconf.upload_tempdirs = array_init();
- srv->srvconf.reject_expect_100_with_417 = 1;
-
+
/* use syslog */
- srv->errorlog_fd = STDERR_FILENO;
- srv->errorlog_mode = ERRORLOG_FD;
+ srv->errorlog_fd = -1;
+ srv->errorlog_mode = ERRORLOG_STDERR;
srv->split_vals = array_init();
-
+
return srv;
}
static void server_free(server *srv) {
size_t i;
-
+
for (i = 0; i < FILE_CACHE_MAX; i++) {
buffer_free(srv->mtime_cache[i].str);
}
-
+
#define CLEAN(x) \
buffer_free(srv->x);
-
+
CLEAN(response_header);
CLEAN(parse_full_path);
CLEAN(ts_debug_str);
@@ -272,9 +195,8 @@ static void server_free(server *srv) {
CLEAN(tmp_buf);
CLEAN(empty_string);
CLEAN(cond_check_buf);
-
+
CLEAN(srvconf.errorlog_file);
- CLEAN(srvconf.breakagelog_file);
CLEAN(srvconf.groupname);
CLEAN(srvconf.username);
CLEAN(srvconf.changeroot);
@@ -282,8 +204,7 @@ static void server_free(server *srv) {
CLEAN(srvconf.event_handler);
CLEAN(srvconf.pid_file);
CLEAN(srvconf.modules_dir);
- CLEAN(srvconf.network_backend);
-
+
CLEAN(tmp_chunk_len);
#undef CLEAN
@@ -291,64 +212,47 @@ static void server_free(server *srv) {
fdevent_unregister(srv->ev, srv->fd);
#endif
fdevent_free(srv->ev);
-
+
free(srv->conns);
-
+
if (srv->config_storage) {
for (i = 0; i < srv->config_context->used; i++) {
specific_config *s = srv->config_storage[i];
if (!s) continue;
-
+
buffer_free(s->document_root);
buffer_free(s->server_name);
buffer_free(s->server_tag);
buffer_free(s->ssl_pemfile);
buffer_free(s->ssl_ca_file);
- buffer_free(s->ssl_cipher_list);
- buffer_free(s->ssl_dh_file);
- buffer_free(s->ssl_ec_curve);
buffer_free(s->error_handler);
buffer_free(s->errorfile_prefix);
array_free(s->mimetypes);
- buffer_free(s->ssl_verifyclient_username);
-#ifdef USE_OPENSSL
- SSL_CTX_free(s->ssl_ctx);
-#endif
+
free(s);
}
free(srv->config_storage);
srv->config_storage = NULL;
}
-
+
#define CLEAN(x) \
array_free(srv->x);
-
+
CLEAN(config_context);
CLEAN(config_touched);
- CLEAN(status);
- CLEAN(srvconf.upload_tempdirs);
#undef CLEAN
-
+
joblist_free(srv, srv->joblist);
fdwaitqueue_free(srv, srv->fdwaitqueue);
-
+
if (srv->stat_cache) {
stat_cache_free(srv->stat_cache);
}
array_free(srv->srvconf.modules);
array_free(srv->split_vals);
-
-#ifdef USE_OPENSSL
- if (srv->ssl_is_init) {
- CRYPTO_cleanup_all_ex_data();
- ERR_free_strings();
- ERR_remove_state(0);
- EVP_cleanup();
- }
-#endif
-
+
free(srv);
}
@@ -358,166 +262,21 @@ static void show_version (void) {
#else
# define TEXT_SSL
#endif
- char *b = PACKAGE_DESC TEXT_SSL \
+ char *b = PACKAGE_NAME "-" PACKAGE_VERSION TEXT_SSL \
" - a light and fast webserver\n" \
"Build-Date: " __DATE__ " " __TIME__ "\n";
;
-#undef TEXT_SSL
+#undef TEXT_SSL
write(STDOUT_FILENO, b, strlen(b));
}
-static void show_features (void) {
- const char features[] = ""
-#ifdef USE_SELECT
- "\t+ select (generic)\n"
-#else
- "\t- select (generic)\n"
-#endif
-#ifdef USE_POLL
- "\t+ poll (Unix)\n"
-#else
- "\t- poll (Unix)\n"
-#endif
-#ifdef USE_LINUX_SIGIO
- "\t+ rt-signals (Linux 2.4+)\n"
-#else
- "\t- rt-signals (Linux 2.4+)\n"
-#endif
-#ifdef USE_LINUX_EPOLL
- "\t+ epoll (Linux 2.6)\n"
-#else
- "\t- epoll (Linux 2.6)\n"
-#endif
-#ifdef USE_SOLARIS_DEVPOLL
- "\t+ /dev/poll (Solaris)\n"
-#else
- "\t- /dev/poll (Solaris)\n"
-#endif
-#ifdef USE_SOLARIS_PORT
- "\t+ eventports (Solaris)\n"
-#else
- "\t- eventports (Solaris)\n"
-#endif
-#ifdef USE_FREEBSD_KQUEUE
- "\t+ kqueue (FreeBSD)\n"
-#else
- "\t- kqueue (FreeBSD)\n"
-#endif
-#ifdef USE_LIBEV
- "\t+ libev (generic)\n"
-#else
- "\t- libev (generic)\n"
-#endif
- "\nNetwork handler:\n\n"
-#if defined USE_LINUX_SENDFILE
- "\t+ linux-sendfile\n"
-#else
- "\t- linux-sendfile\n"
-#endif
-#if defined USE_FREEBSD_SENDFILE
- "\t+ freebsd-sendfile\n"
-#else
- "\t- freebsd-sendfile\n"
-#endif
-#if defined USE_SOLARIS_SENDFILEV
- "\t+ solaris-sendfilev\n"
-#else
- "\t- solaris-sendfilev\n"
-#endif
-#if defined USE_WRITEV
- "\t+ writev\n"
-#else
- "\t- writev\n"
-#endif
- "\t+ write\n"
-#ifdef USE_MMAP
- "\t+ mmap support\n"
-#else
- "\t- mmap support\n"
-#endif
- "\nFeatures:\n\n"
-#ifdef HAVE_IPV6
- "\t+ IPv6 support\n"
-#else
- "\t- IPv6 support\n"
-#endif
-#if defined HAVE_ZLIB_H && defined HAVE_LIBZ
- "\t+ zlib support\n"
-#else
- "\t- zlib support\n"
-#endif
-#if defined HAVE_BZLIB_H && defined HAVE_LIBBZ2
- "\t+ bzip2 support\n"
-#else
- "\t- bzip2 support\n"
-#endif
-#ifdef HAVE_LIBCRYPT
- "\t+ crypt support\n"
-#else
- "\t- crypt support\n"
-#endif
-#ifdef USE_OPENSSL
- "\t+ SSL Support\n"
-#else
- "\t- SSL Support\n"
-#endif
-#ifdef HAVE_LIBPCRE
- "\t+ PCRE support\n"
-#else
- "\t- PCRE support\n"
-#endif
-#ifdef HAVE_MYSQL
- "\t+ mySQL support\n"
-#else
- "\t- mySQL support\n"
-#endif
-#if defined(HAVE_LDAP_H) && defined(HAVE_LBER_H) && defined(HAVE_LIBLDAP) && defined(HAVE_LIBLBER)
- "\t+ LDAP support\n"
-#else
- "\t- LDAP support\n"
-#endif
-#ifdef HAVE_MEMCACHE_H
- "\t+ memcached support\n"
-#else
- "\t- memcached support\n"
-#endif
-#ifdef HAVE_FAM_H
- "\t+ FAM support\n"
-#else
- "\t- FAM support\n"
-#endif
-#ifdef HAVE_LUA_H
- "\t+ LUA support\n"
-#else
- "\t- LUA support\n"
-#endif
-#ifdef HAVE_LIBXML_H
- "\t+ xml support\n"
-#else
- "\t- xml support\n"
-#endif
-#ifdef HAVE_SQLITE3_H
- "\t+ SQLite support\n"
-#else
- "\t- SQLite support\n"
-#endif
-#ifdef HAVE_GDBM_H
- "\t+ GDBM support\n"
-#else
- "\t- GDBM support\n"
-#endif
- "\n";
- show_version();
- printf("\nEvent Handlers:\n\n%s", features);
-}
-
static void show_help (void) {
#ifdef USE_OPENSSL
# define TEXT_SSL " (ssl)"
#else
# define TEXT_SSL
#endif
- char *b = PACKAGE_DESC TEXT_SSL " ("__DATE__ " " __TIME__ ")" \
+ char *b = PACKAGE_NAME "-" PACKAGE_VERSION TEXT_SSL " ("__DATE__ " " __TIME__ ")" \
" - a light and fast webserver\n" \
"usage:\n" \
" -f <name> filename of the config-file\n" \
@@ -526,11 +285,10 @@ static void show_help (void) {
" -t test the config-file, and exit\n" \
" -D don't go to background (default: go to background)\n" \
" -v show version\n" \
-" -V show compile-time features\n" \
" -h show this help\n" \
"\n"
;
-#undef TEXT_SSL
+#undef TEXT_SSL
#undef TEXT_IPV6
write(STDOUT_FILENO, b, strlen(b));
}
@@ -550,27 +308,27 @@ int main (int argc, char **argv) {
#ifdef HAVE_GETRLIMIT
struct rlimit rlim;
#endif
-
+
#ifdef USE_ALARM
struct itimerval interval;
-
+
interval.it_interval.tv_sec = 1;
interval.it_interval.tv_usec = 0;
interval.it_value.tv_sec = 1;
interval.it_value.tv_usec = 0;
#endif
-
-
+
+
/* for nice %b handling in strfime() */
setlocale(LC_TIME, "C");
-
+
if (NULL == (srv = server_init())) {
- fprintf(stderr, "did this really happen?\n");
+ fprintf(stderr, "did this really happend ?\n");
return -1;
}
-
+
/* init structs done */
-
+
srv->srvconf.port = 0;
#ifdef HAVE_GETUID
i_am_root = (getuid() == 0);
@@ -578,18 +336,11 @@ int main (int argc, char **argv) {
i_am_root = 0;
#endif
srv->srvconf.dont_daemonize = 0;
-
- while(-1 != (o = getopt(argc, argv, "f:m:hvVDpt"))) {
+
+ while(-1 != (o = getopt(argc, argv, "f:m:hvDpt"))) {
switch(o) {
- case 'f':
- if (srv->config_storage) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "Can only read one config file. Use the include command to use multiple config files.");
-
- server_free(srv);
- return -1;
- }
- if (config_read(srv, optarg)) {
+ case 'f':
+ if (config_read(srv, optarg)) {
server_free(srv);
return -1;
}
@@ -601,28 +352,27 @@ int main (int argc, char **argv) {
case 't': test_config = 1; break;
case 'D': srv->srvconf.dont_daemonize = 1; break;
case 'v': show_version(); return 0;
- case 'V': show_features(); return 0;
case 'h': show_help(); return 0;
- default:
+ default:
show_help();
server_free(srv);
return -1;
}
}
-
+
if (!srv->config_storage) {
log_error_write(srv, __FILE__, __LINE__, "s",
"No configuration available. Try using -f option.");
-
+
server_free(srv);
return -1;
}
-
+
if (print_config) {
data_unset *dc = srv->config_context->data[0];
if (dc) {
dc->print(dc, 0);
- fprintf(stdout, "\n");
+ fprintf(stderr, "\n");
} else {
/* shouldn't happend */
fprintf(stderr, "global config not found\n");
@@ -637,51 +387,62 @@ int main (int argc, char **argv) {
server_free(srv);
return 0;
}
-
+
/* close stdin and stdout, as they are not needed */
- openDevNull(STDIN_FILENO);
- openDevNull(STDOUT_FILENO);
-
+ /* move stdin to /dev/null */
+ if (-1 != (fd = open("/dev/null", O_RDONLY))) {
+ close(STDIN_FILENO);
+ dup2(fd, STDIN_FILENO);
+ close(fd);
+ }
+
+ /* move stdout to /dev/null */
+ if (-1 != (fd = open("/dev/null", O_WRONLY))) {
+ close(STDOUT_FILENO);
+ dup2(fd, STDOUT_FILENO);
+ close(fd);
+ }
+
if (0 != config_set_defaults(srv)) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"setting default values failed");
server_free(srv);
return -1;
}
-
+
/* UID handling */
#ifdef HAVE_GETUID
- if (!i_am_root && issetugid()) {
+ if (!i_am_root && (geteuid() == 0 || getegid() == 0)) {
/* we are setuid-root */
-
- log_error_write(srv, __FILE__, __LINE__, "s",
+
+ log_error_write(srv, __FILE__, __LINE__, "s",
"Are you nuts ? Don't apply a SUID bit to this binary");
-
+
server_free(srv);
return -1;
}
#endif
-
+
/* check document-root */
if (srv->config_storage[0]->document_root->used <= 1) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"document-root is not set\n");
-
+
server_free(srv);
-
+
return -1;
}
-
+
if (plugins_load(srv)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"loading plugins finally failed");
-
+
plugins_free(srv);
server_free(srv);
-
+
return -1;
}
-
+
/* open pid file BEFORE chroot */
if (srv->srvconf.pid_file->used) {
if (-1 == (pid_fd = open(srv->srvconf.pid_file->ptr, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) {
@@ -691,18 +452,18 @@ int main (int argc, char **argv) {
"opening pid-file failed:", srv->srvconf.pid_file, strerror(errno));
return -1;
}
-
+
if (0 != stat(srv->srvconf.pid_file->ptr, &st)) {
log_error_write(srv, __FILE__, __LINE__, "sbs",
"stating existing pid-file failed:", srv->srvconf.pid_file, strerror(errno));
}
-
+
if (!S_ISREG(st.st_mode)) {
log_error_write(srv, __FILE__, __LINE__, "sb",
"pid-file exists and isn't regular file:", srv->srvconf.pid_file);
return -1;
}
-
+
if (-1 == (pid_fd = open(srv->srvconf.pid_file->ptr, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) {
log_error_write(srv, __FILE__, __LINE__, "sbs",
"opening pid-file failed:", srv->srvconf.pid_file, strerror(errno));
@@ -729,7 +490,7 @@ int main (int argc, char **argv) {
#ifdef HAVE_VALGRIND_VALGRIND_H
if (RUNNING_ON_VALGRIND) use_rlimit = 0;
#endif
-
+
#ifdef HAVE_GETRLIMIT
if (0 != getrlimit(RLIMIT_NOFILE, &rlim)) {
log_error_write(srv, __FILE__, __LINE__,
@@ -737,13 +498,13 @@ int main (int argc, char **argv) {
strerror(errno));
return -1;
}
-
+
if (use_rlimit && srv->srvconf.max_fds) {
/* set rlimits */
-
+
rlim.rlim_cur = srv->srvconf.max_fds;
rlim.rlim_max = srv->srvconf.max_fds;
-
+
if (0 != setrlimit(RLIMIT_NOFILE, &rlim)) {
log_error_write(srv, __FILE__, __LINE__,
"ss", "couldn't set 'max filedescriptors'",
@@ -752,48 +513,45 @@ int main (int argc, char **argv) {
}
}
+ /* #372: solaris need some fds extra for devpoll */
+ if (rlim.rlim_cur > 10) rlim.rlim_cur -= 10;
+
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
- srv->max_fds = rlim.rlim_cur < ((int)FD_SETSIZE) - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
+ srv->max_fds = rlim.rlim_cur < FD_SETSIZE - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
} else {
srv->max_fds = rlim.rlim_cur;
}
-
- /* set core file rlimit, if enable_cores is set */
- if (use_rlimit && srv->srvconf.enable_cores && getrlimit(RLIMIT_CORE, &rlim) == 0) {
- rlim.rlim_cur = rlim.rlim_max;
- setrlimit(RLIMIT_CORE, &rlim);
- }
#endif
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
/* don't raise the limit above FD_SET_SIZE */
- if (srv->max_fds > ((int)FD_SETSIZE) - 200) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ if (srv->max_fds > FD_SETSIZE - 200) {
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"can't raise max filedescriptors above", FD_SETSIZE - 200,
"if event-handler is 'select'. Use 'poll' or something else or reduce server.max-fds.");
return -1;
}
}
-
+
#ifdef HAVE_PWD_H
/* set user and group */
if (srv->srvconf.username->used) {
if (NULL == (pwd = getpwnam(srv->srvconf.username->ptr))) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"can't find username", srv->srvconf.username);
return -1;
}
-
+
if (pwd->pw_uid == 0) {
log_error_write(srv, __FILE__, __LINE__, "s",
"I will not set uid to 0\n");
return -1;
}
}
-
+
if (srv->srvconf.groupname->used) {
if (NULL == (grp = getgrnam(srv->srvconf.groupname->ptr))) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
+ log_error_write(srv, __FILE__, __LINE__, "sb",
"can't find groupname", srv->srvconf.groupname);
return -1;
}
@@ -803,28 +561,15 @@ int main (int argc, char **argv) {
return -1;
}
}
-#endif
+#endif
/* we need root-perms for port < 1024 */
if (0 != network_init(srv)) {
plugins_free(srv);
server_free(srv);
-
+
return -1;
}
-#ifdef HAVE_PWD_H
- /*
- * Change group before chroot, when we have access
- * to /etc/group
- * */
- if (NULL != grp) {
- setgid(grp->gr_gid);
- setgroups(0, NULL);
- if (srv->srvconf.username->used) {
- initgroups(srv->srvconf.username->ptr, grp->gr_gid);
- }
- }
-#endif
-#ifdef HAVE_CHROOT
+#ifdef HAVE_CHROOT
if (srv->srvconf.changeroot->used) {
tzset();
@@ -840,17 +585,13 @@ int main (int argc, char **argv) {
#endif
#ifdef HAVE_PWD_H
/* drop root privs */
- if (NULL != pwd) {
- setuid(pwd->pw_uid);
- }
-#endif
-#if defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_DUMPABLE)
- /**
- * on IRIX 6.5.30 they have prctl() but no DUMPABLE
- */
- if (srv->srvconf.enable_cores) {
- prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+ if (srv->srvconf.groupname->used) {
+ setgid(grp->gr_gid);
+ setgroups(0, NULL);
}
+ if (srv->srvconf.username->used && srv->srvconf.groupname->used)
+ initgroups(srv->srvconf.username->ptr, grp->gr_gid);
+ if (srv->srvconf.username->used) setuid(pwd->pw_uid);
#endif
} else {
@@ -862,114 +603,79 @@ int main (int argc, char **argv) {
return -1;
}
- /**
- * we are not root can can't increase the fd-limit, but we can reduce it
- */
- if (srv->srvconf.max_fds && srv->srvconf.max_fds < rlim.rlim_cur) {
- /* set rlimits */
-
- rlim.rlim_cur = srv->srvconf.max_fds;
-
- if (0 != setrlimit(RLIMIT_NOFILE, &rlim)) {
- log_error_write(srv, __FILE__, __LINE__,
- "ss", "couldn't set 'max filedescriptors'",
- strerror(errno));
- return -1;
- }
- }
-
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
- srv->max_fds = rlim.rlim_cur < ((int)FD_SETSIZE) - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
+ srv->max_fds = rlim.rlim_cur < FD_SETSIZE - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
} else {
srv->max_fds = rlim.rlim_cur;
}
-
- /* set core file rlimit, if enable_cores is set */
- if (srv->srvconf.enable_cores && getrlimit(RLIMIT_CORE, &rlim) == 0) {
- rlim.rlim_cur = rlim.rlim_max;
- setrlimit(RLIMIT_CORE, &rlim);
- }
-
#endif
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
/* don't raise the limit above FD_SET_SIZE */
- if (srv->max_fds > ((int)FD_SETSIZE) - 200) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ if (srv->max_fds > FD_SETSIZE - 200) {
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"can't raise max filedescriptors above", FD_SETSIZE - 200,
"if event-handler is 'select'. Use 'poll' or something else or reduce server.max-fds.");
return -1;
}
}
-
+
if (0 != network_init(srv)) {
plugins_free(srv);
server_free(srv);
-
+
return -1;
}
}
/* set max-conns */
- if (srv->srvconf.max_conns > srv->max_fds/2) {
- /* we can't have more connections than max-fds/2 */
- log_error_write(srv, __FILE__, __LINE__, "sdd", "can't have more connections than fds/2: ", srv->srvconf.max_conns, srv->max_fds);
- srv->max_conns = srv->max_fds/2;
+ if (srv->srvconf.max_conns > srv->max_fds) {
+ /* we can't have more connections than max-fds */
+ srv->max_conns = srv->max_fds;
} else if (srv->srvconf.max_conns) {
/* otherwise respect the wishes of the user */
srv->max_conns = srv->srvconf.max_conns;
} else {
- /* or use the default: we really don't want to hit max-fds */
- srv->max_conns = srv->max_fds/3;
+ /* or use the default */
+ srv->max_conns = srv->max_fds;
}
-
+
if (HANDLER_GO_ON != plugins_call_init(srv)) {
log_error_write(srv, __FILE__, __LINE__, "s", "Initialization of plugins failed. Going down.");
-
+
plugins_free(srv);
network_close(srv);
server_free(srv);
-
+
return -1;
}
-#ifdef HAVE_FORK
+#ifdef HAVE_FORK
/* network is up, let's deamonize ourself */
if (srv->srvconf.dont_daemonize == 0) daemonize();
#endif
srv->gid = getgid();
srv->uid = getuid();
-
+
/* write pid file */
if (pid_fd != -1) {
buffer_copy_long(srv->tmp_buf, getpid());
- buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN("\n"));
+ buffer_append_string(srv->tmp_buf, "\n");
write(pid_fd, srv->tmp_buf->ptr, srv->tmp_buf->used - 1);
close(pid_fd);
pid_fd = -1;
}
-
- /* Close stderr ASAP in the child process to make sure that nothing
- * is being written to that fd which may not be valid anymore. */
- if (-1 == log_error_open(srv)) {
- log_error_write(srv, __FILE__, __LINE__, "s", "Opening errorlog failed. Going down.");
-
- plugins_free(srv);
- network_close(srv);
- server_free(srv);
- return -1;
- }
-
+
if (HANDLER_GO_ON != plugins_call_set_defaults(srv)) {
log_error_write(srv, __FILE__, __LINE__, "s", "Configuration of plugins failed. Going down.");
-
+
plugins_free(srv);
network_close(srv);
server_free(srv);
-
+
return -1;
}
-
+
/* dump unused config-keys */
for (i = 0; i < srv->config_context->used; i++) {
array *config = ((data_config *)srv->config_context->data[i])->value;
@@ -977,42 +683,43 @@ int main (int argc, char **argv) {
for (j = 0; config && j < config->used; j++) {
data_unset *du = config->data[j];
-
+
/* all var.* is known as user defined variable */
if (strncmp(du->key->ptr, "var.", sizeof("var.") - 1) == 0) {
continue;
}
if (NULL == array_get_element(srv->config_touched, du->key->ptr)) {
- log_error_write(srv, __FILE__, __LINE__, "sbs",
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
"WARNING: unknown config-key:",
du->key,
"(ignored)");
}
}
}
-
- if (srv->config_unsupported) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "Configuration contains unsupported keys. Going down.");
- }
-
+
if (srv->config_deprecated) {
- log_error_write(srv, __FILE__, __LINE__, "s",
+ log_error_write(srv, __FILE__, __LINE__, "s",
"Configuration contains deprecated keys. Going down.");
+
+ plugins_free(srv);
+ network_close(srv);
+ server_free(srv);
+
+ return -1;
}
-
- if (srv->config_unsupported || srv->config_deprecated) {
+
+ if (-1 == log_error_open(srv)) {
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ "opening errorlog failed, dying");
+
plugins_free(srv);
network_close(srv);
server_free(srv);
-
return -1;
}
-
-
-
-
+
+
#ifdef HAVE_SIGACTION
memset(&act, 0, sizeof(act));
act.sa_handler = SIG_IGN;
@@ -1032,7 +739,7 @@ int main (int argc, char **argv) {
sigaction(SIGHUP, &act, NULL);
sigaction(SIGALRM, &act, NULL);
sigaction(SIGCHLD, &act, NULL);
-
+
#elif defined(HAVE_SIGNAL)
/* ignore the SIGPIPE from sendfile() */
signal(SIGPIPE, SIG_IGN);
@@ -1043,25 +750,25 @@ int main (int argc, char **argv) {
signal(SIGCHLD, signal_handler);
signal(SIGINT, signal_handler);
#endif
-
+
#ifdef USE_ALARM
signal(SIGALRM, signal_handler);
-
+
/* setup periodic timer (1 second) */
if (setitimer(ITIMER_REAL, &interval, NULL)) {
log_error_write(srv, __FILE__, __LINE__, "s", "setting timer failed");
return -1;
}
-
+
getitimer(ITIMER_REAL, &interval);
#endif
-#ifdef HAVE_FORK
+#ifdef HAVE_FORK
/* start watcher and workers */
num_childs = srv->srvconf.max_worker;
if (num_childs > 0) {
int child = 0;
- while (!child && !srv_shutdown && !graceful_shutdown) {
+ while (!child && !srv_shutdown) {
if (num_childs > 0) {
switch (fork()) {
case -1:
@@ -1075,80 +782,24 @@ int main (int argc, char **argv) {
}
} else {
int status;
-
- if (-1 != wait(&status)) {
- /**
- * one of our workers went away
- */
- num_childs++;
- } else {
- switch (errno) {
- case EINTR:
- /**
- * if we receive a SIGHUP we have to close our logs ourself as we don't
- * have the mainloop who can help us here
- */
- if (handle_sig_hup) {
- handle_sig_hup = 0;
-
- log_error_cycle(srv);
-
- /**
- * forward to all procs in the process-group
- *
- * we also send it ourself
- */
- if (!forwarded_sig_hup) {
- forwarded_sig_hup = 1;
- kill(0, SIGHUP);
- }
- }
- break;
- default:
- break;
- }
- }
+ wait(&status);
+ num_childs++;
}
}
-
- /**
- * for the parent this is the exit-point
- */
- if (!child) {
- /**
- * kill all children too
- */
- if (graceful_shutdown) {
- kill(0, SIGINT);
- } else if (srv_shutdown) {
- kill(0, SIGTERM);
- }
-
- log_error_close(srv);
- network_close(srv);
- connections_free(srv);
- plugins_free(srv);
- server_free(srv);
- return 0;
+ if (srv_shutdown) {
+ kill(0, SIGTERM);
}
+ if (!child) return 0;
}
#endif
- if (NULL == (srv->ev = fdevent_init(srv, srv->max_fds + 1, srv->event_handler))) {
+ if (NULL == (srv->ev = fdevent_init(srv->max_fds + 1, srv->event_handler))) {
log_error_write(srv, __FILE__, __LINE__,
"s", "fdevent_init failed");
return -1;
}
-
- /* libev backend overwrites our SIGCHLD handler and calls waitpid on SIGCHLD; we want our own SIGCHLD handling. */
-#ifdef HAVE_SIGACTION
- sigaction(SIGCHLD, &act, NULL);
-#elif defined(HAVE_SIGNAL)
- signal(SIGCHLD, signal_handler);
-#endif
-
- /*
- * kqueue() is called here, select resets its internals,
+ /*
+ * kqueue() is called here, select resets its internals,
* all server sockets get their handlers
*
* */
@@ -1156,7 +807,7 @@ int main (int argc, char **argv) {
plugins_free(srv);
network_close(srv);
server_free(srv);
-
+
return -1;
}
@@ -1171,8 +822,6 @@ int main (int argc, char **argv) {
/* setup FAM */
if (srv->srvconf.stat_cache_engine == STAT_CACHE_ENGINE_FAM) {
if (0 != FAMOpen2(srv->stat_cache->fam, "lighttpd")) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "could not open a fam connection, dieing.");
return -1;
}
#ifdef HAVE_FAMNOEXISTS
@@ -1181,7 +830,7 @@ int main (int argc, char **argv) {
srv->stat_cache->fam_fcce_ndx = -1;
fdevent_register(srv->ev, FAMCONNECTION_GETFD(srv->stat_cache->fam), stat_cache_handle_fdevent, NULL);
- fdevent_event_set(srv->ev, &(srv->stat_cache->fam_fcce_ndx), FAMCONNECTION_GETFD(srv->stat_cache->fam), FDEVENT_IN);
+ fdevent_event_add(srv->ev, &(srv->stat_cache->fam_fcce_ndx), FAMCONNECTION_GETFD(srv->stat_cache->fam), FDEVENT_IN);
}
#endif
@@ -1203,16 +852,16 @@ int main (int argc, char **argv) {
int n;
size_t ndx;
time_t min_ts;
-
+
if (handle_sig_hup) {
handler_t r;
-
+
/* reset notification */
handle_sig_hup = 0;
-
-
+
+
/* cycle logfiles */
-
+
switch(r = plugins_call_handle_sighup(srv)) {
case HANDLER_GO_ON:
break;
@@ -1220,41 +869,30 @@ int main (int argc, char **argv) {
log_error_write(srv, __FILE__, __LINE__, "sd", "sighup-handler return with an error", r);
break;
}
-
+
if (-1 == log_error_cycle(srv)) {
log_error_write(srv, __FILE__, __LINE__, "s", "cycling errorlog failed, dying");
-
+
return -1;
- } else {
-#ifdef HAVE_SIGACTION
- log_error_write(srv, __FILE__, __LINE__, "sdsd",
- "logfiles cycled UID =",
- last_sighup_info.si_uid,
- "PID =",
- last_sighup_info.si_pid);
-#else
- log_error_write(srv, __FILE__, __LINE__, "s",
- "logfiles cycled");
-#endif
}
}
-
+
if (handle_sig_alarm) {
/* a new second */
-
+
#ifdef USE_ALARM
/* reset notification */
handle_sig_alarm = 0;
#endif
-
+
/* get current time */
min_ts = time(NULL);
-
+
if (min_ts != srv->cur_ts) {
int cs = 0;
connections *conns = srv->conns;
handler_t r;
-
+
switch(r = plugins_call_handle_trigger(srv)) {
case HANDLER_GO_ON:
break;
@@ -1265,21 +903,21 @@ int main (int argc, char **argv) {
log_error_write(srv, __FILE__, __LINE__, "d", r);
break;
}
-
+
/* trigger waitpid */
srv->cur_ts = min_ts;
-
- /* cleanup stat-cache */
+
+ /* cleanup stat-cache */
stat_cache_trigger_cleanup(srv);
/**
- * check all connections for timeouts
- *
+ * check all connections for timeouts
+ *
*/
for (ndx = 0; ndx < conns->used; ndx++) {
int changed = 0;
connection *con;
int t_diff;
-
+
con = conns->ptr[ndx];
if (con->state == CON_STATE_READ ||
@@ -1288,17 +926,17 @@ int main (int argc, char **argv) {
if (srv->cur_ts - con->read_idle_ts > con->conf.max_read_idle) {
/* time - out */
#if 0
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"connection closed - read-timeout:", con->fd);
#endif
connection_set_state(srv, con, CON_STATE_ERROR);
changed = 1;
}
} else {
- if (srv->cur_ts - con->read_idle_ts > con->keep_alive_idle) {
+ if (srv->cur_ts - con->read_idle_ts > con->conf.max_keep_alive_idle) {
/* time - out */
#if 0
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"connection closed - read-timeout:", con->fd);
#endif
connection_set_state(srv, con, CON_STATE_ERROR);
@@ -1306,20 +944,20 @@ int main (int argc, char **argv) {
}
}
}
-
+
if ((con->state == CON_STATE_WRITE) &&
- (con->write_request_ts != 0)) {
+ (con->write_request_ts != 0)) {
#if 0
if (srv->cur_ts - con->write_request_ts > 60) {
- log_error_write(srv, __FILE__, __LINE__, "sdd",
+ log_error_write(srv, __FILE__, __LINE__, "sdd",
"connection closed - pre-write-request-timeout:", con->fd, srv->cur_ts - con->write_request_ts);
}
#endif
-
+
if (srv->cur_ts - con->write_request_ts > con->conf.max_write_idle) {
/* time - out */
- if (con->conf.log_timeouts) {
- log_error_write(srv, __FILE__, __LINE__, "sbsosds",
+#if 1
+ log_error_write(srv, __FILE__, __LINE__, "sbsosds",
"NOTE: a request for",
con->request.uri,
"timed out after writing",
@@ -1327,47 +965,42 @@ int main (int argc, char **argv) {
"bytes. We waited",
(int)con->conf.max_write_idle,
"seconds. If this a problem increase server.max-write-idle");
- }
+#endif
connection_set_state(srv, con, CON_STATE_ERROR);
changed = 1;
}
}
-
- if (con->state == CON_STATE_CLOSE && (srv->cur_ts - con->close_timeout_ts > HTTP_LINGER_TIMEOUT)) {
- changed = 1;
- }
-
/* we don't like div by zero */
if (0 == (t_diff = srv->cur_ts - con->connection_start)) t_diff = 1;
-
- if (con->traffic_limit_reached &&
- (con->conf.kbytes_per_second == 0 ||
+
+ if (con->traffic_limit_reached &&
+ (con->conf.kbytes_per_second == 0 ||
((con->bytes_written / t_diff) < con->conf.kbytes_per_second * 1024))) {
/* enable connection again */
con->traffic_limit_reached = 0;
-
+
changed = 1;
}
-
+
if (changed) {
connection_state_machine(srv, con);
}
con->bytes_written_cur_second = 0;
*(con->conf.global_bytes_per_second_cnt_ptr) = 0;
-
+
#if 0
if (cs == 0) {
fprintf(stderr, "connection-state: ");
cs = 1;
}
-
+
fprintf(stderr, "c[%d,%d]: %s ",
con->fd,
con->fcgi.fd,
connection_get_state(con->state));
#endif
}
-
+
if (cs == 1) fprintf(stderr, "\n");
}
}
@@ -1375,25 +1008,25 @@ int main (int argc, char **argv) {
if (srv->sockets_disabled) {
/* our server sockets are disabled, why ? */
- if ((srv->cur_fds + srv->want_fds < srv->max_fds * 8 / 10) && /* we have enough unused fds */
- (srv->conns->used <= srv->max_conns * 9 / 10) &&
+ if ((srv->cur_fds + srv->want_fds < srv->max_fds * 0.8) && /* we have enough unused fds */
+ (srv->conns->used < srv->max_conns * 0.9) &&
(0 == graceful_shutdown)) {
for (i = 0; i < srv->srv_sockets.used; i++) {
server_socket *srv_socket = srv->srv_sockets.ptr[i];
- fdevent_event_set(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd, FDEVENT_IN);
+ fdevent_event_add(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd, FDEVENT_IN);
}
-
+
log_error_write(srv, __FILE__, __LINE__, "s", "[note] sockets enabled again");
-
+
srv->sockets_disabled = 0;
}
} else {
- if ((srv->cur_fds + srv->want_fds > srv->max_fds * 9 / 10) || /* out of fds */
- (srv->conns->used >= srv->max_conns) || /* out of connections */
- (graceful_shutdown)) { /* graceful_shutdown */
+ if ((srv->cur_fds + srv->want_fds > srv->max_fds * 0.9) || /* out of fds */
+ (srv->conns->used > srv->max_conns) || /* out of connections */
+ (graceful_shutdown)) { /* graceful_shutdown */
/* disable server-fds */
-
+
for (i = 0; i < srv->srv_sockets.used; i++) {
server_socket *srv_socket = srv->srv_sockets.ptr[i];
fdevent_event_del(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd);
@@ -1410,30 +1043,17 @@ int main (int argc, char **argv) {
srv_socket->fd = -1;
/* network_close() will cleanup after us */
-
- if (srv->srvconf.pid_file->used &&
- srv->srvconf.changeroot->used == 0) {
- if (0 != unlink(srv->srvconf.pid_file->ptr)) {
- if (errno != EACCES && errno != EPERM) {
- log_error_write(srv, __FILE__, __LINE__, "sbds",
- "unlink failed for:",
- srv->srvconf.pid_file,
- errno,
- strerror(errno));
- }
- }
- }
}
}
-
+
if (graceful_shutdown) {
log_error_write(srv, __FILE__, __LINE__, "s", "[note] graceful shutdown started");
- } else if (srv->conns->used >= srv->max_conns) {
+ } else if (srv->conns->used > srv->max_conns) {
log_error_write(srv, __FILE__, __LINE__, "s", "[note] sockets disabled, connection limit reached");
} else {
log_error_write(srv, __FILE__, __LINE__, "s", "[note] sockets disabled, out-of-fds");
}
-
+
srv->sockets_disabled = 1;
}
}
@@ -1443,16 +1063,16 @@ int main (int argc, char **argv) {
* we are ready to terminate without harming anyone */
srv_shutdown = 1;
}
-
+
/* we still have some fds to share */
- if (srv->want_fds) {
+ if (srv->want_fds) {
/* check the fdwaitqueue for waiting fds */
int free_fds = srv->max_fds - srv->cur_fds - 16;
connection *con;
-
+
for (; free_fds > 0 && NULL != (con = fdwaitqueue_unshift(srv, srv->fdwaitqueue)); free_fds--) {
connection_state_machine(srv, con);
-
+
srv->want_fds--;
}
}
@@ -1463,29 +1083,27 @@ int main (int argc, char **argv) {
int fd_ndx;
#if 0
if (n > 0) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"polls:", n);
}
-#endif
+#endif
fd_ndx = -1;
do {
fdevent_handler handler;
void *context;
handler_t r;
-
+
fd_ndx = fdevent_event_next_fdndx (srv->ev, fd_ndx);
- if (-1 == fd_ndx) break; /* not all fdevent handlers know how many fds got an event */
-
revents = fdevent_event_get_revent (srv->ev, fd_ndx);
fd = fdevent_event_get_fd (srv->ev, fd_ndx);
handler = fdevent_get_handler(srv->ev, fd);
context = fdevent_get_context(srv->ev, fd);
-
+
/* connection_handle_fdevent needs a joblist_append */
#if 0
- log_error_write(srv, __FILE__, __LINE__, "sdd",
+ log_error_write(srv, __FILE__, __LINE__, "sdd",
"event for", fd, revents);
-#endif
+#endif
switch (r = (*handler)(srv, context, revents)) {
case HANDLER_FINISHED:
case HANDLER_GO_ON:
@@ -1502,17 +1120,17 @@ int main (int argc, char **argv) {
}
} while (--n > 0);
} else if (n < 0 && errno != EINTR) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "fdevent_poll failed:",
+ log_error_write(srv, __FILE__, __LINE__, "ss",
+ "fdevent_poll failed:",
strerror(errno));
}
-
+
for (ndx = 0; ndx < srv->joblist->used; ndx++) {
connection *con = srv->joblist->ptr[ndx];
handler_t r;
-
+
connection_state_machine(srv, con);
-
+
switch(r = plugins_call_handle_joblist(srv, con)) {
case HANDLER_FINISHED:
case HANDLER_GO_ON:
@@ -1521,44 +1139,32 @@ int main (int argc, char **argv) {
log_error_write(srv, __FILE__, __LINE__, "d", r);
break;
}
-
+
con->in_joblist = 0;
}
-
+
srv->joblist->used = 0;
}
-
+
if (srv->srvconf.pid_file->used &&
- srv->srvconf.changeroot->used == 0 &&
- 0 == graceful_shutdown) {
+ srv->srvconf.changeroot->used == 0) {
if (0 != unlink(srv->srvconf.pid_file->ptr)) {
if (errno != EACCES && errno != EPERM) {
- log_error_write(srv, __FILE__, __LINE__, "sbds",
- "unlink failed for:",
+ log_error_write(srv, __FILE__, __LINE__, "sbds",
+ "unlink failed for:",
srv->srvconf.pid_file,
errno,
strerror(errno));
}
}
}
-
-#ifdef HAVE_SIGACTION
- log_error_write(srv, __FILE__, __LINE__, "sdsd",
- "server stopped by UID =",
- last_sigterm_info.si_uid,
- "PID =",
- last_sigterm_info.si_pid);
-#else
- log_error_write(srv, __FILE__, __LINE__, "s",
- "server stopped");
-#endif
-
+
/* clean-up */
log_error_close(srv);
network_close(srv);
connections_free(srv);
plugins_free(srv);
server_free(srv);
-
+
return 0;
}
diff --git a/src/settings.h b/src/settings.h
index 137a0a8..f0c6354 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -1,14 +1,6 @@
#ifndef _LIGHTTPD_SETTINGS_H_
#define _LIGHTTPD_SETTINGS_H_
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-
-#ifndef __USE_GNU
-# define __USE_GNU /* a hack in my eyes, <fcntl.h> F_SETSIG should work with _GNU_SOURCE */
-#endif
-
#define BV(x) (1 << x)
#define INET_NTOP_CACHE_MAX 4
@@ -17,33 +9,28 @@
/**
* max size of a buffer which will just be reset
* to ->used = 0 instead of really freeing the buffer
- *
+ *
* 64kB (no real reason, just a guess)
*/
#define BUFFER_MAX_REUSE_SIZE (4 * 1024)
-/* both should be way smaller than SSIZE_MAX :) */
-#define MAX_READ_LIMIT (256*1024)
-#define MAX_WRITE_LIMIT (256*1024)
-
/**
* max size of the HTTP request header
- *
+ *
* 32k should be enough for everything (just a guess)
- *
+ *
*/
#define MAX_HTTP_REQUEST_HEADER (32 * 1024)
-typedef enum { HANDLER_UNSET,
- HANDLER_GO_ON,
+typedef enum { HANDLER_UNSET,
+ HANDLER_GO_ON,
HANDLER_FINISHED,
- HANDLER_COMEBACK,
- HANDLER_WAIT_FOR_EVENT,
+ HANDLER_COMEBACK,
+ HANDLER_WAIT_FOR_EVENT,
HANDLER_ERROR,
HANDLER_WAIT_FOR_FD
} handler_t;
-#define HTTP_LINGER_TIMEOUT 5
/* we use it in a enum */
#ifdef TRUE
diff --git a/src/spawn-fcgi.c b/src/spawn-fcgi.c
new file mode 100644
index 0000000..99fc31a
--- /dev/null
+++ b/src/spawn-fcgi.c
@@ -0,0 +1,431 @@
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
+#ifdef HAVE_PWD_H
+#include <grp.h>
+#include <pwd.h>
+#endif
+
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#endif
+
+#define FCGI_LISTENSOCK_FILENO 0
+
+#ifndef UNIX_PATH_MAX
+# define UNIX_PATH_MAX 108
+#endif
+
+#include "sys-socket.h"
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+/* for solaris 2.5 and netbsd 1.3.x */
+#ifndef HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
+#ifdef HAVE_SYS_UN_H
+int fcgi_spawn_connection(char *appPath, unsigned short port, const char *unixsocket, int child_count, int pid_fd, int nofork) {
+ int fcgi_fd;
+ int socket_type, status;
+ struct timeval tv = { 0, 100 * 1000 };
+
+ struct sockaddr_un fcgi_addr_un;
+ struct sockaddr_in fcgi_addr_in;
+ struct sockaddr *fcgi_addr;
+
+ socklen_t servlen;
+
+ if (child_count < 2) {
+ child_count = 5;
+ }
+
+ if (child_count > 256) {
+ child_count = 256;
+ }
+
+
+ if (unixsocket) {
+ memset(&fcgi_addr, 0, sizeof(fcgi_addr));
+
+ fcgi_addr_un.sun_family = AF_UNIX;
+ strcpy(fcgi_addr_un.sun_path, unixsocket);
+
+#ifdef SUN_LEN
+ servlen = SUN_LEN(&fcgi_addr_un);
+#else
+ /* stevens says: */
+ servlen = strlen(fcgi_addr_un.sun_path) + sizeof(fcgi_addr_un.sun_family);
+#endif
+ socket_type = AF_UNIX;
+ fcgi_addr = (struct sockaddr *) &fcgi_addr_un;
+ } else {
+ fcgi_addr_in.sin_family = AF_INET;
+ fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
+ fcgi_addr_in.sin_port = htons(port);
+ servlen = sizeof(fcgi_addr_in);
+
+ socket_type = AF_INET;
+ fcgi_addr = (struct sockaddr *) &fcgi_addr_in;
+ }
+
+ if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
+ fprintf(stderr, "%s.%d\n",
+ __FILE__, __LINE__);
+ return -1;
+ }
+
+ if (-1 == connect(fcgi_fd, fcgi_addr, servlen)) {
+ /* server is not up, spawn in */
+ pid_t child;
+ int val;
+
+ if (unixsocket) unlink(unixsocket);
+
+ close(fcgi_fd);
+
+ /* reopen socket */
+ if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
+ fprintf(stderr, "%s.%d\n",
+ __FILE__, __LINE__);
+ return -1;
+ }
+
+ val = 1;
+ if (setsockopt(fcgi_fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) {
+ fprintf(stderr, "%s.%d\n",
+ __FILE__, __LINE__);
+ return -1;
+ }
+
+ /* create socket */
+ if (-1 == bind(fcgi_fd, fcgi_addr, servlen)) {
+ fprintf(stderr, "%s.%d: bind failed: %s\n",
+ __FILE__, __LINE__,
+ strerror(errno));
+ return -1;
+ }
+
+ if (-1 == listen(fcgi_fd, 1024)) {
+ fprintf(stderr, "%s.%d: fd = -1\n",
+ __FILE__, __LINE__);
+ return -1;
+ }
+
+ if (!nofork) {
+ child = fork();
+ } else {
+ child = 0;
+ }
+
+ switch (child) {
+ case 0: {
+ char cgi_childs[64];
+ char *b;
+
+ int i = 0;
+
+ /* is save as we limit to 256 childs */
+ sprintf(cgi_childs, "PHP_FCGI_CHILDREN=%d", child_count);
+
+ if(fcgi_fd != FCGI_LISTENSOCK_FILENO) {
+ close(FCGI_LISTENSOCK_FILENO);
+ dup2(fcgi_fd, FCGI_LISTENSOCK_FILENO);
+ close(fcgi_fd);
+ }
+
+ /* we don't need the client socket */
+ for (i = 3; i < 256; i++) {
+ close(i);
+ }
+
+ /* create environment */
+
+ putenv(cgi_childs);
+
+ /* fork and replace shell */
+ b = malloc(strlen("exec ") + strlen(appPath) + 1);
+ strcpy(b, "exec ");
+ strcat(b, appPath);
+
+ /* exec the cgi */
+ execl("/bin/sh", "sh", "-c", b, NULL);
+
+ exit(errno);
+
+ break;
+ }
+ case -1:
+ /* error */
+ break;
+ default:
+ /* father */
+
+ /* wait */
+ select(0, NULL, NULL, NULL, &tv);
+
+ switch (waitpid(child, &status, WNOHANG)) {
+ case 0:
+ fprintf(stderr, "%s.%d: child spawned successfully: PID: %d\n",
+ __FILE__, __LINE__,
+ child);
+
+ /* write pid file */
+ if (pid_fd != -1) {
+ /* assume a 32bit pid_t */
+ char pidbuf[12];
+
+ snprintf(pidbuf, sizeof(pidbuf) - 1, "%d", child);
+
+ write(pid_fd, pidbuf, strlen(pidbuf));
+ close(pid_fd);
+ pid_fd = -1;
+ }
+
+ break;
+ case -1:
+ break;
+ default:
+ if (WIFEXITED(status)) {
+ fprintf(stderr, "%s.%d: child exited with: %d, %s\n",
+ __FILE__, __LINE__,
+ WEXITSTATUS(status), strerror(WEXITSTATUS(status)));
+ } else if (WIFSIGNALED(status)) {
+ fprintf(stderr, "%s.%d: child signaled: %d\n",
+ __FILE__, __LINE__,
+ WTERMSIG(status));
+ } else {
+ fprintf(stderr, "%s.%d: child died somehow: %d\n",
+ __FILE__, __LINE__,
+ status);
+ }
+ }
+
+ break;
+ }
+ } else {
+ fprintf(stderr, "%s.%d: socket is already used, can't spawn\n",
+ __FILE__, __LINE__);
+ return -1;
+ }
+
+ close(fcgi_fd);
+
+ return 0;
+}
+
+
+void show_version () {
+ char *b = "spawn-fcgi" "-" PACKAGE_VERSION \
+" - spawns fastcgi processes\n"
+;
+ write(1, b, strlen(b));
+}
+
+void show_help () {
+ char *b = "spawn-fcgi" "-" PACKAGE_VERSION \
+" - spawns fastcgi processes\n" \
+"usage:\n" \
+" -f <fcgiapp> filename of the fcgi-application\n" \
+" -p <port> bind to tcp-port\n" \
+" -s <path> bind to unix-domain socket\n" \
+" -C <childs> (PHP only) numbers of childs to spawn (default 5)\n" \
+" -P <path> name of PID-file for spawed process\n" \
+" -n no fork (for daemontools)\n" \
+" -v show version\n" \
+" -h show this help\n" \
+"(root only)\n" \
+" -c <dir> chroot to directory\n" \
+" -u <user> change to user-id\n" \
+" -g <group> change to group-id\n" \
+;
+ write(1, b, strlen(b));
+}
+
+
+int main(int argc, char **argv) {
+ char *fcgi_app = NULL, *changeroot = NULL, *username = NULL,
+ *groupname = NULL, *unixsocket = NULL, *pid_file = NULL;
+ unsigned short port = 0;
+ int child_count = 5;
+ int i_am_root, o;
+ int pid_fd = -1;
+ int nofork = 0;
+
+ i_am_root = (getuid() == 0);
+
+ while(-1 != (o = getopt(argc, argv, "c:f:g:hnp:u:vC:s:P:"))) {
+ switch(o) {
+ case 'f': fcgi_app = optarg; break;
+ case 'p': port = strtol(optarg, NULL, 10);/* port */ break;
+ case 'C': child_count = strtol(optarg, NULL, 10);/* */ break;
+ case 's': unixsocket = optarg; /* unix-domain socket */ break;
+ case 'c': if (i_am_root) { changeroot = optarg; }/* chroot() */ break;
+ case 'u': if (i_am_root) { username = optarg; } /* set user */ break;
+ case 'g': if (i_am_root) { groupname = optarg; } /* set group */ break;
+ case 'n': nofork = 1; break;
+ case 'P': pid_file = optarg; /* PID file */ break;
+ case 'v': show_version(); return 0;
+ case 'h': show_help(); return 0;
+ default:
+ show_help();
+ return -1;
+ }
+ }
+
+ if (fcgi_app == NULL || (port == 0 && unixsocket == NULL)) {
+ show_help();
+ return -1;
+ }
+
+ if (unixsocket && port) {
+ fprintf(stderr, "%s.%d: %s\n",
+ __FILE__, __LINE__,
+ "either a unix domain socket or a tcp-port, but not both\n");
+
+ return -1;
+ }
+
+ if (unixsocket && strlen(unixsocket) > UNIX_PATH_MAX - 1) {
+ fprintf(stderr, "%s.%d: %s\n",
+ __FILE__, __LINE__,
+ "path of the unix socket is too long\n");
+
+ return -1;
+ }
+
+ /* UID handling */
+ if (!i_am_root && (geteuid() == 0 || getegid() == 0)) {
+ /* we are setuid-root */
+
+ fprintf(stderr, "%s.%d: %s\n",
+ __FILE__, __LINE__,
+ "Are you nuts ? Don't apply a SUID bit to this binary\n");
+
+ return -1;
+ }
+
+ if (pid_file &&
+ (-1 == (pid_fd = open(pid_file, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)))) {
+ struct stat st;
+ if (errno != EEXIST) {
+ fprintf(stderr, "%s.%d: opening pid-file '%s' failed: %s\n",
+ __FILE__, __LINE__,
+ pid_file, strerror(errno));
+
+ return -1;
+ }
+
+ /* ok, file exists */
+
+ if (0 != stat(pid_file, &st)) {
+ fprintf(stderr, "%s.%d: stating pid-file '%s' failed: %s\n",
+ __FILE__, __LINE__,
+ pid_file, strerror(errno));
+
+ return -1;
+ }
+
+ /* is it a regular file ? */
+
+ if (!S_ISREG(st.st_mode)) {
+ fprintf(stderr, "%s.%d: pid-file exists and isn't regular file: '%s'\n",
+ __FILE__, __LINE__,
+ pid_file);
+
+ return -1;
+ }
+
+ if (-1 == (pid_fd = open(pid_file, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) {
+ fprintf(stderr, "%s.%d: opening pid-file '%s' failed: %s\n",
+ __FILE__, __LINE__,
+ pid_file, strerror(errno));
+
+ return -1;
+ }
+ }
+
+ if (i_am_root) {
+ struct group *grp = NULL;
+ struct passwd *pwd = NULL;
+
+ /* set user and group */
+
+ if (username) {
+ if (NULL == (pwd = getpwnam(username))) {
+ fprintf(stderr, "%s.%d: %s, %s\n",
+ __FILE__, __LINE__,
+ "can't find username", username);
+ return -1;
+ }
+
+ if (pwd->pw_uid == 0) {
+ fprintf(stderr, "%s.%d: %s\n",
+ __FILE__, __LINE__,
+ "I will not set uid to 0\n");
+ return -1;
+ }
+ }
+
+ if (groupname) {
+ if (NULL == (grp = getgrnam(groupname))) {
+ fprintf(stderr, "%s.%d: %s %s\n",
+ __FILE__, __LINE__,
+ "can't find groupname",
+ groupname);
+ return -1;
+ }
+ if (grp->gr_gid == 0) {
+ fprintf(stderr, "%s.%d: %s\n",
+ __FILE__, __LINE__,
+ "I will not set gid to 0\n");
+ return -1;
+ }
+ }
+
+ if (changeroot) {
+ if (-1 == chroot(changeroot)) {
+ fprintf(stderr, "%s.%d: %s %s\n",
+ __FILE__, __LINE__,
+ "chroot failed: ", strerror(errno));
+ return -1;
+ }
+ if (-1 == chdir("/")) {
+ fprintf(stderr, "%s.%d: %s %s\n",
+ __FILE__, __LINE__,
+ "chdir failed: ", strerror(errno));
+ return -1;
+ }
+ }
+
+ /* drop root privs */
+ if (groupname) {
+ setgid(grp->gr_gid);
+ setgroups(0, NULL);
+ }
+ if (username) setuid(pwd->pw_uid);
+ }
+
+ return fcgi_spawn_connection(fcgi_app, port, unixsocket, child_count, pid_fd, nofork);
+}
+#else
+int main() {
+ return -1;
+}
+#endif
diff --git a/src/splaytree.c b/src/splaytree.c
index 51aa0ca..3a80910 100644
--- a/src/splaytree.c
+++ b/src/splaytree.c
@@ -46,9 +46,9 @@
Addison-Wesley, 1993, pp 367-375
*/
-#include "splaytree.h"
#include <stdlib.h>
#include <assert.h>
+#include "splaytree.h"
#define compare(i,j) ((i)-(j))
/* This is the comparison. */
@@ -56,18 +56,19 @@
#define node_size splaytree_size
-/* Splay using the key i (which may or may not be in the tree.)
- * The starting root is t, and the tree used is defined by rat
+/* Splay using the key i (which may or may not be in the tree.)
+ * The starting root is t, and the tree used is defined by rat
* size fields are maintained */
splay_tree * splaytree_splay (splay_tree *t, int i) {
splay_tree N, *l, *r, *y;
- int comp, l_size, r_size;
-
+ int comp, root_size, l_size, r_size;
+
if (t == NULL) return t;
N.left = N.right = NULL;
l = r = &N;
+ root_size = node_size(t);
l_size = r_size = 0;
-
+
for (;;) {
comp = compare(i, t->key);
if (comp < 0) {
@@ -119,7 +120,7 @@ splay_tree * splaytree_splay (splay_tree *t, int i) {
y->size = r_size;
r_size -= 1+node_size(y->right);
}
-
+
l->right = t->left; /* assemble */
r->left = t->right;
t->left = N.right;
@@ -186,8 +187,7 @@ splay_tree * splaytree_delete(splay_tree *t, int i) {
}
}
-#if 0
-static splay_tree *find_rank(int r, splay_tree *t) {
+splay_tree *find_rank(int r, splay_tree *t) {
/* Returns a pointer to the node in the tree with the given rank. */
/* Returns NULL if there is no such node. */
/* Does not change the tree. To guarantee logarithmic behavior, */
@@ -206,4 +206,5 @@ static splay_tree *find_rank(int r, splay_tree *t) {
}
}
}
-#endif
+
+
diff --git a/src/splaytree.h b/src/splaytree.h
index 4be1523..98e4234 100644
--- a/src/splaytree.h
+++ b/src/splaytree.h
@@ -19,6 +19,6 @@ splay_tree * splaytree_size(splay_tree *t);
/* This macro returns the size of a node. Unlike "x->size", */
/* it works even if x=NULL. The test could be avoided by using */
/* a special version of NULL which was a real node with size 0. */
-
+
#endif
diff --git a/src/stat_cache.c b/src/stat_cache.c
index 3edaeeb..148f4c8 100644
--- a/src/stat_cache.c
+++ b/src/stat_cache.c
@@ -1,7 +1,4 @@
-#include "log.h"
-#include "stat_cache.h"
-#include "fdevent.h"
-#include "etag.h"
+#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
@@ -14,8 +11,13 @@
#include <fcntl.h>
#include <assert.h>
+#include "log.h"
+#include "stat_cache.h"
+#include "fdevent.h"
+#include "etag.h"
+
#ifdef HAVE_ATTR_ATTRIBUTES_H
-# include <attr/attributes.h>
+#include <attr/attributes.h>
#endif
#ifdef HAVE_FAM_H
@@ -34,7 +36,7 @@
#endif
#ifndef HAVE_LSTAT
-# define lstat stat
+#define lstat stat
#endif
#if 0
@@ -50,8 +52,8 @@
*
* if we get a change-event from FAM, we increment the version in the FAM->dir mapping
*
- * if the stat()-cache is queried we check if the version id for the directory is the
- * same and return immediatly.
+ * if the stat()-cache is queried we check if the version id for the directory is the
+ * same and return immediatly.
*
*
* What we need:
@@ -60,17 +62,17 @@
* - for each FAMRequest we have to find the version in the directory cache (index as userdata)
*
* stat <<-> directory <-> FAMRequest
- *
- * if file is deleted, directory is dirty, file is rechecked ...
+ *
+ * if file is deleted, directory is dirty, file is rechecked ...
* if directory is deleted, directory mapping is removed
- *
+ *
* */
#ifdef HAVE_FAM_H
typedef struct {
FAMRequest *req;
FAMConnection *fc;
-
+
buffer *name;
int version;
@@ -81,16 +83,16 @@ typedef struct {
* - we need a hash
* - the hash-key is used as sorting criteria for a tree
* - a splay-tree is used as we can use the caching effect of it
- */
+ */
/* we want to cleanup the stat-cache every few seconds, let's say 10
*
* - remove entries which are outdated since 30s
* - remove entries which are fresh but havn't been used since 60s
* - if we don't have a stat-cache entry for a directory, release it from the monitor
- */
+ */
-#ifdef DEBUG_STAT_CACHE
+#ifdef DEBUG_STAT_CACHE
typedef struct {
int *ptr;
@@ -103,16 +105,15 @@ static fake_keys ctrl;
stat_cache *stat_cache_init(void) {
stat_cache *fc = NULL;
-
+
fc = calloc(1, sizeof(*fc));
-
+
fc->dir_name = buffer_init();
- fc->hash_key = buffer_init();
#ifdef HAVE_FAM_H
fc->fam = calloc(1, sizeof(*fc->fam));
#endif
-#ifdef DEBUG_STAT_CACHE
+#ifdef DEBUG_STAT_CACHE
ctrl.size = 0;
#endif
@@ -121,24 +122,24 @@ stat_cache *stat_cache_init(void) {
static stat_cache_entry * stat_cache_entry_init(void) {
stat_cache_entry *sce = NULL;
-
+
sce = calloc(1, sizeof(*sce));
-
+
sce->name = buffer_init();
sce->etag = buffer_init();
sce->content_type = buffer_init();
-
+
return sce;
}
static void stat_cache_entry_free(void *data) {
stat_cache_entry *sce = data;
if (!sce) return;
-
+
buffer_free(sce->etag);
buffer_free(sce->name);
buffer_free(sce->content_type);
-
+
free(sce);
}
@@ -147,22 +148,22 @@ static fam_dir_entry * fam_dir_entry_init(void) {
fam_dir_entry *fam_dir = NULL;
fam_dir = calloc(1, sizeof(*fam_dir));
-
+
fam_dir->name = buffer_init();
-
+
return fam_dir;
}
static void fam_dir_entry_free(void *data) {
fam_dir_entry *fam_dir = data;
-
+
if (!fam_dir) return;
-
+
FAMCancelMonitor(fam_dir->fc, fam_dir->req);
-
+
buffer_free(fam_dir->name);
free(fam_dir->req);
-
+
free(fam_dir);
}
#endif
@@ -173,7 +174,7 @@ void stat_cache_free(stat_cache *sc) {
splay_tree *node = sc->files;
osize = sc->files->size;
-
+
stat_cache_entry_free(node->data);
sc->files = splaytree_delete(sc->files, node->key);
@@ -181,18 +182,17 @@ void stat_cache_free(stat_cache *sc) {
}
buffer_free(sc->dir_name);
- buffer_free(sc->hash_key);
#ifdef HAVE_FAM_H
while (sc->dirs) {
int osize;
splay_tree *node = sc->dirs;
-
+
osize = sc->dirs->size;
fam_dir_entry_free(node->data);
sc->dirs = splaytree_delete(sc->dirs, node->key);
-
+
if (osize == 1) {
assert(NULL == sc->dirs);
} else {
@@ -212,7 +212,7 @@ void stat_cache_free(stat_cache *sc) {
static int stat_cache_attr_get(buffer *buf, char *name) {
int attrlen;
int ret;
-
+
attrlen = 1024;
buffer_prepare_copy(buf, attrlen);
attrlen--;
@@ -238,8 +238,9 @@ static uint32_t hashme(buffer *str) {
}
#ifdef HAVE_FAM_H
-handler_t stat_cache_handle_fdevent(server *srv, void *_fce, int revent) {
+handler_t stat_cache_handle_fdevent(void *_srv, void *_fce, int revent) {
size_t i;
+ server *srv = _srv;
stat_cache *sc = srv->stat_cache;
size_t events;
@@ -250,15 +251,15 @@ handler_t stat_cache_handle_fdevent(server *srv, void *_fce, int revent) {
sc->fam) {
events = FAMPending(sc->fam);
-
+
for (i = 0; i < events; i++) {
FAMEvent fe;
fam_dir_entry *fam_dir;
splay_tree *node;
- int ndx, j;
-
+ int ndx;
+
FAMNextEvent(sc->fam, &fe);
-
+
/* handle event */
switch(fe.code) {
@@ -273,25 +274,20 @@ handler_t stat_cache_handle_fdevent(server *srv, void *_fce, int revent) {
/* file/dir is still here */
if (fe.code == FAMChanged) break;
- /* we have 2 versions, follow and no-follow-symlink */
-
- for (j = 0; j < 2; j++) {
- buffer_copy_string(sc->hash_key, fe.filename);
- buffer_append_long(sc->hash_key, j);
+ buffer_copy_string(sc->dir_name, fe.filename);
- ndx = hashme(sc->hash_key);
+ ndx = hashme(sc->dir_name);
- sc->dirs = splaytree_splay(sc->dirs, ndx);
- node = sc->dirs;
+ sc->dirs = splaytree_splay(sc->dirs, ndx);
+ node = sc->dirs;
+
+ if (node && (node->key == ndx)) {
+ int osize = splaytree_size(sc->dirs);
- if (node && (node->key == ndx)) {
- int osize = splaytree_size(sc->dirs);
+ fam_dir_entry_free(node->data);
+ sc->dirs = splaytree_delete(sc->dirs, ndx);
- fam_dir_entry_free(node->data);
- sc->dirs = splaytree_delete(sc->dirs, ndx);
-
- assert(osize - 1 == splaytree_size(sc->dirs));
- }
+ assert(osize - 1 == splaytree_size(sc->dirs));
}
break;
default:
@@ -312,7 +308,7 @@ handler_t stat_cache_handle_fdevent(server *srv, void *_fce, int revent) {
sc->fam = NULL;
}
-
+
return HANDLER_GO_ON;
}
@@ -332,25 +328,11 @@ static int buffer_copy_dirname(buffer *dst, buffer *file) {
}
#endif
-#ifdef HAVE_LSTAT
-static int stat_cache_lstat(server *srv, buffer *dname, struct stat *lst) {
- if (lstat(dname->ptr, lst) == 0) {
- return S_ISLNK(lst->st_mode) ? 0 : 1;
- }
- else {
- log_error_write(srv, __FILE__, __LINE__, "sbs",
- "lstat failed for:",
- dname, strerror(errno));
- };
- return -1;
-}
-#endif
-
/***
*
*
*
- * returns:
+ * returns:
* - HANDLER_FINISHED on cache-miss (don't forget to reopen the file)
* - HANDLER_ERROR on stat() failed -> see errno for problem
*/
@@ -366,45 +348,41 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
struct stat st;
size_t k;
int fd;
- struct stat lst;
-#ifdef DEBUG_STAT_CACHE
+#ifdef DEBUG_STAT_CACHE
size_t i;
#endif
int file_ndx;
splay_tree *file_node = NULL;
- *ret_sce = NULL;
+ *ret_sce = NULL;
- /*
+ /*
* check if the directory for this file has changed
*/
sc = srv->stat_cache;
- buffer_copy_string_buffer(sc->hash_key, name);
- buffer_append_long(sc->hash_key, con->conf.follow_symlink);
-
- file_ndx = hashme(sc->hash_key);
+ file_ndx = hashme(name);
sc->files = splaytree_splay(sc->files, file_ndx);
-#ifdef DEBUG_STAT_CACHE
+#ifdef DEBUG_STAT_CACHE
for (i = 0; i < ctrl.used; i++) {
if (ctrl.ptr[i] == file_ndx) break;
}
#endif
if (sc->files && (sc->files->key == file_ndx)) {
-#ifdef DEBUG_STAT_CACHE
+#ifdef DEBUG_STAT_CACHE
/* it was in the cache */
assert(i < ctrl.used);
#endif
-
- /* we have seen this file already and
+
+ /* we have seen this file already and
* don't stat() it again in the same second */
file_node = sc->files;
-
+
sce = file_node->data;
/* check if the name is the same, we might have a collision */
@@ -412,7 +390,7 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
if (buffer_is_equal(name, sce->name)) {
if (srv->srvconf.stat_cache_engine == STAT_CACHE_ENGINE_SIMPLE) {
if (sce->stat_ts == srv->cur_ts) {
- *ret_sce = sce;
+ *ret_sce = sce;
return HANDLER_GO_ON;
}
}
@@ -422,18 +400,17 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
* file_node is used by the FAM check below to see if we know this file
* and if we can save a stat().
*
- * BUT, the sce is not reset here as the entry into the cache is ok, we
+ * BUT, the sce is not reset here as the entry into the cache is ok, we
* it is just not pointing to our requested file.
- *
+ *
* */
file_node = NULL;
}
} else {
-#ifdef DEBUG_STAT_CACHE
+#ifdef DEBUG_STAT_CACHE
if (i != ctrl.used) {
- log_error_write(srv, __FILE__, __LINE__, "xSB",
- file_ndx, "was already inserted but not found in cache, ", name);
+ fprintf(stderr, "%s.%d: %08x was already inserted but not found in cache, %s\n", __FILE__, __LINE__, file_ndx, name->ptr);
}
assert(i == ctrl.used);
#endif
@@ -443,32 +420,27 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
/* dir-check */
if (srv->srvconf.stat_cache_engine == STAT_CACHE_ENGINE_FAM) {
if (0 != buffer_copy_dirname(sc->dir_name, name)) {
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "no '/' found in filename:", name);
- return HANDLER_ERROR;
+ SEGFAULT();
}
- buffer_copy_string_buffer(sc->hash_key, sc->dir_name);
- buffer_append_long(sc->hash_key, con->conf.follow_symlink);
-
- dir_ndx = hashme(sc->hash_key);
-
+ dir_ndx = hashme(sc->dir_name);
+
sc->dirs = splaytree_splay(sc->dirs, dir_ndx);
-
+
if (sc->dirs && (sc->dirs->key == dir_ndx)) {
dir_node = sc->dirs;
}
-
+
if (dir_node && file_node) {
/* we found a file */
-
+
sce = file_node->data;
fam_dir = dir_node->data;
-
+
if (fam_dir->version == sce->dir_version) {
/* the stat()-cache entry is still ok */
-
- *ret_sce = sce;
+
+ *ret_sce = sce;
return HANDLER_GO_ON;
}
}
@@ -476,23 +448,18 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
#endif
/*
- * *lol*
+ * *lol*
* - open() + fstat() on a named-pipe results in a (intended) hang.
- * - stat() if regular file + open() to see if we can read from it is better
+ * - stat() if regualar file + open() to see if we can read from it is better
*
* */
+
if (-1 == stat(name->ptr, &st)) {
return HANDLER_ERROR;
}
if (S_ISREG(st.st_mode)) {
- /* fix broken stat/open for symlinks to reg files with appended slash on freebsd,osx */
- if (name->ptr[name->used-2] == '/') {
- errno = ENOTDIR;
- return HANDLER_ERROR;
- }
-
/* try to open the file to check if we can read it */
if (-1 == (fd = open(name->ptr, O_RDONLY))) {
return HANDLER_ERROR;
@@ -501,15 +468,17 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
}
if (NULL == sce) {
-#ifdef DEBUG_STAT_CACHE
- int osize = splaytree_size(sc->files);
-#endif
+ int osize = 0;
+
+ if (sc->files) {
+ osize = sc->files->size;
+ }
sce = stat_cache_entry_init();
buffer_copy_string_buffer(sce->name, name);
-
- sc->files = splaytree_insert(sc->files, file_ndx, sce);
-#ifdef DEBUG_STAT_CACHE
+
+ sc->files = splaytree_insert(sc->files, file_ndx, sce);
+#ifdef DEBUG_STAT_CACHE
if (ctrl.size == 0) {
ctrl.size = 16;
ctrl.used = 0;
@@ -530,100 +499,47 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
sce->st = st;
sce->stat_ts = srv->cur_ts;
- /* catch the obvious symlinks
+ /* catch the obvious symlinks
*
* this is not a secure check as we still have a race-condition between
- * the stat() and the open. We can only solve this by
+ * the stat() and the open. We can only solve this by
* 1. open() the file
* 2. fstat() the fd
*
* and keeping the file open for the rest of the time. But this can
* only be done at network level.
- *
- * per default it is not a symlink
+ *
* */
-#ifdef HAVE_LSTAT
- sce->is_symlink = 0;
-
- /* we want to only check for symlinks if we should block symlinks.
- */
- if (!con->conf.follow_symlink) {
- if (stat_cache_lstat(srv, name, &lst) == 0) {
-#ifdef DEBUG_STAT_CACHE
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "found symlink", name);
-#endif
- sce->is_symlink = 1;
- }
-
- /*
- * we assume "/" can not be symlink, so
- * skip the symlink stuff if our path is /
- **/
- else if ((name->used > 2)) {
- buffer *dname;
- char *s_cur;
-
- dname = buffer_init();
- buffer_copy_string_buffer(dname, name);
-
- while ((s_cur = strrchr(dname->ptr,'/'))) {
- *s_cur = '\0';
- dname->used = s_cur - dname->ptr + 1;
- if (dname->ptr == s_cur) {
-#ifdef DEBUG_STAT_CACHE
- log_error_write(srv, __FILE__, __LINE__, "s", "reached /");
-#endif
- break;
- }
-#ifdef DEBUG_STAT_CACHE
- log_error_write(srv, __FILE__, __LINE__, "sbs",
- "checking if", dname, "is a symlink");
-#endif
- if (stat_cache_lstat(srv, dname, &lst) == 0) {
- sce->is_symlink = 1;
-#ifdef DEBUG_STAT_CACHE
- log_error_write(srv, __FILE__, __LINE__, "sb",
- "found symlink", dname);
-#endif
- break;
- };
- };
- buffer_free(dname);
- };
- };
-#endif
+ if (S_ISLNK(st.st_mode) && !con->conf.follow_symlink) {
+ return HANDLER_ERROR;
+ }
- if (S_ISREG(st.st_mode)) {
+ if (S_ISREG(st.st_mode)) {
/* determine mimetype */
buffer_reset(sce->content_type);
+
+ for (k = 0; k < con->conf.mimetypes->used; k++) {
+ data_string *ds = (data_string *)con->conf.mimetypes->data[k];
+ buffer *type = ds->key;
+
+ if (type->used == 0) continue;
+
+ /* check if the right side is the same */
+ if (type->used > name->used) continue;
+
+ if (0 == strncasecmp(name->ptr + name->used - type->used, type->ptr, type->used - 1)) {
+ buffer_copy_string_buffer(sce->content_type, ds->value);
+ break;
+ }
+ }
+ etag_create(sce->etag, &(sce->st));
#ifdef HAVE_XATTR
- if (con->conf.use_xattr) {
+ if (buffer_is_empty(sce->content_type)) {
stat_cache_attr_get(sce->content_type, name->ptr);
}
#endif
- /* xattr did not set a content-type. ask the config */
- if (buffer_is_empty(sce->content_type)) {
- for (k = 0; k < con->conf.mimetypes->used; k++) {
- data_string *ds = (data_string *)con->conf.mimetypes->data[k];
- buffer *type = ds->key;
-
- if (type->used == 0) continue;
-
- /* check if the right side is the same */
- if (type->used > name->used) continue;
-
- if (0 == strncasecmp(name->ptr + name->used - type->used, type->ptr, type->used - 1)) {
- buffer_copy_string_buffer(sce->content_type, ds->value);
- break;
- }
- }
- }
- etag_create(sce->etag, &(sce->st), con->etag_flags);
- } else if (S_ISDIR(st.st_mode)) {
- etag_create(sce->etag, &(sce->st), con->etag_flags);
}
-
+
#ifdef HAVE_FAM_H
if (sc->fam &&
(srv->srvconf.stat_cache_engine == STAT_CACHE_ENGINE_FAM)) {
@@ -633,20 +549,19 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
fam_dir->fc = sc->fam;
buffer_copy_string_buffer(fam_dir->name, sc->dir_name);
-
+
fam_dir->version = 1;
-
+
fam_dir->req = calloc(1, sizeof(FAMRequest));
-
- if (0 != FAMMonitorDirectory(sc->fam, fam_dir->name->ptr,
+
+ if (0 != FAMMonitorDirectory(sc->fam, fam_dir->name->ptr,
fam_dir->req, fam_dir)) {
-
- log_error_write(srv, __FILE__, __LINE__, "sbsbs",
- "monitoring dir failed:",
+
+ log_error_write(srv, __FILE__, __LINE__, "sbs",
+ "monitoring dir failed:",
fam_dir->name,
- "file:", name,
FamErrlist[FAMErrno]);
-
+
fam_dir_entry_free(fam_dir);
} else {
int osize = 0;
@@ -655,7 +570,7 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
osize = sc->dirs->size;
}
- sc->dirs = splaytree_insert(sc->dirs, dir_ndx, fam_dir);
+ sc->dirs = splaytree_insert(sc->dirs, dir_ndx, fam_dir);
assert(sc->dirs);
assert(sc->dirs->data == fam_dir);
assert(osize == (sc->dirs->size - 1));
@@ -663,9 +578,9 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
} else {
fam_dir = dir_node->data;
}
-
+
/* bind the fam_fc to the stat() cache entry */
-
+
if (fam_dir) {
sce->dir_version = fam_dir->version;
sce->dir_ndx = dir_ndx;
@@ -679,11 +594,11 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
}
/**
- * remove stat() from cache which havn't been stat()ed for
+ * remove stat() from cache which havn't been stat()ed for
* more than 10 seconds
+ *
*
- *
- * walk though the stat-cache, collect the ids which are too old
+ * walk though the stat-cache, collect the ids which are too old
* and remove them in a second loop
*/
@@ -724,9 +639,9 @@ int stat_cache_trigger_cleanup(server *srv) {
sc->files = splaytree_splay(sc->files, ndx);
node = sc->files;
-
+
if (node && (node->key == ndx)) {
-#ifdef DEBUG_STAT_CACHE
+#ifdef DEBUG_STAT_CACHE
size_t j;
int osize = splaytree_size(sc->files);
stat_cache_entry *sce = node->data;
@@ -734,7 +649,7 @@ int stat_cache_trigger_cleanup(server *srv) {
stat_cache_entry_free(node->data);
sc->files = splaytree_delete(sc->files, ndx);
-#ifdef DEBUG_STAT_CACHE
+#ifdef DEBUG_STAT_CACHE
for (j = 0; j < ctrl.used; j++) {
if (ctrl.ptr[j] == ndx) {
ctrl.ptr[j] = ctrl.ptr[--ctrl.used];
diff --git a/src/stat_cache.h b/src/stat_cache.h
index 7b80cce..e6f7796 100644
--- a/src/stat_cache.h
+++ b/src/stat_cache.h
@@ -7,7 +7,7 @@ stat_cache *stat_cache_init(void);
void stat_cache_free(stat_cache *fc);
handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_cache_entry **fce);
-handler_t stat_cache_handle_fdevent(server *srv, void *_fce, int revent);
+handler_t stat_cache_handle_fdevent(void *_srv, void *_fce, int revent);
int stat_cache_trigger_cleanup(server *srv);
#endif
diff --git a/src/status_counter.c b/src/status_counter.c
deleted file mode 100644
index ab130da..0000000
--- a/src/status_counter.c
+++ /dev/null
@@ -1,61 +0,0 @@
-#include "status_counter.h"
-
-#include <stdlib.h>
-
-/**
- * The status array can carry all the status information you want
- * the key to the array is <module-prefix>.<name>
- * and the values are counters
- *
- * example:
- * fastcgi.backends = 10
- * fastcgi.active-backends = 6
- * fastcgi.backend.<key>.load = 24
- * fastcgi.backend.<key>....
- *
- * fastcgi.backend.<key>.disconnects = ...
- */
-
-data_integer *status_counter_get_counter(server *srv, const char *s, size_t len) {
- data_integer *di;
-
- if (NULL == (di = (data_integer *)array_get_element(srv->status, s))) {
- /* not found, create it */
-
- if (NULL == (di = (data_integer *)array_get_unused_element(srv->status, TYPE_INTEGER))) {
- di = data_integer_init();
- }
- buffer_copy_string_len(di->key, s, len);
- di->value = 0;
-
- array_insert_unique(srv->status, (data_unset *)di);
- }
- return di;
-}
-
-/* dummies of the statistic framework functions
- * they will be moved to a statistics.c later */
-int status_counter_inc(server *srv, const char *s, size_t len) {
- data_integer *di = status_counter_get_counter(srv, s, len);
-
- di->value++;
-
- return 0;
-}
-
-int status_counter_dec(server *srv, const char *s, size_t len) {
- data_integer *di = status_counter_get_counter(srv, s, len);
-
- if (di->value > 0) di->value--;
-
- return 0;
-}
-
-int status_counter_set(server *srv, const char *s, size_t len, int val) {
- data_integer *di = status_counter_get_counter(srv, s, len);
-
- di->value = val;
-
- return 0;
-}
-
diff --git a/src/status_counter.h b/src/status_counter.h
deleted file mode 100644
index ba5e76f..0000000
--- a/src/status_counter.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _STATUS_COUNTER_H_
-#define _STATUS_COUNTER_H_
-
-#include "array.h"
-#include "base.h"
-
-#include <sys/types.h>
-
-data_integer *status_counter_get_counter(server *srv, const char *s, size_t len);
-int status_counter_inc(server *srv, const char *s, size_t len);
-int status_counter_dec(server *srv, const char *s, size_t len);
-int status_counter_set(server *srv, const char *s, size_t len, int val);
-
-#endif
diff --git a/src/stream.c b/src/stream.c
index f91e73c..ecaadc1 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -1,11 +1,14 @@
-#include "stream.h"
-
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
+#include <unistd.h>
#include <fcntl.h>
+#include "stream.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "sys-mmap.h"
#ifndef O_BINARY
@@ -22,33 +25,33 @@ int stream_open(stream *f, buffer *fn) {
#endif
f->start = NULL;
-
+
if (-1 == stat(fn->ptr, &st)) {
return -1;
}
-
+
f->size = st.st_size;
#ifdef HAVE_MMAP
if (-1 == (fd = open(fn->ptr, O_RDONLY | O_BINARY))) {
return -1;
}
-
+
f->start = mmap(0, f->size, PROT_READ, MAP_SHARED, fd, 0);
-
+
close(fd);
-
+
if (MAP_FAILED == f->start) {
return -1;
}
#elif defined __WIN32
- fh = CreateFile(fn->ptr,
- GENERIC_READ,
- FILE_SHARE_READ,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_READONLY,
+ fh = CreateFile(fn->ptr,
+ GENERIC_READ,
+ FILE_SHARE_READ,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_READONLY,
NULL);
if (!fh) return -1;
@@ -61,20 +64,19 @@ int stream_open(stream *f, buffer *fn) {
NULL);
if (!mh) {
-/*
LPVOID lpMsgBuf;
FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL );
-*/
+
return -1;
}
-
+
p = MapViewOfFile(mh,
FILE_MAP_READ,
0,
@@ -85,9 +87,9 @@ int stream_open(stream *f, buffer *fn) {
f->start = p;
#else
-# error no mmap found
+# error no mmap found
#endif
-
+
return 0;
}
diff --git a/src/sys-socket.h b/src/sys-socket.h
index f35699d..cc6e649 100644
--- a/src/sys-socket.h
+++ b/src/sys-socket.h
@@ -8,7 +8,6 @@
#define ECONNRESET WSAECONNRESET
#define EINPROGRESS WSAEINPROGRESS
#define EALREADY WSAEALREADY
-#define ECONNABORTED WSAECONNABORTED
#define ioctl ioctlsocket
#define hstrerror(x) ""
#else
diff --git a/src/version.h b/src/version.h
deleted file mode 100644
index e05b654..0000000
--- a/src/version.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _VERSION_H_
-#define _VERSION_H_
-
-#ifdef HAVE_VERSION_H
-# include "versionstamp.h"
-#else
-# define REPO_VERSION ""
-#endif
-
-#define PACKAGE_DESC PACKAGE_NAME "/" PACKAGE_VERSION REPO_VERSION
-
-#endif
diff --git a/tests/404-handler.conf b/tests/404-handler.conf
deleted file mode 100644
index 03dfd97..0000000
--- a/tests/404-handler.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-debug.log-request-handling = "enable"
-debug.log-response-header = "enable"
-debug.log-request-header = "enable"
-
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
-
-## bind to port (default: 80)
-server.port = 2048
-
-## bind to localhost (default: all interfaces)
-server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
-server.name = "www.example.org"
-server.tag = "Apache 1.3.29"
-
-
-server.modules = (
- "mod_fastcgi",
- "mod_cgi",
- "mod_accesslog" )
-
-######################## MODULE CONFIG ############################
-
-
-accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
-
-mimetype.assign = ( ".html" => "text/html" )
-
-cgi.assign = (".pl" => "/usr/bin/perl" )
-
-# fastcgi.server += ( "/404.pl" =>
-# ( "404-handler" =>
-# (
-# "socket" => env.SRCDIR + "/tmp/pl-404-fastcgi-1.socket",
-# "bin-path" => server.document-root + "/404.pl",
-# "max-procs" => 1,
-# "check-local" => "disable",
-# "broken-scriptfilename" => "enable",
-# )
-# ),
-# )
-
-$HTTP["url"] =~ "^/static/" {
- server.error-handler-404 = "/404.html"
-}
-else $HTTP["url"] =~ "." {
- server.error-handler-404 = "/404.pl"
-}
diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm
index ebdfd36..37023d3 100755
--- a/tests/LightyTest.pm
+++ b/tests/LightyTest.pm
@@ -6,8 +6,6 @@ use IO::Socket;
use Test::More;
use Socket;
use Cwd 'abs_path';
-use POSIX qw(:sys_wait_h dup2);
-use Errno qw(EADDRINUSE);
sub mtime {
my $file = shift;
@@ -32,17 +30,14 @@ sub new {
if (mtime($self->{BASEDIR}.'/src/lighttpd') > mtime($self->{BASEDIR}.'/build/lighttpd')) {
- $self->{BINDIR} = $self->{BASEDIR}.'/src';
- if (mtime($self->{BASEDIR}.'/src/.libs')) {
- $self->{MODULES_PATH} = $self->{BASEDIR}.'/src/.libs';
- } else {
- $self->{MODULES_PATH} = $self->{BASEDIR}.'/src';
- }
+ $self->{LIGHTTPD_PATH} = $self->{BASEDIR}.'/src/lighttpd';
+ $self->{MODULES_PATH} = $self->{BASEDIR}.'/src/.libs';
} else {
- $self->{BINDIR} = $self->{BASEDIR}.'/build';
+ $self->{LIGHTTPD_PATH} = $self->{BASEDIR}.'/build/lighttpd';
$self->{MODULES_PATH} = $self->{BASEDIR}.'/build';
}
- $self->{LIGHTTPD_PATH} = $self->{BINDIR}.'/lighttpd';
+ $self->{LIGHTTPD_PIDFILE} = $self->{TESTDIR}.'/tmp/lighttpd/lighttpd.pid';
+ $self->{PIDOF_PIDFILE} = $self->{TESTDIR}.'/tmp/lighttpd/pidof.pid';
$self->{PORT} = 2048;
my ($name, $aliases, $addrtype, $net) = gethostbyaddr(inet_aton("127.0.0.1"), AF_INET);
@@ -71,79 +66,55 @@ sub listening_on {
sub stop_proc {
my $self = shift;
- my $pid = $self->{LIGHTTPD_PID};
- if (defined $pid && $pid != -1) {
- kill('TERM', $pid) or return -1;
- return -1 if ($pid != waitpid($pid, 0));
- } else {
- diag("\nProcess not started, nothing to stop");
- return -1;
- }
-
- return 0;
-}
+ open F, $self->{LIGHTTPD_PIDFILE} or return -1;
+ my $pid = <F>;
+ close F;
-sub wait_for_port_with_proc {
- my $self = shift;
- my $port = shift;
- my $child = shift;
- my $timeout = 5*10; # 5 secs, select waits 0.1 s
-
- while (0 == $self->listening_on($port)) {
- select(undef, undef, undef, 0.1);
- $timeout--;
-
- # the process is gone, we failed
- if (0 != waitpid($child, WNOHANG)) {
- return -1;
- }
- if (0 >= $timeout) {
- diag("\nTimeout while trying to connect; killing child");
- kill('TERM', $child);
- return -1;
- }
+ if (defined $pid) {
+ kill('TERM',$pid) or return -1;
+ select(undef, undef, undef, 0.01);
}
return 0;
}
+
sub start_proc {
my $self = shift;
# kill old proc if necessary
- #$self->stop_proc;
+ $self->stop_proc;
# pre-process configfile if necessary
#
- $ENV{'SRCDIR'} = $self->{BASEDIR}.'/tests';
- $ENV{'PORT'} = $self->{PORT};
-
- my $cmdline = $self->{LIGHTTPD_PATH}." -D -f ".$self->{SRCDIR}."/".$self->{CONFIGFILE}." -m ".$self->{MODULES_PATH};
- if (defined $ENV{"TRACEME"} && $ENV{"TRACEME"} eq 'strace') {
- $cmdline = "strace -tt -s 512 -o strace ".$cmdline;
- } elsif (defined $ENV{"TRACEME"} && $ENV{"TRACEME"} eq 'truss') {
- $cmdline = "truss -a -l -w all -v all -o strace ".$cmdline;
- } elsif (defined $ENV{"TRACEME"} && $ENV{"TRACEME"} eq 'gdb') {
- $cmdline = "gdb --batch --ex 'run' --ex 'bt full' --args ".$cmdline." > gdb.out";
- } elsif (defined $ENV{"TRACEME"} && $ENV{"TRACEME"} eq 'valgrind') {
- $cmdline = "valgrind --tool=memcheck --show-reachable=yes --leak-check=yes --log-file=valgrind ".$cmdline;
- }
- # diag("\nstarting lighttpd at :".$self->{PORT}.", cmdline: ".$cmdline );
- my $child = fork();
- if (not defined $child) {
- diag("\nFork failed");
- return -1;
+ unlink($self->{TESTDIR}."/tmp/cfg.file");
+ system("cat ".$self->{SRCDIR}."/".$self->{CONFIGFILE}.' | perl -pe "s#\@SRCDIR\@#'.$self->{BASEDIR}.'/tests/#" > '.$self->{TESTDIR}.'/tmp/cfg.file');
+
+ unlink($self->{LIGHTTPD_PIDFILE});
+ if (1) {
+ system($self->{LIGHTTPD_PATH}." -f ".$self->{TESTDIR}."/tmp/cfg.file -m ".$self->{MODULES_PATH});
+ } else {
+ system("valgrind --tool=memcheck --show-reachable=yes --leak-check=yes --logfile=foo ".$self->{LIGHTTPD_PATH}." -D -f ".$self->{TESTDIR}."/tmp/cfg.file -m ".$self->{MODULES_PATH}." &");
}
- if ($child == 0) {
- exec $cmdline or die($?);
+
+ select(undef, undef, undef, 0.1);
+ if (not -e $self->{LIGHTTPD_PIDFILE} or 0 == kill 0, `cat $self->{LIGHTTPD_PIDFILE}`) {
+ select(undef, undef, undef, 2);
}
- if (0 != $self->wait_for_port_with_proc($self->{PORT}, $child)) {
- diag(sprintf('\nThe process %i is not up', $child));
+ unlink($self->{TESTDIR}."/tmp/cfg.file");
+
+ # no pidfile, we failed
+ if (not -e $self->{LIGHTTPD_PIDFILE}) {
+ diag(sprintf('Could not find pidfile: %s', $self->{LIGHTTPD_PIDFILE}));
return -1;
}
- $self->{LIGHTTPD_PID} = $child;
+ # the process is gone, we failed
+ if (0 == kill 0, `cat $self->{LIGHTTPD_PIDFILE}`) {
+ diag(sprintf('the process referenced by %s is not up', $self->{LIGHTTPD_PIDFILE}));
+ return -1;
+ }
0;
}
@@ -157,8 +128,6 @@ sub handle_http {
my @request = $t->{REQUEST};
my @response = $t->{RESPONSE};
- my $slow = defined $t->{SLOWREQUEST};
- my $is_debug = $ENV{"TRACE_HTTP"};
my $remote =
IO::Socket::INET->new(Proto => "tcp",
@@ -166,61 +135,29 @@ sub handle_http {
PeerPort => $self->{PORT});
if (not defined $remote) {
- diag("\nconnect failed: $!");
+ diag("connect failed: $!");
return -1;
}
$remote->autoflush(1);
- if (!$slow) {
- diag("\nsending request header to ".$host.":".$self->{PORT}) if $is_debug;
- foreach(@request) {
- # pipeline requests
- s/\r//g;
- s/\n/$EOL/g;
+ foreach(@request) {
+ # pipeline requests
+ s/\r//g;
+ s/\n/$EOL/g;
- print $remote $_.$BLANK;
- diag("\n<< ".$_) if $is_debug;
- }
- shutdown($remote, 1); # I've stopped writing data
- } else {
- diag("\nsending request header to ".$host.":".$self->{PORT}) if $is_debug;
- foreach(@request) {
- # pipeline requests
- chomp;
- s/\r//g;
- s/\n/$EOL/g;
-
- print $remote $_;
- diag("<< ".$_."\n") if $is_debug;
- select(undef, undef, undef, 0.1);
- print $remote "\015";
- select(undef, undef, undef, 0.1);
- print $remote "\012";
- select(undef, undef, undef, 0.1);
- print $remote "\015";
- select(undef, undef, undef, 0.1);
- print $remote "\012";
- select(undef, undef, undef, 0.1);
- }
-
+ print $remote $_.$BLANK;
}
- diag("\n... done") if $is_debug;
my $lines = "";
- diag("\nreceiving response") if $is_debug;
# read everything
while(<$remote>) {
$lines .= $_;
- diag(">> ".$_) if $is_debug;
}
- diag("\n... done") if $is_debug;
close $remote;
- my $full_response = $lines;
-
my $href;
foreach $href ( @{ $t->{RESPONSE} }) {
# first line is always response header
@@ -233,7 +170,7 @@ sub handle_http {
(my $line, $lines) = split($EOL, $lines, 2);
# header finished
- last if(!defined $line or length($line) == 0);
+ last if(length($line) == 0);
if ($ln == 0) {
# response header
@@ -244,28 +181,20 @@ sub handle_http {
if ($line =~ /^([^:]+):\s*(.+)$/) {
(my $h = $1) =~ tr/[A-Z]/[a-z]/;
- if (defined $resp_hdr{$h}) {
-# diag(sprintf("\nheader '%s' is duplicated: '%s' and '%s'\n",
-# $h, $resp_hdr{$h}, $2));
- $resp_hdr{$h} .= ', '.$2;
- } else {
- $resp_hdr{$h} = $2;
- }
+# if (defined $resp_hdr{$h}) {
+# diag(sprintf("header %s is duplicated: %s and %s\n",
+# $h, $resp_hdr{$h}, $2));
+# return -1;
+# }
+
+ $resp_hdr{$h} = $2;
} else {
- diag(sprintf("\nunexpected line '%s'", $line));
+ diag(sprintf("unexpected line '$line'\n"));
return -1;
}
}
}
- if (not defined($resp_line)) {
- diag(sprintf("\nempty response"));
- return -1;
- }
-
- $t->{etag} = $resp_hdr{'etag'};
- $t->{date} = $resp_hdr{'date'};
-
# check length
if (defined $resp_hdr{"content-length"}) {
$resp_body = substr($lines, 0, $resp_hdr{"content-length"});
@@ -283,29 +212,29 @@ sub handle_http {
# check conditions
if ($resp_line =~ /^(HTTP\/1\.[01]) ([0-9]{3}) .+$/) {
if ($href->{'HTTP-Protocol'} ne $1) {
- diag(sprintf("\nproto failed: expected '%s', got '%s'", $href->{'HTTP-Protocol'}, $1));
+ diag(sprintf("proto failed: expected '%s', got '%s'\n", $href->{'HTTP-Protocol'}, $1));
return -1;
}
if ($href->{'HTTP-Status'} ne $2) {
- diag(sprintf("\nstatus failed: expected '%s', got '%s'", $href->{'HTTP-Status'}, $2));
+ diag(sprintf("status failed: expected '%s', got '%s'\n", $href->{'HTTP-Status'}, $2));
return -1;
}
} else {
- diag(sprintf("\nunexpected resp_line '%s'", $resp_line));
+ diag(sprintf("unexpected resp_line '$resp_line'\n"));
return -1;
}
if (defined $href->{'HTTP-Content'}) {
$resp_body = "" unless defined $resp_body;
if ($href->{'HTTP-Content'} ne $resp_body) {
- diag(sprintf("\nbody failed: expected '%s', got '%s'", $href->{'HTTP-Content'}, $resp_body));
+ diag(sprintf("body failed: expected '%s', got '%s'\n", $href->{'HTTP-Content'}, $resp_body));
return -1;
}
}
if (defined $href->{'-HTTP-Content'}) {
if (defined $resp_body && $resp_body ne '') {
- diag(sprintf("\nbody failed: expected empty body, got '%s'", $resp_body));
+ diag(sprintf("body failed: expected empty body, got '%s'\n", $resp_body));
return -1;
}
}
@@ -318,40 +247,28 @@ sub handle_http {
(my $k = $_) =~ tr/[A-Z]/[a-z]/;
- my $verify_value = 1;
- my $key_inverted = 0;
+ my $no_val = 0;
if (substr($k, 0, 1) eq '+') {
$k = substr($k, 1);
- $verify_value = 0;
- } elsif (substr($k, 0, 1) eq '-') {
- ## the key should NOT exist
- $k = substr($k, 1);
- $key_inverted = 1;
- $verify_value = 0; ## skip the value check
- }
+ $no_val = 1;
- if ($key_inverted) {
- if (defined $resp_hdr{$k}) {
- diag(sprintf("\nheader '%s' MUST not be set", $k));
- return -1;
- }
- } else {
- if (not defined $resp_hdr{$k}) {
- diag(sprintf("\nrequired header '%s' is missing", $k));
- return -1;
- }
}
- if ($verify_value) {
+ if (!defined $resp_hdr{$k}) {
+ diag(sprintf("required header '%s' is missing\n", $k));
+ return -1;
+ }
+
+ if ($no_val == 0) {
if ($href->{$_} =~ /^\/(.+)\/$/) {
if ($resp_hdr{$k} !~ /$1/) {
- diag(sprintf("\nresponse-header failed: expected '%s', got '%s', regex: %s",
+ diag(sprintf("response-header failed: expected '%s', got '%s', regex: %s\n",
$href->{$_}, $resp_hdr{$k}, $1));
return -1;
}
} elsif ($href->{$_} ne $resp_hdr{$k}) {
- diag(sprintf("\nresponse-header failed: expected '%s', got '%s'",
+ diag(sprintf("response-header failed: expected '%s', got '%s'\n",
$href->{$_}, $resp_hdr{$k}));
return -1;
}
@@ -361,44 +278,12 @@ sub handle_http {
# we should have sucked up everything
if (defined $lines) {
- diag(sprintf("\nunexpected lines '%s'", $lines));
- return -1;
- }
-
- return 0;
-}
-
-sub spawnfcgi {
- my ($self, $binary, $port) = @_;
- my $child = fork();
- if (not defined $child) {
- diag("\nCouldn't fork");
+ diag(sprintf("unexpected lines '$lines'\n"));
return -1;
}
- if ($child == 0) {
- my $iaddr = inet_aton('localhost') || die "no host: localhost";
- my $proto = getprotobyname('tcp');
- socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";
- setsockopt(SOCK, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) || die "setsockopt: $!";
- bind(SOCK, sockaddr_in($port, $iaddr)) || die "bind: $!";
- listen(SOCK, 1024) || die "listen: $!";
- dup2(fileno(SOCK), 0) || die "dup2: $!";
- exec $binary or die($?);
- } else {
- if (0 != $self->wait_for_port_with_proc($port, $child)) {
- diag(sprintf("\nThe process %i is not up (port %i, %s)", $child, $port, $binary));
- return -1;
- }
- return $child;
- }
-}
-sub endspawnfcgi {
- my ($self, $pid) = @_;
- return -1 if (-1 == $pid);
- kill(2, $pid);
- waitpid($pid, 0);
return 0;
}
-
+
1;
+
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2472741..d4a9b10 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -31,35 +31,25 @@ CONFS=fastcgi-10.conf \
core-response.t \
core-keepalive.t \
core.t \
- mod-proxy.t \
- proxy.conf \
- mod-secdownload.t \
mod-access.t \
mod-auth.t \
mod-cgi.t \
mod-compress.t \
- mod-compress.conf \
mod-fastcgi.t \
mod-redirect.t \
- mod-rewrite.t \
mod-userdir.t \
- symlink.t \
+ mod-rewrite.t \
request.t \
mod-ssi.t \
LightyTest.pm \
- mod-setenv.t \
- lowercase.t \
- lowercase.conf \
- cachable.t \
- core-404-handler.t \
- 404-handler.conf
+ mod-setenv.t
+
-TESTS_ENVIRONMENT=$(srcdir)/wrapper.sh $(srcdir) $(top_builddir)
+TESTS_ENVIRONMENT=$(srcdir)/wrapper.sh $(srcdir) $(top_builddir)
EXTRA_DIST=wrapper.sh lighttpd.conf \
lighttpd.user \
lighttpd.htpasswd \
- SConscript \
$(CONFS) \
$(TESTS)
@@ -69,7 +59,7 @@ leak-check:
for i in $(TESTS); do \
$(srcdir)/$$i; \
echo $$?; \
- done
+ done
clean-local:
rm -f *.out
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 31b1531..2827b2f 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,12 +13,17 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+SOURCES = $(fcgi_auth_SOURCES) $(fcgi_responder_SOURCES)
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -39,103 +43,49 @@ target_triplet = @target@
subdir = tests
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
am__fcgi_auth_SOURCES_DIST = fcgi-auth.c
@CHECK_WITH_FASTCGI_TRUE@am_fcgi_auth_OBJECTS = fcgi-auth.$(OBJEXT)
fcgi_auth_OBJECTS = $(am_fcgi_auth_OBJECTS)
fcgi_auth_DEPENDENCIES =
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
am__fcgi_responder_SOURCES_DIST = fcgi-responder.c
@CHECK_WITH_FASTCGI_TRUE@am_fcgi_responder_OBJECTS = \
@CHECK_WITH_FASTCGI_TRUE@ fcgi-responder.$(OBJEXT)
fcgi_responder_OBJECTS = $(am_fcgi_responder_OBJECTS)
fcgi_responder_DEPENDENCIES =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
-am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
SOURCES = $(fcgi_auth_SOURCES) $(fcgi_responder_SOURCES)
DIST_SOURCES = $(am__fcgi_auth_SOURCES_DIST) \
$(am__fcgi_responder_SOURCES_DIST)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
- install-dvi-recursive install-exec-recursive \
- install-html-recursive install-info-recursive \
- install-pdf-recursive install-ps-recursive install-recursive \
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
- distdir
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
ETAGS = etags
CTAGS = ctags
-am__tty_colors = \
-red=; grn=; lgn=; blu=; std=
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ATTR_LIB = @ATTR_LIB@
AUTOCONF = @AUTOCONF@
@@ -146,73 +96,69 @@ BZ_LIB = @BZ_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@
+CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
+CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
CRYPT_LIB = @CRYPT_LIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
+ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
FAM_CFLAGS = @FAM_CFLAGS@
FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
+FFLAGS = @FFLAGS@
GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LBER_LIB = @LBER_LIB@
-LD = @LD@
LDAP_LIB = @LDAP_LIB@
LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LUACONFIG = @LUACONFIG@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
+NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@
+NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@
OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
PCRE_LIB = @PCRE_LIB@
PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
-SED = @SED@
SENDFILE_LIB = @SENDFILE_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -221,18 +167,20 @@ SQLITE_LIBS = @SQLITE_LIBS@
SSL_LIB = @SSL_LIB@
STRIP = @STRIP@
U = @U@
-UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -244,44 +192,32 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
-builddir = @builddir@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
-localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
# lighttpd.conf and conformance.pl expect this directory
testdir = $(srcdir)/tmp/lighttpd/
@@ -309,34 +245,23 @@ CONFS = fastcgi-10.conf \
core-response.t \
core-keepalive.t \
core.t \
- mod-proxy.t \
- proxy.conf \
- mod-secdownload.t \
mod-access.t \
mod-auth.t \
mod-cgi.t \
mod-compress.t \
- mod-compress.conf \
mod-fastcgi.t \
mod-redirect.t \
- mod-rewrite.t \
mod-userdir.t \
- symlink.t \
+ mod-rewrite.t \
request.t \
mod-ssi.t \
LightyTest.pm \
- mod-setenv.t \
- lowercase.t \
- lowercase.conf \
- cachable.t \
- core-404-handler.t \
- 404-handler.conf
-
-TESTS_ENVIRONMENT = $(srcdir)/wrapper.sh $(srcdir) $(top_builddir)
+ mod-setenv.t
+
+TESTS_ENVIRONMENT = $(srcdir)/wrapper.sh $(srcdir) $(top_builddir)
EXTRA_DIST = wrapper.sh lighttpd.conf \
lighttpd.user \
lighttpd.htpasswd \
- SConscript \
$(CONFS) \
$(TESTS)
@@ -345,18 +270,18 @@ all: all-recursive
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign tests/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tests/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -370,26 +295,23 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
clean-checkPROGRAMS:
- @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-fcgi-auth$(EXEEXT): $(fcgi_auth_OBJECTS) $(fcgi_auth_DEPENDENCIES) $(EXTRA_fcgi_auth_DEPENDENCIES)
+ @list='$(check_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+fcgi-auth$(EXEEXT): $(fcgi_auth_OBJECTS) $(fcgi_auth_DEPENDENCIES)
@rm -f fcgi-auth$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(fcgi_auth_OBJECTS) $(fcgi_auth_LDADD) $(LIBS)
-fcgi-responder$(EXEEXT): $(fcgi_responder_OBJECTS) $(fcgi_responder_DEPENDENCIES) $(EXTRA_fcgi_responder_DEPENDENCIES)
+ $(LINK) $(fcgi_auth_LDFLAGS) $(fcgi_auth_OBJECTS) $(fcgi_auth_LDADD) $(LIBS)
+fcgi-responder$(EXEEXT): $(fcgi_responder_OBJECTS) $(fcgi_responder_DEPENDENCIES)
@rm -f fcgi-responder$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(fcgi_responder_OBJECTS) $(fcgi_responder_LDADD) $(LIBS)
+ $(LINK) $(fcgi_responder_LDFLAGS) $(fcgi_responder_OBJECTS) $(fcgi_responder_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -401,25 +323,25 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcgi-responder.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -427,6 +349,10 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
@@ -434,7 +360,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @fail= failcom='exit 1'; \
+ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -451,15 +377,16 @@ $(RECURSIVE_TARGETS):
else \
local_target="$$target"; \
fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
-$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -485,16 +412,16 @@ $(RECURSIVE_CLEAN_TARGETS):
else \
local_target="$$target"; \
fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -502,14 +429,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- set x; \
+ tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
@@ -521,43 +448,39 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
+ $$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -565,8 +488,7 @@ distclean-tags:
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
- list=' $(TESTS) '; \
- $(am__tty_colors); \
+ list='$(TESTS)'; \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
@@ -575,63 +497,49 @@ check-TESTS: $(TESTS)
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$tst[\ \ ]*) \
+ *" $$tst "*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
- col=$$red; res=XPASS; \
+ echo "XPASS: $$tst"; \
;; \
*) \
- col=$$grn; res=PASS; \
+ echo "PASS: $$tst"; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$tst[\ \ ]*) \
+ *" $$tst "*) \
xfail=`expr $$xfail + 1`; \
- col=$$lgn; res=XFAIL; \
+ echo "XFAIL: $$tst"; \
;; \
*) \
failed=`expr $$failed + 1`; \
- col=$$red; res=FAIL; \
+ echo "FAIL: $$tst"; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
- col=$$blu; res=SKIP; \
+ echo "SKIP: $$tst"; \
fi; \
- echo "$${col}$$res$${std}: $$tst"; \
done; \
- if test "$$all" -eq 1; then \
- tests="test"; \
- All=""; \
- else \
- tests="tests"; \
- All="All "; \
- fi; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
- banner="$$All$$all $$tests passed"; \
+ banner="All $$all tests passed"; \
else \
- if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
- banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
- banner="$$failed of $$all $$tests failed"; \
+ banner="$$failed of $$all tests failed"; \
else \
- if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
- banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
- if test "$$skip" -eq 1; then \
- skipped="($$skip test was not run)"; \
- else \
- skipped="($$skip tests were not run)"; \
- fi; \
+ skipped="($$skip tests were not run)"; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
@@ -642,73 +550,52 @@ check-TESTS: $(TESTS)
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
- if test "$$failed" -eq 0; then \
- col="$$grn"; \
- else \
- col="$$red"; \
- fi; \
- echo "$${col}$$dashes$${std}"; \
- echo "$${col}$$banner$${std}"; \
- test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
- test -z "$$report" || echo "$${col}$$report$${std}"; \
- echo "$${col}$$dashes$${std}"; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
test "$$failed" -eq 0; \
else :; fi
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
@@ -730,22 +617,16 @@ install-am: all-am
installcheck: installcheck-recursive
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -759,7 +640,7 @@ distclean: distclean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
+ distclean-libtool distclean-tags
dvi: dvi-recursive
@@ -767,38 +648,18 @@ dvi-am:
html: html-recursive
-html-am:
-
info: info-recursive
info-am:
install-data-am:
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
install-exec-am:
-install-html: install-html-recursive
-
-install-html-am:
-
install-info: install-info-recursive
-install-info-am:
-
install-man:
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
installcheck-am:
maintainer-clean: maintainer-clean-recursive
@@ -819,36 +680,33 @@ ps: ps-recursive
ps-am:
-uninstall-am:
+uninstall-am: uninstall-info-am
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \
- ctags-recursive install-am install-strip tags-recursive
+uninstall-info: uninstall-info-recursive
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am check check-TESTS check-am clean \
- clean-checkPROGRAMS clean-generic clean-libtool clean-local \
- ctags ctags-recursive distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-TESTS \
+ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \
+ clean-local clean-recursive ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am uninstall-info-am
leak-check:
for i in $(TESTS); do \
$(srcdir)/$$i; \
echo $$?; \
- done
+ done
clean-local:
rm -f *.out
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/tests/SConscript b/tests/SConscript
deleted file mode 100644
index 4ce7e1e..0000000
--- a/tests/SConscript
+++ /dev/null
@@ -1,46 +0,0 @@
-Import('env')
-
-tests = Split('prepare.sh \
- run-tests.pl \
- cleanup.sh')
-
-extra_dist = Split('fastcgi-10.conf \
- fastcgi-auth.conf \
- fastcgi-responder.conf \
- fastcgi-13.conf \
- bug-06.conf \
- bug-12.conf \
- core-var-include.t \
- var-include.conf \
- var-include-sub.conf \
- condition.conf \
- core-condition.t \
- core-request.t \
- core-response.t \
- core-keepalive.t \
- core.t \
- mod-access.t \
- mod-auth.t \
- mod-cgi.t \
- mod-compress.t \
- mod-compress.conf \
- mod-fastcgi.t \
- mod-redirect.t \
- mod-userdir.t \
- mod-rewrite.t \
- request.t \
- mod-ssi.t \
- LightyTest.pm \
- mod-setenv.t')
-
-t = env.Command('foo1', 'prepare.sh', '(cd ./tests/; ./prepare.sh; cd ..)')
-t += env.Command('foo2', 'run-tests.pl', '( cd ./tests/; SHELL=/bin/sh ./run-tests.pl; cd ..)')
-t += env.Command('foo3', 'cleanup.sh', '(cd ./tests/; ./cleanup.sh; cd ..)')
-
-if env['LIBFCGI']:
- fcgis = []
- fcgis += env.Program("fcgi-auth", "fcgi-auth.c", LIBS=env['LIBFCGI'])
- fcgis += env.Program("fcgi-responder", "fcgi-responder.c", LIBS=env['LIBFCGI'])
- env.Depends(t, fcgis)
-
-env.Alias('check', t )
diff --git a/tests/bug-06.conf b/tests/bug-06.conf
index 8835535..5273c4a 100644
--- a/tests/bug-06.conf
+++ b/tests/bug-06.conf
@@ -1,4 +1,5 @@
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
+server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid"
## bind to port (default: 80)
server.port = 2048
@@ -7,13 +8,12 @@ server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
-##
+##
## Format: <errorfile-prefix><status>.html
## -> ..../status-404.html for 'File not found'
#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-"
@@ -24,24 +24,24 @@ server.dir-listing = "enable"
#server.event-handler = "linux-rtsig"
#server.modules.path = ""
-server.modules = (
+server.modules = (
"mod_rewrite",
"mod_setenv",
- "mod_access",
+ "mod_access",
"mod_auth",
# "mod_httptls",
- "mod_status",
+ "mod_status",
"mod_expire",
"mod_simple_vhost",
- "mod_redirect",
+ "mod_redirect",
# "mod_evhost",
# "mod_localizer",
"mod_fastcgi",
"mod_cgi",
"mod_compress",
- "mod_accesslog" )
+ "mod_accesslog" )
-server.indexfiles = ( "index.html",
+server.indexfiles = ( "index.html",
"index.htm", "default.htm", "index.php" )
#,-- only root can use these options
@@ -53,15 +53,15 @@ server.indexfiles = ( "index.html",
#|# change uid to <uid> (default: don't care)
#| server.groupid wwwrun
#|
-#`--
+#`--
######################## MODULE CONFIG ############################
-accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
+accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log"
-mimetype.assign = ( ".png" => "image/png",
+mimetype.assign = ( ".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
@@ -77,7 +77,7 @@ mimetype.assign = ( ".png" => "image/png",
".c" => "text/plain",
".conf" => "text/plain" )
-compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
+compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/"
compress.filetype = ("text/plain", "text/html")
setenv.add-environment = ( "TRAC_ENV" => "foo")
@@ -85,50 +85,50 @@ setenv.add-request-header = ( "FOO" => "foo")
setenv.add-response-header = ( "BAR" => "foo")
fastcgi.debug = 0
-fastcgi.server = ( ".php" => (
- "grisu" => (
+fastcgi.server = ( ".php" => (
+ "grisu" => (
"host" => "127.0.0.1",
"port" => 1026,
# "mode" => "authorizer",
-# "docroot" => env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/",
+# "docroot" => "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/",
)
)
)
-
+
cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl",
".py" => "/usr/bin/python" )
-
+
ssl.engine = "disable"
-# ssl.pemfile = "server.pem"
+ssl.pemfile = "server.pem"
auth.backend = "plain"
-auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
+auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user"
auth.backend.plain.groupfile = "lighttpd.group"
auth.backend.ldap.hostname = "localhost"
auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
auth.backend.ldap.filter = "(uid=$)"
-auth.require = ( "/server-status" =>
- (
+auth.require = ( "/server-status" =>
+ (
"method" => "digest",
"realm" => "download archiv",
# "require" => ("group=www", "user=jan", "host=192.168.2.10")
"require" => "group=www|user=jan|host=192.168.2.10"
),
- "/auth.php" =>
- (
+ "/auth.php" =>
+ (
"method" => "basic",
"realm" => "download archiv",
# "require" => ("group=www", "user=jan", "host=192.168.2.10")
"require" => "user=jan"
),
- "/server-config" =>
- (
+ "/server-config" =>
+ (
"method" => "basic",
"realm" => "download archiv",
# "require" => ("group=www", "user=jan", "user=weigon", "host=192.168.2.10")
@@ -149,15 +149,15 @@ status.status-url = "/server-status"
status.config-url = "/server-config"
simple-vhost.document-root = "pages"
-simple-vhost.server-root = env.SRCDIR + "/tmp/lighttpd/servers/"
+simple-vhost.server-root = "@SRCDIR@/tmp/lighttpd/servers/"
simple-vhost.default-host = "www.example.org"
$HTTP["host"] == "vvv.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
}
$HTTP["host"] == "zzz.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
}
diff --git a/tests/bug-12.conf b/tests/bug-12.conf
index 61cba0e..491ff9e 100644
--- a/tests/bug-12.conf
+++ b/tests/bug-12.conf
@@ -1,4 +1,5 @@
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
+server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid"
## bind to port (default: 80)
server.port = 2048
@@ -7,13 +8,12 @@ server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
-##
+##
## Format: <errorfile-prefix><status>.html
## -> ..../status-404.html for 'File not found'
#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-"
@@ -24,24 +24,24 @@ server.dir-listing = "enable"
#server.event-handler = "linux-rtsig"
#server.modules.path = ""
-server.modules = (
+server.modules = (
"mod_rewrite",
"mod_setenv",
- "mod_access",
+ "mod_access",
"mod_auth",
# "mod_httptls",
- "mod_status",
+ "mod_status",
"mod_expire",
"mod_simple_vhost",
- "mod_redirect",
+ "mod_redirect",
# "mod_evhost",
# "mod_localizer",
"mod_fastcgi",
"mod_cgi",
"mod_compress",
- "mod_accesslog" )
+ "mod_accesslog" )
-server.indexfiles = ( "index.html",
+server.indexfiles = ( "index.html",
"index.htm", "default.htm", "index.php" )
server.error-handler-404 = "/indexfile/return-404.php"
@@ -55,15 +55,15 @@ server.error-handler-404 = "/indexfile/return-404.php"
#|# change uid to <uid> (default: don't care)
#| server.groupid wwwrun
#|
-#`--
+#`--
######################## MODULE CONFIG ############################
-accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
+accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log"
-mimetype.assign = ( ".png" => "image/png",
+mimetype.assign = ( ".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
@@ -79,7 +79,7 @@ mimetype.assign = ( ".png" => "image/png",
".c" => "text/plain",
".conf" => "text/plain" )
-compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
+compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/"
compress.filetype = ("text/plain", "text/html")
setenv.add-environment = ( "TRAC_ENV" => "foo")
@@ -87,50 +87,50 @@ setenv.add-request-header = ( "FOO" => "foo")
setenv.add-response-header = ( "BAR" => "foo")
fastcgi.debug = 0
-fastcgi.server = ( ".php" => (
- "grisu" => (
+fastcgi.server = ( ".php" => (
+ "grisu" => (
"host" => "127.0.0.1",
"port" => 1026,
# "mode" => "authorizer",
-# "docroot" => env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/",
+# "docroot" => "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/",
)
)
)
-
+
cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl",
".py" => "/usr/bin/python" )
-
+
ssl.engine = "disable"
-# ssl.pemfile = "server.pem"
+ssl.pemfile = "server.pem"
auth.backend = "plain"
-auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
+auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user"
auth.backend.plain.groupfile = "lighttpd.group"
auth.backend.ldap.hostname = "localhost"
auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
auth.backend.ldap.filter = "(uid=$)"
-auth.require = ( "/server-status" =>
- (
+auth.require = ( "/server-status" =>
+ (
"method" => "digest",
"realm" => "download archiv",
# "require" => ("group=www", "user=jan", "host=192.168.2.10")
"require" => "group=www|user=jan|host=192.168.2.10"
),
- "/auth.php" =>
- (
+ "/auth.php" =>
+ (
"method" => "basic",
"realm" => "download archiv",
# "require" => ("group=www", "user=jan", "host=192.168.2.10")
"require" => "user=jan"
),
- "/server-config" =>
- (
+ "/server-config" =>
+ (
"method" => "basic",
"realm" => "download archiv",
# "require" => ("group=www", "user=jan", "user=weigon", "host=192.168.2.10")
@@ -151,15 +151,15 @@ status.status-url = "/server-status"
status.config-url = "/server-config"
simple-vhost.document-root = "pages"
-simple-vhost.server-root = env.SRCDIR + "/tmp/lighttpd/servers/"
+simple-vhost.server-root = "@SRCDIR@/tmp/lighttpd/servers/"
simple-vhost.default-host = "www.example.org"
$HTTP["host"] == "vvv.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
}
$HTTP["host"] == "zzz.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
}
diff --git a/tests/cachable.t b/tests/cachable.t
deleted file mode 100755
index 605a68f..0000000
--- a/tests/cachable.t
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/usr/bin/env perl
-BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
-}
-
-use strict;
-use IO::Socket;
-use Test::More tests => 13;
-use LightyTest;
-
-my $tf = LightyTest->new();
-my $t;
-
-$tf->{CONFIGFILE} = 'lighttpd.conf';
-
-ok($tf->start_proc == 0, "Starting lighttpd") or die();
-
-## check if If-Modified-Since, If-None-Match works
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-Modified-Since: Sun, 01 Jan 1970 00:00:01 GMT
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - old If-Modified-Since');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-Modified-Since: Sun, 01 Jan 1970 00:00:01 GMT; foo
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Last-Modified' => ''} ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - old If-Modified-Since, comment');
-
-my $now = $t->{date};
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-Modified-Since: $now
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - new If-Modified-Since');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-Modified-Since: $now; foo
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - new If-Modified-Since, comment');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-None-Match: foo
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+ETag' => ''} ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - old If-None-Match');
-
-my $etag = $t->{etag};
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-None-Match: $etag
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - old If-None-Match');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-None-Match: $etag
-If-Modified-Since: Sun, 01 Jan 1970 00:00:01 GMT; foo
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - ETag + old Last-Modified');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-None-Match: $etag
-If-Modified-Since: $now; foo
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - ETag, Last-Modified + comment');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-None-Match: Foo
-If-Modified-Since: Sun, 01 Jan 1970 00:00:01 GMT; foo
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - old ETAG + old Last-Modified');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-None-Match: $etag
-If-Modified-Since: $now foo
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 412 } ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - ETag + Last-Modified + overlong timestamp');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-None-Match: $etag
-Host: etag.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - ETag + disabled etags on server side');
-
-ok($tf->stop_proc == 0, "Stopping lighttpd");
-
diff --git a/tests/condition.conf b/tests/condition.conf
index d1e8882..7fd58d7 100644
--- a/tests/condition.conf
+++ b/tests/condition.conf
@@ -2,45 +2,45 @@
debug.log-request-handling = "enable"
debug.log-condition-handling = "enable"
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
+server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid"
## bind to port (default: 80)
server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
-server.modules = (
+server.modules = (
"mod_redirect",
- "mod_accesslog" )
+ "mod_accesslog" )
######################## MODULE CONFIG ############################
-accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
+accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log"
mimetype.assign = ( ".html" => "text/html" )
url.redirect = ("^" => "/default")
$HTTP["host"] == "www.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "www.example.org"
url.redirect = ("^" => "/match_1")
}
else $HTTP["host"] == "test1.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "test1.example.org"
url.redirect = ("^" => "/match_2")
}
# comments
else $HTTP["host"] == "test2.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "test2.example.org"
url.redirect = ("^" => "/match_3")
}
@@ -48,7 +48,7 @@ else $HTTP["host"] == "test2.example.org" {
# comments
else $HTTP["host"] == "test3.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "test3.example.org"
url.redirect = ("^" => "/match_4")
@@ -57,13 +57,3 @@ else $HTTP["host"] == "test3.example.org" {
url.redirect = ("^" => "/match_5")
}
}
-
-else $HTTP["host"] == "test4.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- server.name = "test4.example.org"
- url.redirect = ("^" => "/match_6")
-
- $HTTP["url"] =~ "^/subdir/" {
- url.redirect = ("^" => "/match_7")
- }
-}
diff --git a/tests/core-404-handler.t b/tests/core-404-handler.t
deleted file mode 100755
index 599ade2..0000000
--- a/tests/core-404-handler.t
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/env perl
-#
-# combinations we have to test:
-# plain 404 case
-# 404-handler -> static file (verify content)
-# 404-handler -> fastcgi
-# returning 200
-# returning 302 + Location
-# returning 404
-# returning no status -> 200
-#
-BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
-}
-
-use strict;
-use IO::Socket;
-use Test::More tests => 8;
-use LightyTest;
-
-my $tf = LightyTest->new();
-my $t;
-$tf->{CONFIGFILE} = '404-handler.conf';
-
-ok($tf->start_proc == 0, "Starting lighttpd") or die();
-
-$t->{REQUEST} = ( <<EOF
-GET /static/notfound HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "static not found\n" } ];
-ok($tf->handle_http($t) == 0, '404 handler => static');
-
-#
-#
-#
-$t->{REQUEST} = ( <<EOF
-GET /dynamic/200/notfound HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "found here\n" } ];
-ok($tf->handle_http($t) == 0, '404 handler => dynamic(200)');
-
-$t->{REQUEST} = ( <<EOF
-GET /dynamic/302/notfound HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 302, 'Location' => "http://www.example.org/" } ];
-ok($tf->handle_http($t) == 0, '404 handler => dynamic(302)');
-
-$t->{REQUEST} = ( <<EOF
-GET /dynamic/404/notfound HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => "Not found here\n" } ];
-ok($tf->handle_http($t) == 0, '404 handler => dynamic(404)');
-
-$t->{REQUEST} = ( <<EOF
-GET /dynamic/nostatus/notfound HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "found here\n" } ];
-ok($tf->handle_http($t) == 0, '404 handler => dynamic(nostatus)');
-
-$t->{REQUEST} = ( <<EOF
-GET /send404.pl HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => "send404\n" } ];
-ok($tf->handle_http($t) == 0, '404 generated by CGI should stay 404');
-
-ok($tf->stop_proc == 0, "Stopping lighttpd");
-
diff --git a/tests/core-condition.t b/tests/core-condition.t
index 39b24e3..96b05d8 100755
--- a/tests/core-condition.t
+++ b/tests/core-condition.t
@@ -1,14 +1,14 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
use IO::Socket;
-use Test::More tests => 19;
+use Test::More tests => 17;
use LightyTest;
my $tf = LightyTest->new();
@@ -49,22 +49,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => "/match_5" } ];
ok($tf->handle_http($t) == 0, 'nesting');
-$t->{REQUEST} = ( <<EOF
-GET /subdir/index.html HTTP/1.0
-Host: test4.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => "/match_7" } ];
-ok($tf->handle_http($t) == 0, 'url subdir');
-
-$t->{REQUEST} = ( <<EOF
-GET /subdir/../css/index.html HTTP/1.0
-Host: test4.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => "/match_6" } ];
-ok($tf->handle_http($t) == 0, 'url subdir with path traversal');
-
ok($tf->stop_proc == 0, "Stopping lighttpd");
$tf->{CONFIGFILE} = 'lighttpd.conf';
diff --git a/tests/core-keepalive.t b/tests/core-keepalive.t
index b4f51f9..e3f6541 100755
--- a/tests/core-keepalive.t
+++ b/tests/core-keepalive.t
@@ -1,9 +1,10 @@
#!/usr/bin/env perl
+
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
@@ -39,7 +40,7 @@ Host: 123.example.org
GET /12345.txt HTTP/1.0
Host: 123.example.org
-Connection: close
+Connection: keep-alive
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
diff --git a/tests/core-request.t b/tests/core-request.t
index a24777f..f4db937 100755
--- a/tests/core-request.t
+++ b/tests/core-request.t
@@ -1,14 +1,14 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
use IO::Socket;
-use Test::More tests => 36;
+use Test::More tests => 33;
use LightyTest;
my $tf = LightyTest->new();
@@ -223,7 +223,7 @@ ok($tf->handle_http($t) == 0, 'Content-Length > max-request-size');
$t->{REQUEST} = ( <<EOF
POST /12345.txt HTTP/1.0
Host: 123.example.org
-Content-Length:
+Content-Length:
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 411 } ];
@@ -273,38 +273,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'uppercase filenames');
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Location: foo
-Location: foobar
- baz
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, '#1232 - duplicate headers with line-wrapping');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Location:
-Location: foobar
- baz
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, '#1232 - duplicate headers with line-wrapping - test 2');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-A:
-Location: foobar
- baz
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, '#1232 - duplicate headers with line-wrapping - test 3');
-
-
-
ok($tf->stop_proc == 0, "Stopping lighttpd");
diff --git a/tests/core-response.t b/tests/core-response.t
index ff2cf1d..a8fbd00 100755
--- a/tests/core-response.t
+++ b/tests/core-response.t
@@ -1,9 +1,10 @@
#!/usr/bin/env perl
+
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
@@ -13,7 +14,7 @@ use LightyTest;
my $tf = LightyTest->new();
my $t;
-
+
ok($tf->start_proc == 0, "Starting lighttpd") or die();
## Low-Level Response-Header Parsing - HTTP/1.1
diff --git a/tests/core-var-include.t b/tests/core-var-include.t
index 8161751..a6ccbd3 100755
--- a/tests/core-var-include.t
+++ b/tests/core-var-include.t
@@ -1,9 +1,9 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
@@ -37,13 +37,13 @@ my $tests = {
"var.myvar" => "/good_var_myvar" . $myvar,
"myvar" => "/good_myvar" . $myvar,
"env" => "/" . $ENV{"env_test"},
-
+
"number1" => "/good_number" . "1",
"number2" => "1" . "/good_number",
"array_append" => "/good_array_append",
"string_append" => "/good_" . $mystr,
"number_append" => "/good_" . "2",
-
+
"include_shell" => "/good_include_shell_" . "456"
};
diff --git a/tests/core.t b/tests/core.t
index b196666..6d11cc6 100755
--- a/tests/core.t
+++ b/tests/core.t
@@ -1,14 +1,15 @@
#!/usr/bin/env perl
+
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
use IO::Socket;
-use Test::More tests => 21;
+use Test::More tests => 17;
use LightyTest;
my $tf = LightyTest->new();
@@ -31,36 +32,6 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
ok($tf->handle_http($t) == 0, 'missing Protocol');
$t->{REQUEST} = ( <<EOF
-GET / HTTP/01.01
-Host: foo
-Connection: close
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'zeros in protocol version');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/.01
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'missing major version');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/01.
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'missing minor version');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/a.b
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'strings as version');
-
-$t->{REQUEST} = ( <<EOF
BC /
EOF
);
@@ -122,7 +93,7 @@ ok($tf->handle_http($t) == 0, 'no whitespace');
$t->{REQUEST} = ( <<EOF
GET / HTTP/1.0
-ABC:foo
+ABC:foo
bc
EOF
);
diff --git a/tests/docroot/123/Makefile.am b/tests/docroot/123/Makefile.am
index e998042..64712d7 100644
--- a/tests/docroot/123/Makefile.am
+++ b/tests/docroot/123/Makefile.am
@@ -1 +1 @@
-EXTRA_DIST=12345.html 12345.txt dummyfile.bla phpinfo.php
+EXTRA_DIST=12345.html 12345.txt dummyfile.bla phpinfo.php
diff --git a/tests/docroot/123/Makefile.in b/tests/docroot/123/Makefile.in
index 84ecb7e..cabff31 100644
--- a/tests/docroot/123/Makefile.in
+++ b/tests/docroot/123/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,12 +13,15 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -37,28 +39,19 @@ target_triplet = @target@
subdir = tests/docroot/123
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ATTR_LIB = @ATTR_LIB@
AUTOCONF = @AUTOCONF@
@@ -69,73 +62,69 @@ BZ_LIB = @BZ_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@
+CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
+CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
CRYPT_LIB = @CRYPT_LIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
+ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
FAM_CFLAGS = @FAM_CFLAGS@
FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
+FFLAGS = @FFLAGS@
GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LBER_LIB = @LBER_LIB@
-LD = @LD@
LDAP_LIB = @LDAP_LIB@
LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LUACONFIG = @LUACONFIG@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
+NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@
+NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@
OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
PCRE_LIB = @PCRE_LIB@
PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
-SED = @SED@
SENDFILE_LIB = @SENDFILE_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -144,18 +133,20 @@ SQLITE_LIBS = @SQLITE_LIBS@
SSL_LIB = @SSL_LIB@
STRIP = @STRIP@
U = @U@
-UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -167,60 +158,48 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
-builddir = @builddir@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
-localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-EXTRA_DIST = 12345.html 12345.txt dummyfile.bla phpinfo.php
+EXTRA_DIST = 12345.html 12345.txt dummyfile.bla phpinfo.php
all: all-am
.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/docroot/123/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign tests/docroot/123/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/docroot/123/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tests/docroot/123/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -234,17 +213,20 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
tags: TAGS
TAGS:
@@ -253,32 +235,29 @@ CTAGS:
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
@@ -296,22 +275,16 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -322,7 +295,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
-distclean-am: clean-am distclean-generic
+distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
@@ -330,38 +303,18 @@ dvi-am:
html: html-am
-html-am:
-
info: info-am
info-am:
install-data-am:
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
install-exec-am:
-install-html: install-html-am
-
-install-html-am:
-
install-info: install-info-am
-install-info-am:
-
install-man:
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -380,21 +333,17 @@ ps: ps-am
ps-am:
-uninstall-am:
-
-.MAKE: install-am install-strip
+uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
-
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/tests/docroot/Makefile.in b/tests/docroot/Makefile.in
index 81f34d2..5d39cdf 100644
--- a/tests/docroot/Makefile.in
+++ b/tests/docroot/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,12 +13,15 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -37,68 +39,28 @@ target_triplet = @target@
subdir = tests/docroot
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
- install-dvi-recursive install-exec-recursive \
- install-html-recursive install-info-recursive \
- install-pdf-recursive install-ps-recursive install-recursive \
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
- distdir
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ATTR_LIB = @ATTR_LIB@
AUTOCONF = @AUTOCONF@
@@ -109,73 +71,69 @@ BZ_LIB = @BZ_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@
+CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
+CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
CRYPT_LIB = @CRYPT_LIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
+ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
FAM_CFLAGS = @FAM_CFLAGS@
FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
+FFLAGS = @FFLAGS@
GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LBER_LIB = @LBER_LIB@
-LD = @LD@
LDAP_LIB = @LDAP_LIB@
LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LUACONFIG = @LUACONFIG@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
+NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@
+NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@
OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
PCRE_LIB = @PCRE_LIB@
PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
-SED = @SED@
SENDFILE_LIB = @SENDFILE_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -184,18 +142,20 @@ SQLITE_LIBS = @SQLITE_LIBS@
SSL_LIB = @SSL_LIB@
STRIP = @STRIP@
U = @U@
-UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -207,60 +167,48 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
-builddir = @builddir@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
-localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
SUBDIRS = 123 www
all: all-recursive
.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/docroot/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign tests/docroot/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/docroot/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tests/docroot/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -274,11 +222,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
@@ -286,6 +233,10 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
@@ -293,7 +244,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @fail= failcom='exit 1'; \
+ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -310,15 +261,16 @@ $(RECURSIVE_TARGETS):
else \
local_target="$$target"; \
fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
-$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -344,16 +296,16 @@ $(RECURSIVE_CLEAN_TARGETS):
else \
local_target="$$target"; \
fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -361,14 +313,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- set x; \
+ tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
@@ -380,101 +332,81 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
+ $$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
@@ -494,22 +426,16 @@ install-am: all-am
installcheck: installcheck-recursive
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -520,7 +446,8 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
+distclean-am: clean-am distclean-generic distclean-libtool \
+ distclean-tags
dvi: dvi-recursive
@@ -528,38 +455,18 @@ dvi-am:
html: html-recursive
-html-am:
-
info: info-recursive
info-am:
install-data-am:
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
install-exec-am:
-install-html: install-html-recursive
-
-install-html-am:
-
install-info: install-info-recursive
-install-info-am:
-
install-man:
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
installcheck-am:
maintainer-clean: maintainer-clean-recursive
@@ -578,25 +485,22 @@ ps: ps-recursive
ps-am:
-uninstall-am:
+uninstall-am: uninstall-info-am
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
- install-am install-strip tags-recursive
+uninstall-info: uninstall-info-recursive
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am check check-am clean clean-generic clean-libtool \
- ctags ctags-recursive distclean distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-libtool clean-recursive ctags \
+ ctags-recursive distclean distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
- uninstall uninstall-am
-
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/tests/docroot/www/404.fcgi b/tests/docroot/www/404.fcgi
deleted file mode 100755
index 468089f..0000000
--- a/tests/docroot/www/404.fcgi
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/perl
-#use CGI qw/:standard/;
-use CGI::Fast qw(:standard);
-my $cgi = new CGI;
-while (new CGI::Fast) {
- my $request_uri = $ENV{'REQUEST_URI'};
- print (STDERR "REQUEST_URI: $request_uri\n");
- if ($request_uri =~ m/^\/dynamic\/200\// ) {
- print header ( -status => 200,
- -type => 'text/plain' );
- print ("found here\n");
- }
- elsif ($request_uri =~ m|^/dynamic/302/| ) {
- print header( -status=>302,
- -location => 'http://www.example.org/');
- }
- elsif ($request_uri =~ m/^\/dynamic\/404\// ) {
- print header ( -status => 404
- -type => 'text/plain' );
- print ("Not found here\n");
- }
- else {
- print header ( -status => 500,
- -type => 'text/plain');
- print ("huh\n");
- };
-};
diff --git a/tests/docroot/www/404.html b/tests/docroot/www/404.html
deleted file mode 100644
index ce72e89..0000000
--- a/tests/docroot/www/404.html
+++ /dev/null
@@ -1 +0,0 @@
-static not found
diff --git a/tests/docroot/www/404.pl b/tests/docroot/www/404.pl
deleted file mode 100755
index 0f743d0..0000000
--- a/tests/docroot/www/404.pl
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/perl
-use CGI qw/:standard/;
-my $cgi = new CGI;
-my $request_uri = $ENV{'REQUEST_URI'};
-print (STDERR "REQUEST_URI: $request_uri\n");
-
-if ($request_uri =~ m/^\/dynamic\/200\// ) {
- print header ( -status => 200,
- -type => 'text/plain' );
- print ("found here\n");
-}
-elsif ($request_uri =~ m|^/dynamic/302/| ) {
- print header( -status=>302,
- -location => 'http://www.example.org/');
-}
-elsif ($request_uri =~ m/^\/dynamic\/404\// ) {
- print header ( -status => 404
- -type => 'text/plain' );
- print ("Not found here\n");
-}
-elsif ($request_uri =~ m/^\/send404\.pl/ ) {
- print header ( -status => 404
- -type => 'text/plain' );
- print ("Not found here (send404)\n");
-}
-elsif ($request_uri =~ m/^\/dynamic\/nostatus\// ) {
- print ("found here\n");
-}
-else {
- print header ( -status => 500,
- -type => 'text/plain');
- print ("huh\n");
-};
diff --git a/tests/docroot/www/Makefile.am b/tests/docroot/www/Makefile.am
index 5bc0c0b..9198f56 100644
--- a/tests/docroot/www/Makefile.am
+++ b/tests/docroot/www/Makefile.am
@@ -1,5 +1,5 @@
-EXTRA_DIST=cgi.php cgi.pl index.html index.txt phpinfo.php \
+EXTRA_DIST=cgi.php cgi.pl dummydir index.html index.txt phpinfo.php \
redirect.php cgi-pathinfo.pl get-env.php get-server-env.php \
nph-status.pl prefix.fcgi get-header.pl ssi.shtml get-post-len.pl \
- exec-date.shtml 404.fcgi 404.html 404.pl send404.pl crlfcrash.pl sendfile.php
+ exec-date.shtml
SUBDIRS=go indexfile expire
diff --git a/tests/docroot/www/Makefile.in b/tests/docroot/www/Makefile.in
index e999de7..55988be 100644
--- a/tests/docroot/www/Makefile.in
+++ b/tests/docroot/www/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,12 +13,15 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -37,68 +39,28 @@ target_triplet = @target@
subdir = tests/docroot/www
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
- install-dvi-recursive install-exec-recursive \
- install-html-recursive install-info-recursive \
- install-pdf-recursive install-ps-recursive install-recursive \
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
- distdir
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ATTR_LIB = @ATTR_LIB@
AUTOCONF = @AUTOCONF@
@@ -109,73 +71,69 @@ BZ_LIB = @BZ_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@
+CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
+CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
CRYPT_LIB = @CRYPT_LIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
+ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
FAM_CFLAGS = @FAM_CFLAGS@
FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
+FFLAGS = @FFLAGS@
GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LBER_LIB = @LBER_LIB@
-LD = @LD@
LDAP_LIB = @LDAP_LIB@
LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LUACONFIG = @LUACONFIG@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
+NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@
+NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@
OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
PCRE_LIB = @PCRE_LIB@
PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
-SED = @SED@
SENDFILE_LIB = @SENDFILE_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -184,18 +142,20 @@ SQLITE_LIBS = @SQLITE_LIBS@
SSL_LIB = @SSL_LIB@
STRIP = @STRIP@
U = @U@
-UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -207,65 +167,53 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
-builddir = @builddir@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
-localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-EXTRA_DIST = cgi.php cgi.pl index.html index.txt phpinfo.php \
+EXTRA_DIST = cgi.php cgi.pl dummydir index.html index.txt phpinfo.php \
redirect.php cgi-pathinfo.pl get-env.php get-server-env.php \
nph-status.pl prefix.fcgi get-header.pl ssi.shtml get-post-len.pl \
- exec-date.shtml 404.fcgi 404.html 404.pl send404.pl crlfcrash.pl sendfile.php
+ exec-date.shtml
SUBDIRS = go indexfile expire
all: all-recursive
.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/docroot/www/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign tests/docroot/www/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/docroot/www/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tests/docroot/www/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -279,11 +227,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
@@ -291,6 +238,10 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
@@ -298,7 +249,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @fail= failcom='exit 1'; \
+ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -315,15 +266,16 @@ $(RECURSIVE_TARGETS):
else \
local_target="$$target"; \
fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
-$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -349,16 +301,16 @@ $(RECURSIVE_CLEAN_TARGETS):
else \
local_target="$$target"; \
fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -366,14 +318,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- set x; \
+ tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
@@ -385,101 +337,81 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
+ $$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
@@ -499,22 +431,16 @@ install-am: all-am
installcheck: installcheck-recursive
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -525,7 +451,8 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
+distclean-am: clean-am distclean-generic distclean-libtool \
+ distclean-tags
dvi: dvi-recursive
@@ -533,38 +460,18 @@ dvi-am:
html: html-recursive
-html-am:
-
info: info-recursive
info-am:
install-data-am:
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
install-exec-am:
-install-html: install-html-recursive
-
-install-html-am:
-
install-info: install-info-recursive
-install-info-am:
-
install-man:
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
installcheck-am:
maintainer-clean: maintainer-clean-recursive
@@ -583,25 +490,22 @@ ps: ps-recursive
ps-am:
-uninstall-am:
+uninstall-am: uninstall-info-am
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
- install-am install-strip tags-recursive
+uninstall-info: uninstall-info-recursive
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am check check-am clean clean-generic clean-libtool \
- ctags ctags-recursive distclean distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-libtool clean-recursive ctags \
+ ctags-recursive distclean distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
- uninstall uninstall-am
-
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/tests/docroot/www/cgi-pathinfo.pl b/tests/docroot/www/cgi-pathinfo.pl
index 7bebb0c..af8d4df 100644
--- a/tests/docroot/www/cgi-pathinfo.pl
+++ b/tests/docroot/www/cgi-pathinfo.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#! /usr/bin/perl
print "Content-Type: text/html\r\n\r\n";
diff --git a/tests/docroot/www/cgi.php b/tests/docroot/www/cgi.php
index f59a840..d92e52f 100755
--- a/tests/docroot/www/cgi.php
+++ b/tests/docroot/www/cgi.php
@@ -1,4 +1,4 @@
-<?php
+<?php
#ob_start(/*"ob_gzhandler"*/);
print "12345<br />\n";
diff --git a/tests/docroot/www/cgi.pl b/tests/docroot/www/cgi.pl
index 88ae6d3..9695adf 100644
--- a/tests/docroot/www/cgi.pl
+++ b/tests/docroot/www/cgi.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#! /usr/bin/perl
print "Content-Type: text/html\r\n\r\n";
diff --git a/tests/docroot/www/crlfcrash.pl b/tests/docroot/www/crlfcrash.pl
deleted file mode 100644
index f90bc86..0000000
--- a/tests/docroot/www/crlfcrash.pl
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env perl
-#
-print "Location: http://www.example.org/\r\n\n\n";
-exit;
diff --git a/tests/docroot/www/dummydir/.svn/README.txt b/tests/docroot/www/dummydir/.svn/README.txt
new file mode 100644
index 0000000..271a8ce
--- /dev/null
+++ b/tests/docroot/www/dummydir/.svn/README.txt
@@ -0,0 +1,2 @@
+This is a Subversion working copy administrative directory.
+Visit http://subversion.tigris.org/ for more information.
diff --git a/tests/docroot/www/dummydir/.svn/empty-file b/tests/docroot/www/dummydir/.svn/empty-file
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/docroot/www/dummydir/.svn/empty-file
diff --git a/tests/docroot/www/dummydir/.svn/entries b/tests/docroot/www/dummydir/.svn/entries
new file mode 100644
index 0000000..d0722cd
--- /dev/null
+++ b/tests/docroot/www/dummydir/.svn/entries
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wc-entries
+ xmlns="svn:">
+<entry
+ committed-rev="1"
+ name=""
+ committed-date="2005-02-12T17:08:04.106079Z"
+ url="svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x/tests/docroot/www/dummydir"
+ last-author="jan"
+ kind="dir"
+ uuid="152afb58-edef-0310-8abb-c4023f1b3aa9"
+ revision="803"/>
+</wc-entries>
diff --git a/tests/docroot/www/dummydir/.svn/format b/tests/docroot/www/dummydir/.svn/format
new file mode 100644
index 0000000..b8626c4
--- /dev/null
+++ b/tests/docroot/www/dummydir/.svn/format
@@ -0,0 +1 @@
+4
diff --git a/tests/docroot/www/expire/Makefile.in b/tests/docroot/www/expire/Makefile.in
index 183765e..23e0c31 100644
--- a/tests/docroot/www/expire/Makefile.in
+++ b/tests/docroot/www/expire/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,12 +13,15 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -37,28 +39,19 @@ target_triplet = @target@
subdir = tests/docroot/www/expire
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ATTR_LIB = @ATTR_LIB@
AUTOCONF = @AUTOCONF@
@@ -69,73 +62,69 @@ BZ_LIB = @BZ_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@
+CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
+CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
CRYPT_LIB = @CRYPT_LIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
+ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
FAM_CFLAGS = @FAM_CFLAGS@
FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
+FFLAGS = @FFLAGS@
GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LBER_LIB = @LBER_LIB@
-LD = @LD@
LDAP_LIB = @LDAP_LIB@
LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LUACONFIG = @LUACONFIG@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
+NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@
+NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@
OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
PCRE_LIB = @PCRE_LIB@
PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
-SED = @SED@
SENDFILE_LIB = @SENDFILE_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -144,18 +133,20 @@ SQLITE_LIBS = @SQLITE_LIBS@
SSL_LIB = @SSL_LIB@
STRIP = @STRIP@
U = @U@
-UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -167,60 +158,48 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
-builddir = @builddir@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
-localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
EXTRA_DIST = access.txt modification.txt
all: all-am
.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/docroot/www/expire/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign tests/docroot/www/expire/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/docroot/www/expire/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tests/docroot/www/expire/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -234,17 +213,20 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
tags: TAGS
TAGS:
@@ -253,32 +235,29 @@ CTAGS:
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
@@ -296,22 +275,16 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -322,7 +295,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
-distclean-am: clean-am distclean-generic
+distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
@@ -330,38 +303,18 @@ dvi-am:
html: html-am
-html-am:
-
info: info-am
info-am:
install-data-am:
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
install-exec-am:
-install-html: install-html-am
-
-install-html-am:
-
install-info: install-info-am
-install-info-am:
-
install-man:
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -380,21 +333,17 @@ ps: ps-am
ps-am:
-uninstall-am:
-
-.MAKE: install-am install-strip
+uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
-
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/tests/docroot/www/get-env.php b/tests/docroot/www/get-env.php
index cd7fa04..15ac94f 100644
--- a/tests/docroot/www/get-env.php
+++ b/tests/docroot/www/get-env.php
@@ -1,4 +1,3 @@
-<?php
- $env = $_GET["env"];
- print isset($_ENV[$env]) ? $_ENV[$env] : '';
+<?php
+ print $_ENV[$_GET["env"]];
?>
diff --git a/tests/docroot/www/get-server-env.php b/tests/docroot/www/get-server-env.php
index 64d9312..17b4994 100644
--- a/tests/docroot/www/get-server-env.php
+++ b/tests/docroot/www/get-server-env.php
@@ -1,3 +1,3 @@
-<?php
+<?php
print $_SERVER[$_GET["env"]];
?>
diff --git a/tests/docroot/www/go/Makefile.in b/tests/docroot/www/go/Makefile.in
index 4dc1c3a..de2af27 100644
--- a/tests/docroot/www/go/Makefile.in
+++ b/tests/docroot/www/go/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,12 +13,15 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -37,28 +39,19 @@ target_triplet = @target@
subdir = tests/docroot/www/go
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ATTR_LIB = @ATTR_LIB@
AUTOCONF = @AUTOCONF@
@@ -69,73 +62,69 @@ BZ_LIB = @BZ_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@
+CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
+CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
CRYPT_LIB = @CRYPT_LIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
+ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
FAM_CFLAGS = @FAM_CFLAGS@
FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
+FFLAGS = @FFLAGS@
GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LBER_LIB = @LBER_LIB@
-LD = @LD@
LDAP_LIB = @LDAP_LIB@
LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LUACONFIG = @LUACONFIG@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
+NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@
+NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@
OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
PCRE_LIB = @PCRE_LIB@
PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
-SED = @SED@
SENDFILE_LIB = @SENDFILE_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -144,18 +133,20 @@ SQLITE_LIBS = @SQLITE_LIBS@
SSL_LIB = @SSL_LIB@
STRIP = @STRIP@
U = @U@
-UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -167,60 +158,48 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
-builddir = @builddir@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
-localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
EXTRA_DIST = cgi.php
all: all-am
.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/docroot/www/go/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign tests/docroot/www/go/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/docroot/www/go/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tests/docroot/www/go/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -234,17 +213,20 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
tags: TAGS
TAGS:
@@ -253,32 +235,29 @@ CTAGS:
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
@@ -296,22 +275,16 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -322,7 +295,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
-distclean-am: clean-am distclean-generic
+distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
@@ -330,38 +303,18 @@ dvi-am:
html: html-am
-html-am:
-
info: info-am
info-am:
install-data-am:
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
install-exec-am:
-install-html: install-html-am
-
-install-html-am:
-
install-info: install-info-am
-install-info-am:
-
install-man:
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -380,21 +333,17 @@ ps: ps-am
ps-am:
-uninstall-am:
-
-.MAKE: install-am install-strip
+uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
-
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/tests/docroot/www/go/cgi.php b/tests/docroot/www/go/cgi.php
index f59a840..d92e52f 100755
--- a/tests/docroot/www/go/cgi.php
+++ b/tests/docroot/www/go/cgi.php
@@ -1,4 +1,4 @@
-<?php
+<?php
#ob_start(/*"ob_gzhandler"*/);
print "12345<br />\n";
diff --git a/tests/docroot/www/indexfile/Makefile.in b/tests/docroot/www/indexfile/Makefile.in
index 1771a01..7812d5e 100644
--- a/tests/docroot/www/indexfile/Makefile.in
+++ b/tests/docroot/www/indexfile/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,12 +13,15 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -37,28 +39,19 @@ target_triplet = @target@
subdir = tests/docroot/www/indexfile
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ATTR_LIB = @ATTR_LIB@
AUTOCONF = @AUTOCONF@
@@ -69,73 +62,69 @@ BZ_LIB = @BZ_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@
+CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
+CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
CRYPT_LIB = @CRYPT_LIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIB = @DL_LIB@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
+ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
FAM_CFLAGS = @FAM_CFLAGS@
FAM_LIBS = @FAM_LIBS@
-FGREP = @FGREP@
+FFLAGS = @FFLAGS@
GDBM_LIB = @GDBM_LIB@
-GREP = @GREP@
-INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LBER_LIB = @LBER_LIB@
-LD = @LD@
LDAP_LIB = @LDAP_LIB@
LDFLAGS = @LDFLAGS@
-LIBEV_CFLAGS = @LIBEV_CFLAGS@
-LIBEV_LIBS = @LIBEV_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LUACONFIG = @LUACONFIG@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MEMCACHE_LIB = @MEMCACHE_LIB@
-MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LIBS = @MYSQL_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
+NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@
+NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@
OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
PCRE_LIB = @PCRE_LIB@
PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
-SED = @SED@
SENDFILE_LIB = @SENDFILE_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -144,18 +133,20 @@ SQLITE_LIBS = @SQLITE_LIBS@
SSL_LIB = @SSL_LIB@
STRIP = @STRIP@
U = @U@
-UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
XML_CFLAGS = @XML_CFLAGS@
XML_LIBS = @XML_LIBS@
Z_LIB = @Z_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -167,60 +158,48 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
-builddir = @builddir@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
-localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
EXTRA_DIST = index.php return-404.php rewrite.php
all: all-am
.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/docroot/www/indexfile/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign tests/docroot/www/indexfile/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/docroot/www/indexfile/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tests/docroot/www/indexfile/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -234,17 +213,20 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
tags: TAGS
TAGS:
@@ -253,32 +235,29 @@ CTAGS:
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
@@ -296,22 +275,16 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -322,7 +295,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
-distclean-am: clean-am distclean-generic
+distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
@@ -330,38 +303,18 @@ dvi-am:
html: html-am
-html-am:
-
info: info-am
info-am:
install-data-am:
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
install-exec-am:
-install-html: install-html-am
-
-install-html-am:
-
install-info: install-info-am
-install-info-am:
-
install-man:
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -380,21 +333,17 @@ ps: ps-am
ps-am:
-uninstall-am:
-
-.MAKE: install-am install-strip
+uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
-
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/tests/docroot/www/indexfile/return-404.php b/tests/docroot/www/indexfile/return-404.php
index 2adaaea..dd680cc 100644
--- a/tests/docroot/www/indexfile/return-404.php
+++ b/tests/docroot/www/indexfile/return-404.php
@@ -1,5 +1,5 @@
-<?php
- header("Status: 404");
-
+<?php
+ header("Status: 404");
+
print $_SERVER["PHP_SELF"];
?>
diff --git a/tests/docroot/www/nph-status.pl b/tests/docroot/www/nph-status.pl
index d817c7f..602cdc7 100755
--- a/tests/docroot/www/nph-status.pl
+++ b/tests/docroot/www/nph-status.pl
@@ -1,10 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl
-my $status = 200;
-
-if (defined $ENV{"QUERY_STRING"}) {
- $status = $ENV{"QUERY_STRING"};
-}
-
-print "HTTP/1.0 ".$status." FooBar\r\n";
+print "HTTP/1.0 30 FooBar\r\n";
print "\r\n";
diff --git a/tests/docroot/www/send404.pl b/tests/docroot/www/send404.pl
deleted file mode 100755
index a92dfa6..0000000
--- a/tests/docroot/www/send404.pl
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/perl
-use CGI qw/:standard/;
-print header ( -status => 404
- -type => 'text/plain' );
-print ("send404\n");
diff --git a/tests/docroot/www/sendfile.php b/tests/docroot/www/sendfile.php
deleted file mode 100644
index 0aa8786..0000000
--- a/tests/docroot/www/sendfile.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-
-function pathencode($path) {
- return str_replace(',', '%2c', urlencode($path));
-}
-
-$val = "X-Sendfile2: " . pathencode(getcwd() . "/index.txt") . " " . $_GET["range"];
-
-if ($_GET["range2"]) $val .= ", " . pathencode(getcwd() . "/index.txt") . " " . $_GET["range2"];
-
-header($val);
-
-?> \ No newline at end of file
diff --git a/tests/fastcgi-10.conf b/tests/fastcgi-10.conf
index 1fa50fb..1300973 100644
--- a/tests/fastcgi-10.conf
+++ b/tests/fastcgi-10.conf
@@ -1,12 +1,12 @@
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
+server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid"
## bind to port (default: 80)
server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
@@ -44,7 +44,7 @@ server.indexfiles = ( "index.php", "index.html",
######################## MODULE CONFIG ############################
-accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
+accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log"
mimetype.assign = ( ".png" => "image/png",
".jpg" => "image/jpeg",
@@ -62,7 +62,7 @@ mimetype.assign = ( ".png" => "image/png",
".c" => "text/plain",
".conf" => "text/plain" )
-compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
+compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/"
compress.filetype = ("text/plain", "text/html")
fastcgi.debug = 0
@@ -82,10 +82,10 @@ cgi.assign = ( ".pl" => "/usr/bin/perl",
ssl.engine = "disable"
-# ssl.pemfile = "server.pem"
+ssl.pemfile = "server.pem"
auth.backend = "plain"
-auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
+auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user"
auth.backend.plain.groupfile = "lighttpd.group"
auth.backend.ldap.hostname = "localhost"
@@ -128,11 +128,11 @@ status.status-url = "/server-status"
status.config-url = "/server-config"
$HTTP["host"] == "vvv.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
}
$HTTP["host"] == "zzz.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
}
diff --git a/tests/fastcgi-13.conf b/tests/fastcgi-13.conf
index 499a7f5..2d6a2bd 100644
--- a/tests/fastcgi-13.conf
+++ b/tests/fastcgi-13.conf
@@ -1,4 +1,5 @@
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
+server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid"
debug.log-request-header = "enable"
debug.log-response-header = "enable"
@@ -7,10 +8,11 @@ debug.log-request-handling = "enable"
## bind to port (default: 80)
server.port = 2048
+# server.license = "00000001000000013feccb804014587f000000010000000105911c976a3d462c8eaa2d7ca850432c"
+
## bind to localhost (default: all interfaces)
server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
@@ -59,7 +61,7 @@ server.indexfiles = ( "index.php", "index.html",
######################## MODULE CONFIG ############################
-accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
+accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log"
mimetype.assign = ( ".png" => "image/png",
".jpg" => "image/jpeg",
@@ -77,7 +79,7 @@ mimetype.assign = ( ".png" => "image/png",
".c" => "text/plain",
".conf" => "text/plain" )
-compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
+compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/"
compress.filetype = ("text/plain", "text/html")
fastcgi.debug = 0
@@ -85,7 +87,7 @@ fastcgi.server = ( ".php" => (
"grisu" => (
"host" => "127.0.0.1",
"port" => 1048,
- "bin-path" => env.PHP,
+ "bin-path" => "/home/jan/Documents/php-5.1.0b3/sapi/cgi/php -c /usr/local/lib/php.ini",
"bin-copy-environment" => ( "PATH", "SHELL", "USER" ),
)
)
@@ -99,10 +101,10 @@ cgi.assign = ( ".pl" => "/usr/bin/perl",
ssl.engine = "disable"
-# ssl.pemfile = "server.pem"
+ssl.pemfile = "server.pem"
auth.backend = "plain"
-auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
+auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user"
auth.backend.plain.groupfile = "lighttpd.group"
auth.backend.ldap.hostname = "localhost"
@@ -145,11 +147,11 @@ status.status-url = "/server-status"
status.config-url = "/server-config"
$HTTP["host"] == "vvv.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
}
$HTTP["host"] == "zzz.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
}
diff --git a/tests/fastcgi-auth.conf b/tests/fastcgi-auth.conf
index 47a9268..c55700c 100644
--- a/tests/fastcgi-auth.conf
+++ b/tests/fastcgi-auth.conf
@@ -1,4 +1,5 @@
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
+server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid"
debug.log-request-header = "enable"
debug.log-response-header = "enable"
@@ -11,12 +12,11 @@ server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
-##
+##
## Format: <errorfile-prefix><status>.html
## -> ..../status-404.html for 'File not found'
#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-"
@@ -27,23 +27,23 @@ server.dir-listing = "enable"
#server.event-handler = "linux-rtsig"
#server.modules.path = ""
-server.modules = (
- "mod_rewrite",
- "mod_access",
+server.modules = (
+ "mod_rewrite",
+ "mod_access",
"mod_auth",
# "mod_httptls",
- "mod_status",
+ "mod_status",
"mod_expire",
# "mod_simple_vhost",
- "mod_redirect",
+ "mod_redirect",
# "mod_evhost",
# "mod_localizer",
"mod_fastcgi",
"mod_cgi",
"mod_compress",
- "mod_accesslog" )
+ "mod_accesslog" )
-server.indexfiles = ( "index.php", "index.html",
+server.indexfiles = ( "index.php", "index.html",
"index.htm", "default.htm" )
#,-- only root can use these options
@@ -55,15 +55,15 @@ server.indexfiles = ( "index.php", "index.html",
#|# change uid to <uid> (default: don't care)
#| server.groupid wwwrun
#|
-#`--
+#`--
######################## MODULE CONFIG ############################
-accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
+accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log"
-mimetype.assign = ( ".png" => "image/png",
+mimetype.assign = ( ".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
@@ -79,57 +79,56 @@ mimetype.assign = ( ".png" => "image/png",
".c" => "text/plain",
".conf" => "text/plain" )
-compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
+compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/"
compress.filetype = ("text/plain", "text/html")
fastcgi.debug = 0
-fastcgi.server = ( "/" => (
- "grisu" => (
+fastcgi.server = ( "/" => (
+ "grisu" => (
"host" => "127.0.0.1",
"port" => 20000,
- "bin-path" => env.SRCDIR + "/fcgi-auth",
+ "bin-path" => "@SRCDIR@/fcgi-auth",
"mode" => "authorizer",
- "docroot" => env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/",
- "check-local" => "disable",
-
+ "docroot" => "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/",
+
)
)
)
-
+
cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl",
".py" => "/usr/bin/python" )
-
+
ssl.engine = "disable"
-# ssl.pemfile = "server.pem"
+ssl.pemfile = "server.pem"
auth.backend = "plain"
-auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
+auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user"
auth.backend.plain.groupfile = "lighttpd.group"
auth.backend.ldap.hostname = "localhost"
auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
auth.backend.ldap.filter = "(uid=$)"
-auth.require = ( "/server-status" =>
- (
+auth.require = ( "/server-status" =>
+ (
"method" => "digest",
"realm" => "download archiv",
# "require" => ("group=www", "user=jan", "host=192.168.2.10")
"require" => "group=www|user=jan|host=192.168.2.10"
),
- "/auth.php" =>
- (
+ "/auth.php" =>
+ (
"method" => "basic",
"realm" => "download archiv",
# "require" => ("group=www", "user=jan", "host=192.168.2.10")
"require" => "user=jan"
),
- "/server-config" =>
- (
+ "/server-config" =>
+ (
"method" => "basic",
"realm" => "download archiv",
# "require" => ("group=www", "user=jan", "user=weigon", "host=192.168.2.10")
@@ -150,11 +149,11 @@ status.status-url = "/server-status"
status.config-url = "/server-config"
$HTTP["host"] == "vvv.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
}
$HTTP["host"] == "zzz.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
}
diff --git a/tests/fastcgi-responder.conf b/tests/fastcgi-responder.conf
index 0f6c1dc..7ced64b 100644
--- a/tests/fastcgi-responder.conf
+++ b/tests/fastcgi-responder.conf
@@ -1,4 +1,5 @@
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
+server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid"
#debug.log-request-header = "enable"
#debug.log-response-header = "enable"
@@ -14,12 +15,11 @@ server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
-##
+##
## Format: <errorfile-prefix><status>.html
## -> ..../status-404.html for 'File not found'
#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-"
@@ -30,23 +30,23 @@ server.dir-listing = "enable"
#server.event-handler = "linux-rtsig"
#server.modules.path = ""
-server.modules = (
- "mod_rewrite",
- "mod_access",
+server.modules = (
+ "mod_rewrite",
+ "mod_access",
"mod_auth",
# "mod_httptls",
- "mod_status",
+ "mod_status",
"mod_expire",
# "mod_simple_vhost",
- "mod_redirect",
+ "mod_redirect",
# "mod_evhost",
# "mod_localizer",
"mod_fastcgi",
"mod_cgi",
"mod_compress",
- "mod_accesslog" )
+ "mod_accesslog" )
-server.indexfiles = ( "index.php", "index.html",
+server.indexfiles = ( "index.php", "index.html",
"index.htm", "default.htm" )
#,-- only root can use these options
@@ -58,15 +58,15 @@ server.indexfiles = ( "index.php", "index.html",
#|# change uid to <uid> (default: don't care)
#| server.groupid wwwrun
#|
-#`--
+#`--
######################## MODULE CONFIG ############################
-accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
+accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log"
-mimetype.assign = ( ".png" => "image/png",
+mimetype.assign = ( ".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
@@ -82,56 +82,56 @@ mimetype.assign = ( ".png" => "image/png",
".c" => "text/plain",
".conf" => "text/plain" )
-compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
+compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/"
compress.filetype = ("text/plain", "text/html")
fastcgi.debug = 0
-fastcgi.server = ( ".fcgi" => (
- "grisu" => (
+fastcgi.server = ( ".fcgi" => (
+ "grisu" => (
"host" => "127.0.0.1",
"port" => 10000,
- "bin-path" => env.SRCDIR + "/fcgi-responder",
+ "bin-path" => "@SRCDIR@/fcgi-responder",
"check-local" => "disable",
"max-procs" => 1,
"min-procs" => 1
)
)
)
-
+
cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl",
".py" => "/usr/bin/python" )
-
+
ssl.engine = "disable"
-# ssl.pemfile = "server.pem"
+ssl.pemfile = "server.pem"
auth.backend = "plain"
-auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
+auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user"
auth.backend.plain.groupfile = "lighttpd.group"
auth.backend.ldap.hostname = "localhost"
auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
auth.backend.ldap.filter = "(uid=$)"
-auth.require = ( "/server-status" =>
- (
+auth.require = ( "/server-status" =>
+ (
"method" => "digest",
"realm" => "download archiv",
# "require" => ("group=www", "user=jan", "host=192.168.2.10")
"require" => "group=www|user=jan|host=192.168.2.10"
),
- "/auth.php" =>
- (
+ "/auth.php" =>
+ (
"method" => "basic",
"realm" => "download archiv",
# "require" => ("group=www", "user=jan", "host=192.168.2.10")
"require" => "user=jan"
),
- "/server-config" =>
- (
+ "/server-config" =>
+ (
"method" => "basic",
"realm" => "download archiv",
# "require" => ("group=www", "user=jan", "user=weigon", "host=192.168.2.10")
@@ -152,23 +152,11 @@ status.status-url = "/server-status"
status.config-url = "/server-config"
$HTTP["host"] == "vvv.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
}
$HTTP["host"] == "zzz.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
}
-$HTTP["host"] == "wsgi.example.org" {
- fastcgi.server = (
- "/" =>
- ( (
- "host" => "127.0.0.1", "port" => 10000,
- "fix-root-scriptname" => "enable",
- "check-local" => "disable",
- "bin-path" => env.SRCDIR + "/fcgi-responder",
- "max-procs" => 1,
- ) ),
- )
-}
diff --git a/tests/fcgi-auth.c b/tests/fcgi-auth.c
index 26bbd0f..ddecddc 100644
--- a/tests/fcgi-auth.c
+++ b/tests/fcgi-auth.c
@@ -1,32 +1,25 @@
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#ifdef HAVE_FASTCGI_FASTCGI_H
-#include <fastcgi/fcgi_stdio.h>
-#else
#include <fcgi_stdio.h>
-#endif
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
int main () {
char* p;
-
- while (FCGI_Accept() >= 0) {
+
+ while (FCGI_Accept() >= 0) {
/* wait for fastcgi authorizer request */
-
+
printf("Content-type: text/html\r\n");
-
+
if (((p = getenv("QUERY_STRING")) == NULL) ||
strcmp(p, "ok") != 0) {
printf("Status: 403 Forbidden\r\n\r\n");
- } else {
+ } else {
printf("\r\n");
/* default Status is 200 - allow access */
}
-
- printf("foobar\r\n");
+
+ printf("foobar\r\n");
}
return 0;
diff --git a/tests/fcgi-responder.c b/tests/fcgi-responder.c
index 81f8ca8..7fbaf28 100644
--- a/tests/fcgi-responder.c
+++ b/tests/fcgi-responder.c
@@ -1,22 +1,15 @@
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#ifdef HAVE_FASTCGI_FASTCGI_H
-#include <fastcgi/fcgi_stdio.h>
-#else
#include <fcgi_stdio.h>
-#endif
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
int main () {
int num_requests = 2;
-
+
while (num_requests > 0 &&
FCGI_Accept() >= 0) {
char* p;
-
+
if (NULL != (p = getenv("QUERY_STRING"))) {
if (0 == strcmp(p, "lf")) {
printf("Status: 200 OK\n\n");
@@ -39,15 +32,9 @@ int main () {
} else {
printf("Status: 500 Internal Foo\r\n\r\n");
}
-
- if (0 == strcmp(p, "path_info")) {
- printf("%s", getenv("PATH_INFO"));
- } else if (0 == strcmp(p, "script_name")) {
- printf("%s", getenv("SCRIPT_NAME"));
- } else {
- printf("test123");
- }
+
+ printf("test123");
}
-
+
return 0;
}
diff --git a/tests/lighttpd.conf b/tests/lighttpd.conf
index a4b5cd8..8d38c09 100644
--- a/tests/lighttpd.conf
+++ b/tests/lighttpd.conf
@@ -1,19 +1,14 @@
debug.log-request-handling = "enable"
-debug.log-request-header = "enable"
-debug.log-response-header = "enable"
debug.log-condition-handling = "enable"
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
-
-## 64 Mbyte ... nice limit
-server.max-request-size = 65000
+server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
+server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid"
## bind to port (default: 80)
server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
@@ -23,17 +18,17 @@ server.dir-listing = "enable"
#server.event-handler = "linux-rtsig"
#server.modules.path = ""
-server.modules = (
+server.modules = (
"mod_rewrite",
"mod_setenv",
"mod_secdownload",
- "mod_access",
+ "mod_access",
"mod_auth",
# "mod_httptls",
- "mod_status",
+ "mod_status",
"mod_expire",
"mod_simple_vhost",
- "mod_redirect",
+ "mod_redirect",
# "mod_evhost",
# "mod_localizer",
"mod_fastcgi",
@@ -41,9 +36,9 @@ server.modules = (
"mod_compress",
"mod_userdir",
"mod_ssi",
- "mod_accesslog" )
+ "mod_accesslog" )
-server.indexfiles = ( "index.php", "index.html",
+server.indexfiles = ( "index.php", "index.html",
"index.htm", "default.htm" )
@@ -51,9 +46,9 @@ server.indexfiles = ( "index.php", "index.html",
ssi.extension = ( ".shtml" )
-accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
+accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log"
-mimetype.assign = ( ".png" => "image/png",
+mimetype.assign = ( ".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
@@ -70,7 +65,7 @@ mimetype.assign = ( ".png" => "image/png",
".conf" => "text/plain" )
$HTTP["host"] == "cache.example.org" {
- compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
+ compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/"
}
compress.filetype = ("text/plain", "text/html")
@@ -83,39 +78,39 @@ $HTTP["url"] =~ "\.pdf$" {
}
fastcgi.debug = 0
-fastcgi.server = ( ".php" => ( ( "host" => "127.0.0.1", "port" => 1026, "broken-scriptfilename" => "enable", "allow-x-send-file" => "enable" ) ),
+fastcgi.server = ( ".php" => ( ( "host" => "127.0.0.1", "port" => 1026, "broken-scriptfilename" => "enable" ) ),
"/prefix.fcgi" => ( ( "host" => "127.0.0.1", "port" => 1026, "check-local" => "disable", "broken-scriptfilename" => "enable" ) )
)
-
+
cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl",
".py" => "/usr/bin/python" )
-
+
userdir.include-user = ( "jan" )
userdir.path = "/"
ssl.engine = "disable"
-# ssl.pemfile = "server.pem"
+ssl.pemfile = "server.pem"
$HTTP["host"] == "auth-htpasswd.example.org" {
auth.backend = "htpasswd"
}
auth.backend = "plain"
-auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
+auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user"
-auth.backend.htpasswd.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.htpasswd"
+auth.backend.htpasswd.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.htpasswd"
-auth.require = ( "/server-status" =>
- (
+auth.require = ( "/server-status" =>
+ (
"method" => "digest",
"realm" => "download archiv",
"require" => "group=www|user=jan|host=192.168.2.10"
),
- "/server-config" =>
- (
+ "/server-config" =>
+ (
"method" => "basic",
"realm" => "download archiv",
"require" => "valid-user"
@@ -127,9 +122,7 @@ url.access-deny = ( "~", ".inc")
url.rewrite = ( "^/rewrite/foo($|\?.+)" => "/indexfile/rewrite.php$1",
"^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1" )
-url.rewrite-if-not-file = ( "^(/rewrite/[^?]*)(?:\?(.*))?$" => "/indexfile/rewrite.php?file=$1&$2" )
-
-expire.url = ( "/expire/access" => "access 2 hours",
+expire.url = ( "/expire/access" => "access 2 hours",
"/expire/modification" => "access plus 1 seconds 2 minutes")
#cache.cache-dir = "/home/weigon/wwwroot/cache/"
@@ -139,55 +132,29 @@ status.status-url = "/server-status"
status.config-url = "/server-config"
$HTTP["host"] == "vvv.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
secdownload.secret = "verysecret"
- secdownload.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ secdownload.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
secdownload.uri-prefix = "/sec/"
secdownload.timeout = 120
}
$HTTP["host"] == "zzz.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "zzz.example.org"
- static-file.disable-pathinfo = "enable"
-}
-
-$HTTP["host"] == "symlink.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- server.name = "symlink.example.org"
- server.follow-symlink = "enable"
-}
-
-$HTTP["host"] == "nosymlink.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- server.name = "symlink.example.org"
- server.follow-symlink = "disable"
}
$HTTP["host"] == "no-simple.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/123.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/123.example.org/pages/"
server.name = "zzz.example.org"
}
$HTTP["host"] !~ "(no-simple\.example\.org)" {
simple-vhost.document-root = "pages"
- simple-vhost.server-root = env.SRCDIR + "/tmp/lighttpd/servers/"
+ simple-vhost.server-root = "@SRCDIR@/tmp/lighttpd/servers/"
simple-vhost.default-host = "www.example.org"
}
-$HTTP["host"] == "auth.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- server.name = "auth.example.org"
- auth.backend = "htpasswd"
- auth.require = ( "" =>
- (
- "method" => "basic",
- "realm" => "download archiv",
- "require" => "valid-user"
- )
- )
-}
-
$HTTP["host"] =~ "(vvv).example.org" {
url.redirect = ( "^/redirect/$" => "http://localhost:2048/" )
}
@@ -232,7 +199,3 @@ $HTTP["cookie"] =~ "empty-ref" {
}
-$HTTP["host"] == "etag.example.org" {
- static-file.etags = "disable"
- compress.filetype = ()
-}
diff --git a/tests/lowercase.conf b/tests/lowercase.conf
deleted file mode 100644
index b66980d..0000000
--- a/tests/lowercase.conf
+++ /dev/null
@@ -1,80 +0,0 @@
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
-
-## bind to port (default: 80)
-server.port = 2048
-
-## bind to localhost (default: all interfaces)
-server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
-
-server.force-lowercase-filenames = "enable"
-
-server.dir-listing = "enable"
-
-server.modules = (
- "mod_rewrite",
- "mod_setenv",
- "mod_secdownload",
- "mod_access",
- "mod_auth",
- "mod_status",
- "mod_expire",
- "mod_redirect",
- "mod_fastcgi",
- "mod_cgi" )
-
-server.indexfiles = ( "index.php", "index.html",
- "index.htm", "default.htm" )
-
-
-######################## MODULE CONFIG ############################
-
-mimetype.assign = ( ".png" => "image/png",
- ".jpg" => "image/jpeg",
- ".jpeg" => "image/jpeg",
- ".gif" => "image/gif",
- ".html" => "text/html",
- ".htm" => "text/html",
- ".pdf" => "application/pdf",
- ".swf" => "application/x-shockwave-flash",
- ".spl" => "application/futuresplash",
- ".txt" => "text/plain",
- ".tar.gz" => "application/x-tgz",
- ".tgz" => "application/x-tgz",
- ".gz" => "application/x-gzip",
- ".c" => "text/plain",
- ".conf" => "text/plain" )
-
-fastcgi.debug = 0
-fastcgi.server = ( ".php" => ( ( "host" => "127.0.0.1", "port" => 1026, "broken-scriptfilename" => "enable" ) ),
- "/prefix.fcgi" => ( ( "host" => "127.0.0.1", "port" => 1026, "check-local" => "disable", "broken-scriptfilename" => "enable" ) )
- )
-
-
-cgi.assign = ( ".pl" => "/usr/bin/perl",
- ".cgi" => "/usr/bin/perl",
- ".py" => "/usr/bin/python" )
-
-auth.backend = "plain"
-auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
-
-auth.backend.htpasswd.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.htpasswd"
-
-$HTTP["host"] == "lowercase-auth" {
- auth.require = ( "/image.jpg" =>
- (
- "method" => "digest",
- "realm" => "download archiv",
- "require" => "valid-user"
- )
- )
-}
-
-$HTTP["host"] == "lowercase-deny" {
- url.access-deny = ( ".jpg")
-}
-
-$HTTP["host"] == "lowercase-exclude" {
- static-file.exclude-extensions = ( ".jpg" )
-}
diff --git a/tests/lowercase.t b/tests/lowercase.t
deleted file mode 100755
index f6f6f2c..0000000
--- a/tests/lowercase.t
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/env perl
-BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
-}
-
-use strict;
-use IO::Socket;
-use Test::More tests => 10;
-use LightyTest;
-
-my $tf = LightyTest->new();
-my $t;
-
-$tf->{CONFIGFILE} = 'lowercase.conf';
-
-ok($tf->start_proc == 0, "Starting lighttpd") or die();
-
-## check if lower-casing works
-
-$t->{REQUEST} = ( <<EOF
-GET /image.JPG HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'uppercase access');
-
-$t->{REQUEST} = ( <<EOF
-GET /image.jpg HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'lowercase access');
-
-## check that mod-auth works
-
-$t->{REQUEST} = ( <<EOF
-GET /image.JPG HTTP/1.0
-Host: lowercase-auth
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
-ok($tf->handle_http($t) == 0, 'uppercase access');
-
-$t->{REQUEST} = ( <<EOF
-GET /image.jpg HTTP/1.0
-Host: lowercase-auth
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
-ok($tf->handle_http($t) == 0, 'lowercase access');
-
-
-## check that mod-staticfile exclude works
-$t->{REQUEST} = ( <<EOF
-GET /image.JPG HTTP/1.0
-Host: lowercase-exclude
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
-ok($tf->handle_http($t) == 0, 'upper case access to staticfile.exclude-extension');
-
-$t->{REQUEST} = ( <<EOF
-GET /image.jpg HTTP/1.0
-Host: lowercase-exclude
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
-ok($tf->handle_http($t) == 0, 'lowercase access');
-
-
-## check that mod-access exclude works
-$t->{REQUEST} = ( <<EOF
-GET /image.JPG HTTP/1.0
-Host: lowercase-deny
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
-ok($tf->handle_http($t) == 0, 'uppercase access to url.access-deny protected location');
-
-$t->{REQUEST} = ( <<EOF
-GET /image.jpg HTTP/1.0
-Host: lowercase-deny
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
-ok($tf->handle_http($t) == 0, 'lowercase access');
-
-
-
-ok($tf->stop_proc == 0, "Stopping lighttpd");
-
diff --git a/tests/mod-access.t b/tests/mod-access.t
index 58c01ac..b32dfe0 100755
--- a/tests/mod-access.t
+++ b/tests/mod-access.t
@@ -1,19 +1,19 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
use IO::Socket;
-use Test::More tests => 4;
+use Test::More tests => 3;
use LightyTest;
my $tf = LightyTest->new();
my $t;
-
+
ok($tf->start_proc == 0, "Starting lighttpd") or die();
$t->{REQUEST} = ( <<EOF
@@ -23,12 +23,5 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
ok($tf->handle_http($t) == 0, 'forbid access to ...~');
-$t->{REQUEST} = ( <<EOF
-GET /index.html~/ HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
-ok($tf->handle_http($t) == 0, '#1230 - forbid access to ...~ - trailing slash');
-
ok($tf->stop_proc == 0, "Stopping lighttpd");
diff --git a/tests/mod-auth.t b/tests/mod-auth.t
index 89ead9d..f9017b2 100755
--- a/tests/mod-auth.t
+++ b/tests/mod-auth.t
@@ -1,19 +1,19 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
use IO::Socket;
-use Test::More tests => 15;
+use Test::More tests => 9;
use LightyTest;
my $tf = LightyTest->new();
my $t;
-
+
ok($tf->start_proc == 0, "Starting lighttpd") or die();
$t->{REQUEST} = ( <<EOF
@@ -25,14 +25,6 @@ ok($tf->handle_http($t) == 0, 'Missing Auth-token');
$t->{REQUEST} = ( <<EOF
GET /server-status HTTP/1.0
-Authorization: Basic \x80mFuOmphb
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
-ok($tf->handle_http($t) == 0, 'Basic-Auth: Invalid base64 Auth-token');
-
-$t->{REQUEST} = ( <<EOF
-GET /server-status HTTP/1.0
Authorization: Basic amFuOmphb
EOF
);
@@ -56,16 +48,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (des)');
-$t->{REQUEST} = ( <<EOF
-GET /server-config HTTP/1.0
-Host: auth-htpasswd.example.org
-Authorization: basic ZGVzOmRlcw==
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (des) (lowercase)');
-
-
SKIP: {
skip "no md5 for crypt under cygwin", 1 if $^O eq 'cygwin';
$t->{REQUEST} = ( <<EOF
@@ -97,58 +79,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
ok($tf->handle_http($t) == 0, 'Digest-Auth: missing qop, no crash');
-## this should not crash
-$t->{REQUEST} = ( <<EOF
-GET /server-status HTTP/1.0
-User-Agent: Wget/1.9.1
-Authorization: Digest username="jan", realm="jan",
- nonce="b1d12348b4620437c43dd61c50ae4639",
- uri="/MJ-BONG.xm.mpc", qop=auth, noncecount=00000001",
- cnonce="036FCA5B86F7E7C4965C7F9B8FE714B7",
- response="29B32C2953C763C6D033C8A49983B87E"
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'Digest-Auth: missing nc (noncecount instead), no crash');
-
-$t->{REQUEST} = ( <<EOF
-GET /server-status HTTP/1.0
-Authorization: Basic =
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
-ok($tf->handle_http($t) == 0, 'Basic-Auth: Invalid Base64');
-
-
-$t->{REQUEST} = ( <<EOF
-GET /server-status HTTP/1.0
-User-Agent: Wget/1.9.1
-Authorization: Digest username="jan", realm="jan",
- nonce="b1d12348b4620437c43dd61c50ae4639", algorithm="md5-sess",
- uri="/MJ-BONG.xm.mpc", qop=auth, noncecount=00000001",
- cnonce="036FCA5B86F7E7C4965C7F9B8FE714B7",
- nc="asd",
- response="29B32C2953C763C6D033C8A49983B87E"
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
-ok($tf->handle_http($t) == 0, 'Digest-Auth: md5-sess + missing cnonce');
-
-$t->{REQUEST} = ( <<EOF
-GET /server-status HTTP/1.0
-User-Agent: Wget/1.9.1
-Authorization: Digest username="jan", realm="jan",
- nonce="b1d12348b4620437c43dd61c50ae4639", algorithm="md5-sess",
- uri="/MJ-BONG.xm.mpc", qop=auth, noncecount=00000001",
- cnonce="036FCA5B86F7E7C4965C7F9B8FE714B7",
- nc="asd",
- response="29B32C2953C763C6D033C8A49983B87E"
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
-ok($tf->handle_http($t) == 0, 'Digest-Auth: trailing WS');
-
-
ok($tf->stop_proc == 0, "Stopping lighttpd");
diff --git a/tests/mod-cgi.t b/tests/mod-cgi.t
index 24777ca..b205d8c 100755
--- a/tests/mod-cgi.t
+++ b/tests/mod-cgi.t
@@ -1,19 +1,19 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
use IO::Socket;
-use Test::More tests => 18;
+use Test::More tests => 15;
use LightyTest;
my $tf = LightyTest->new();
my $t;
-
+
ok($tf->start_proc == 0, "Starting lighttpd") or die();
# mod-cgi
@@ -40,25 +40,11 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-
ok($tf->handle_http($t) == 0, 'perl via cgi + pathinfo');
$t->{REQUEST} = ( <<EOF
-GET /nph-status.pl?30 HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'NPH + perl, invalid status-code (#14)');
-
-$t->{REQUEST} = ( <<EOF
-GET /nph-status.pl?304 HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
-ok($tf->handle_http($t) == 0, 'NPH + perl, setting status-code (#1125)');
-
-$t->{REQUEST} = ( <<EOF
-GET /nph-status.pl?200 HTTP/1.0
+GET /nph-status.pl HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'NPH + perl, setting status-code');
+ok($tf->handle_http($t) == 0, 'NPH + perl, Bug #14');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl?GATEWAY_INTERFACE HTTP/1.0
@@ -130,13 +116,5 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, '+Content-Length' => '' } ];
ok($tf->handle_http($t) == 0, 'cgi-env: HTTP_HOST');
-# broken header crash
-$t->{REQUEST} = ( <<EOF
-GET /crlfcrash.pl HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 302, 'Location' => 'http://www.example.org/' } ];
-ok($tf->handle_http($t) == 0, 'broken header via perl cgi');
-
ok($tf->stop_proc == 0, "Stopping lighttpd");
diff --git a/tests/mod-compress.conf b/tests/mod-compress.conf
deleted file mode 100644
index b7c3f2c..0000000
--- a/tests/mod-compress.conf
+++ /dev/null
@@ -1,33 +0,0 @@
-debug.log-request-handling = "enable"
-debug.log-response-header = "disable"
-debug.log-request-header = "disable"
-
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
-server.pid-file = env.SRCDIR + "/tmp/lighttpd/lighttpd.pid"
-
-## bind to port (default: 80)
-server.port = 2048
-
-## bind to localhost (default: all interfaces)
-server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
-server.name = "www.example.org"
-
-server.modules = (
- "mod_compress"
-)
-
-######################## MODULE CONFIG ############################
-
-mimetype.assign = (
- ".html" => "text/html",
- ".txt" => "text/plain; charset=utf-8",
-)
-
-$HTTP["host"] == "cache.example.org" {
- compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
-}
-compress.filetype = ("text/plain", "text/html")
-
-compress.allowed-encodings = ( "gzip", "deflate" )
diff --git a/tests/mod-compress.t b/tests/mod-compress.t
index 966f613..3f1462a 100755
--- a/tests/mod-compress.t
+++ b/tests/mod-compress.t
@@ -1,21 +1,19 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
use IO::Socket;
-use Test::More tests => 11;
+use Test::More tests => 9;
use LightyTest;
my $tf = LightyTest->new();
my $t;
-
-$tf->{CONFIGFILE} = 'mod-compress.conf';
-
+
ok($tf->start_proc == 0, "Starting lighttpd") or die();
$t->{REQUEST} = ( <<EOF
@@ -76,28 +74,7 @@ GET /index.txt HTTP/1.0
Accept-Encoding: gzip, deflate
EOF
);
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', '+Content-Encoding' => '', 'Content-Type' => "text/plain; charset=utf-8" } ];
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', '+Content-Encoding' => '', 'Content-Type' => "text/plain" } ];
ok($tf->handle_http($t) == 0, 'Content-Type is from the original file');
-$t->{REQUEST} = ( <<EOF
-GET /index.txt HTTP/1.0
-Accept-encoding:
-X-Accept-encoding: x-i2p-gzip;q=1.0, identity;q=0.5, deflate;q=0, gzip;q=0, *;q=0
-User-Agent: MYOB/6.66 (AN/ON)
-Connection: close
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Type' => "text/plain; charset=utf-8" } ];
-ok($tf->handle_http($t) == 0, 'Empty Accept-Encoding');
-
-$t->{REQUEST} = ( <<EOF
-GET /index.txt HTTP/1.0
-Accept-Encoding: bzip2, gzip, deflate
-Host: cache.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Encoding' => 'gzip', 'Content-Type' => "text/plain; charset=utf-8" } ];
-ok($tf->handle_http($t) == 0, 'bzip2 requested but disabled');
-
-
ok($tf->stop_proc == 0, "Stopping lighttpd");
diff --git a/tests/mod-fastcgi.t b/tests/mod-fastcgi.t
index 691bce2..c6acec7 100755
--- a/tests/mod-fastcgi.t
+++ b/tests/mod-fastcgi.t
@@ -1,33 +1,23 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
-use Test::More tests => 58;
+use Test::More tests => 45;
use LightyTest;
my $tf = LightyTest->new();
my $t;
-my $php_child = -1;
-
-my $phpbin = (defined $ENV{'PHP'} ? $ENV{'PHP'} : '/usr/bin/php-cgi');
-$ENV{'PHP'} = $phpbin;
SKIP: {
- skip "PHP already running on port 1026", 1 if $tf->listening_on(1026);
- skip "no php binary found", 1 unless -x $phpbin;
- ok(-1 != ($php_child = $tf->spawnfcgi($phpbin, 1026)), "Spawning php");
-}
+ skip "no PHP running on port 1026", 28 unless $tf->listening_on(1026);
-SKIP: {
- skip "no PHP running on port 1026", 35 unless $tf->listening_on(1026);
-
- ok($tf->start_proc == 0, "Starting lighttpd") or goto cleanup;
+ ok($tf->start_proc == 0, "Starting lighttpd") or die();
$t->{REQUEST} = ( <<EOF
GET /phpinfo.php HTTP/1.0
@@ -62,14 +52,6 @@ EOF
ok($tf->handle_http($t) == 0, 'Status + Location via FastCGI');
$t->{REQUEST} = ( <<EOF
-GET /redirect.php/ HTTP/1.0
-Host: www.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 302, 'Location' => 'http://www.example.org:2048/' } ];
- ok($tf->handle_http($t) == 0, 'Trailing slash as path-info (#1989: workaround broken operating systems)');
-
- $t->{REQUEST} = ( <<EOF
GET /get-server-env.php?env=PHP_SELF HTTP/1.0
Host: www.example.org
EOF
@@ -78,12 +60,12 @@ EOF
ok($tf->handle_http($t) == 0, '$_SERVER["PHP_SELF"]');
$t->{REQUEST} = ( <<EOF
-GET /get-server-env.php/foo?env=SCRIPT_NAME HTTP/1.0
+GET /get-server-env.php/foo?env=PHP_SELF HTTP/1.0
Host: www.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/get-server-env.php' } ];
- ok($tf->handle_http($t) == 0, '$_SERVER["SCRIPT_NAME"]');
+ ok($tf->handle_http($t) == 0, '$_SERVER["PHP_SELF"]');
$t->{REQUEST} = ( <<EOF
GET /get-server-env.php/foo?env=PATH_INFO HTTP/1.0
@@ -133,13 +115,6 @@ EOF
ok($tf->handle_http($t) == 0, 'PATHINFO');
$t->{REQUEST} = ( <<EOF
-GET /cgi.php%20%20%20 HTTP/1.0
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
- ok($tf->handle_http($t) == 0, 'No source retrieval');
-
- $t->{REQUEST} = ( <<EOF
GET /www/abc/def HTTP/1.0
EOF
);
@@ -174,44 +149,12 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/foo/bar' } ];
ok($tf->handle_http($t) == 0, 'PATH_INFO, check-local off');
- $t->{REQUEST} = ( <<EOF
-GET /sendfile.php?range=0- HTTP/1.0
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Length' => 4348 } ];
- ok($tf->handle_http($t) == 0, 'X-Sendfile2');
-
- $t->{REQUEST} = ( <<EOF
-GET /sendfile.php?range=0-4&range2=5- HTTP/1.0
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Length' => 4348 } ];
- ok($tf->handle_http($t) == 0, 'X-Sendfile2');
-
- $t->{REQUEST} = ( <<EOF
-GET /get-server-env.php?env=REMOTE_USER HTTP/1.0
-Host: auth.example.org
-Authorization: Basic ZGVzOmRlcw==
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'des' } ];
- ok($tf->handle_http($t) == 0, '$_SERVER["REMOTE_USER"]');
-
- $t->{REQUEST} = ( <<EOF
-GET /get-server-env.php?env=AUTH_TYPE HTTP/1.0
-Host: auth.example.org
-Authorization: Basic ZGVzOmRlcw==
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'Basic' } ];
- ok($tf->handle_http($t) == 0, '$_SERVER["AUTH_TYPE"]');
-
-
+
ok($tf->stop_proc == 0, "Stopping lighttpd");
$tf->{CONFIGFILE} = 'fastcgi-10.conf';
- ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or goto cleanup;
+ ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
$t->{REQUEST} = ( <<EOF
GET /get-server-env.php?env=SERVER_NAME HTTP/1.0
Host: zzz.example.org
@@ -220,18 +163,10 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'zzz.example.org' } ];
ok($tf->handle_http($t) == 0, 'FastCGI + Host');
- $t->{REQUEST} = ( <<EOF
-GET http://zzz.example.org/get-server-env.php?env=SERVER_NAME HTTP/1.0
-Host: aaa.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'zzz.example.org' } ];
- ok($tf->handle_http($t) == 0, 'SERVER_NAME (absolute url in request line)');
-
ok($tf->stop_proc == 0, "Stopping lighttpd");
$tf->{CONFIGFILE} = 'bug-06.conf';
- ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or goto cleanup;
+ ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
$t->{REQUEST} = ( <<EOF
GET /indexfile/ HTTP/1.0
Host: www.example.org
@@ -243,7 +178,7 @@ EOF
ok($tf->stop_proc == 0, "Stopping lighttpd");
$tf->{CONFIGFILE} = 'bug-12.conf';
- ok($tf->start_proc == 0, "Starting lighttpd with bug-12.conf") or goto cleanup;
+ ok($tf->start_proc == 0, "Starting lighttpd with bug-12.conf") or die();
$t->{REQUEST} = ( <<EOF
POST /indexfile/abc HTTP/1.0
Host: www.example.org
@@ -257,13 +192,7 @@ EOF
}
SKIP: {
- skip "PHP not started, cannot stop it", 1 unless $php_child != -1;
- ok(0 == $tf->endspawnfcgi($php_child), "Stopping php");
- $php_child = -1;
-}
-
-SKIP: {
- skip "no fcgi-auth found", 5 unless -x $tf->{BASEDIR}."/tests/fcgi-auth" || -x $tf->{BASEDIR}."/tests/fcgi-auth.exe";
+ skip "no fcgi-auth found", 4 unless -x $tf->{BASEDIR}."/tests/fcgi-auth" || -x $tf->{BASEDIR}."/tests/fcgi-auth.exe";
$tf->{CONFIGFILE} = 'fastcgi-auth.conf';
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
@@ -283,19 +212,11 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
ok($tf->handle_http($t) == 0, 'FastCGI - Auth');
- $t->{REQUEST} = ( <<EOF
-GET /expire/access.txt?ok HTTP/1.0
-Host: www.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
- ok($tf->handle_http($t) == 0, 'FastCGI - Auth in subdirectory');
-
ok($tf->stop_proc == 0, "Stopping lighttpd");
}
SKIP: {
- skip "no php found", 5 unless -x $phpbin;
+ skip "no php found", 4 unless -x "/home/jan/Documents/php-5.1.0b3/sapi/cgi/php";
$tf->{CONFIGFILE} = 'fastcgi-13.conf';
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
$t->{REQUEST} = ( <<EOF
@@ -306,15 +227,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'FastCGI + local spawning');
- $t->{REQUEST} = ( <<EOF
-HEAD /indexfile/index.php HTTP/1.0
-Host: www.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '-Content-Length' => '0' } ];
- # Of course a valid content-length != 0 would be ok, but we assume for now that such one is not generated.
- ok($tf->handle_http($t) == 0, 'Check for buggy content length with HEAD');
-
$t->{REQUEST} = ( <<EOF
GET /get-env.php?env=MAIL HTTP/1.0
Host: www.example.org
@@ -330,7 +242,7 @@ EOF
SKIP: {
- skip "no fcgi-responder found", 11 unless -x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe";
+ skip "no fcgi-responder found", 9 unless -x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe";
$tf->{CONFIGFILE} = 'fastcgi-responder.conf';
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
@@ -367,23 +279,6 @@ EOF
ok($tf->handle_http($t) == 0, 'line-ending \r\n + \r\n');
$t->{REQUEST} = ( <<EOF
-GET /abc/def/ghi?path_info HTTP/1.0
-Host: wsgi.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/abc/def/ghi' } ];
- ok($tf->handle_http($t) == 0, 'PATH_INFO (wsgi)');
-
- $t->{REQUEST} = ( <<EOF
-GET /abc/def/ghi?script_name HTTP/1.0
-Host: wsgi.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '' } ];
- ok($tf->handle_http($t) == 0, 'SCRIPT_NAME (wsgi)');
-
-
- $t->{REQUEST} = ( <<EOF
GET /index.fcgi?die-at-end HTTP/1.0
Host: www.example.org
EOF
@@ -391,7 +286,7 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ];
ok($tf->handle_http($t) == 0, 'killing fastcgi and wait for restart');
- select(undef, undef, undef, .2);
+ select(undef, undef, undef, 2);
$t->{REQUEST} = ( <<EOF
GET /index.fcgi?die-at-end HTTP/1.0
Host: www.example.org
@@ -401,7 +296,7 @@ EOF
ok($tf->handle_http($t) == 0, 'killing fastcgi and wait for restart');
- select(undef, undef, undef, .2);
+ select(undef, undef, undef, 2);
$t->{REQUEST} = ( <<EOF
GET /index.fcgi?crlf HTTP/1.0
Host: www.example.org
@@ -414,10 +309,3 @@ EOF
ok($tf->stop_proc == 0, "Stopping lighttpd");
}
-exit 0;
-
-cleanup: ;
-
-$tf->endspawnfcgi($php_child) if $php_child != -1;
-
-die();
diff --git a/tests/mod-proxy.t b/tests/mod-proxy.t
deleted file mode 100755
index 0c7283e..0000000
--- a/tests/mod-proxy.t
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/env perl
-BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
-}
-
-use strict;
-use IO::Socket;
-use Test::More tests => 9;
-use LightyTest;
-
-my $tf_real = LightyTest->new();
-my $tf_proxy = LightyTest->new();
-
-my $t;
-my $php_child = -1;
-
-my $phpbin = (defined $ENV{'PHP'} ? $ENV{'PHP'} : '/usr/bin/php-cgi');
-$ENV{'PHP'} = $phpbin;
-
-SKIP: {
- skip "PHP already running on port 1026", 1 if $tf_real->listening_on(1026);
- skip "no php binary found", 1 unless -x $phpbin;
- ok(-1 != ($php_child = $tf_real->spawnfcgi($phpbin, 1026)), "Spawning php");
-}
-
-## we need two procs
-## 1. the real webserver
-## 2. the proxy server
-
-$tf_real->{PORT} = 2048;
-$tf_real->{CONFIGFILE} = 'lighttpd.conf';
-
-$tf_proxy->{PORT} = 2050;
-$tf_proxy->{CONFIGFILE} = 'proxy.conf';
-
-ok($tf_real->start_proc == 0, "Starting lighttpd") or goto cleanup;
-
-ok($tf_proxy->start_proc == 0, "Starting lighttpd as proxy") or goto cleanup;
-
-$t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-Host: www.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf_proxy->handle_http($t) == 0, 'valid request');
-
-$t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-Host: www.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Server' => 'Apache 1.3.29' } ];
-ok($tf_proxy->handle_http($t) == 0, 'drop Server from real server');
-
-SKIP: {
- skip "no PHP running on port 1026", 1 unless $tf_real->listening_on(1026);
- $t->{REQUEST} = ( <<EOF
-GET /rewrite/all/some+test%3axxx%20with%20space HTTP/1.0
-Host: www.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/some+test%3axxx%20with%20space' } ];
- ok($tf_proxy->handle_http($t) == 0, 'rewrited urls work with encoded path');
-}
-
-ok($tf_proxy->stop_proc == 0, "Stopping lighttpd proxy");
-
-ok($tf_real->stop_proc == 0, "Stopping lighttpd");
-
-SKIP: {
- skip "PHP not started, cannot stop it", 1 unless $php_child != -1;
- ok(0 == $tf_real->endspawnfcgi($php_child), "Stopping php");
- $php_child = -1;
-}
-
-exit 0;
-
-cleanup:
-
-$tf_real->endspawnfcgi($php_child) if $php_child != -1;
-
-die();
diff --git a/tests/mod-redirect.t b/tests/mod-redirect.t
index 14669d9..666ca80 100755
--- a/tests/mod-redirect.t
+++ b/tests/mod-redirect.t
@@ -1,19 +1,19 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
use IO::Socket;
-use Test::More tests => 7;
+use Test::More tests => 6;
use LightyTest;
my $tf = LightyTest->new();
my $t;
-
+
ok($tf->start_proc == 0, "Starting lighttpd") or die();
$t->{REQUEST} = ( <<EOF
@@ -24,14 +24,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:'.$tf->{PORT}.'/' } ];
ok($tf->handle_http($t) == 0, 'external redirect');
-$t->{REQUEST} = ( <<EOF
-GET /redirect/ HTTP/1.0
-Host: vvv.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:'.$tf->{PORT}.'/', 'Content-Length' => '0' } ];
-ok($tf->handle_http($t) == 0, 'external redirect should have a Content-Length: 0');
-
$t->{REQUEST} = ( <<EOF
GET /redirect/ HTTP/1.0
Host: zzz.example.org
diff --git a/tests/mod-rewrite.t b/tests/mod-rewrite.t
index 6474f19..31c7d1a 100755
--- a/tests/mod-rewrite.t
+++ b/tests/mod-rewrite.t
@@ -1,32 +1,24 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
use IO::Socket;
-use Test::More tests => 8;
+use Test::More tests => 5;
use LightyTest;
my $tf = LightyTest->new();
my $t;
-my $php_child = -1;
-
-my $phpbin = (defined $ENV{'PHP'} ? $ENV{'PHP'} : '/usr/bin/php-cgi');
+
SKIP: {
- skip "PHP already running on port 1026", 1 if $tf->listening_on(1026);
- skip "no php binary found", 1 unless -x $phpbin;
- ok(-1 != ($php_child = $tf->spawnfcgi($phpbin, 1026)), "Spawning php");
-}
+ skip "no PHP running on port 1026", 5 unless $tf->listening_on(1026);
-SKIP: {
- skip "no PHP running on port 1026", 6 unless $tf->listening_on(1026);
-
- ok($tf->start_proc == 0, "Starting lighttpd") or goto cleanup;
+ ok($tf->start_proc == 0, "Starting lighttpd") or die();
$t->{REQUEST} = ( <<EOF
GET /rewrite/foo HTTP/1.0
@@ -52,27 +44,5 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'bar&a=b' } ];
ok($tf->handle_http($t) == 0, 'valid request');
- $t->{REQUEST} = ( <<EOF
-GET /rewrite/nofile?a=b HTTP/1.0
-Host: www.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'file=/rewrite/nofile&a=b' } ];
- ok($tf->handle_http($t) == 0, 'not existing file rewrite');
-
ok($tf->stop_proc == 0, "Stopping lighttpd");
}
-
-SKIP: {
- skip "PHP not started, cannot stop it", 1 unless $php_child != -1;
- ok(0 == $tf->endspawnfcgi($php_child), "Stopping php");
-}
-
-
-exit 0;
-
-cleanup: ;
-
-$tf->endspawnfcgi($php_child) if $php_child != -1;
-
-die();
diff --git a/tests/mod-secdownload.t b/tests/mod-secdownload.t
deleted file mode 100755
index c8cad38..0000000
--- a/tests/mod-secdownload.t
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/env perl
-BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
-}
-
-use strict;
-use IO::Socket;
-use Test::More tests => 7;
-use LightyTest;
-use Digest::MD5 qw(md5_hex);
-
-my $tf = LightyTest->new();
-my $t;
-
-ok($tf->start_proc == 0, "Starting lighttpd") or die();
-
-my $secret = "verysecret";
-my $f = "/index.html";
-my $thex = sprintf("%08x", time);
-my $m = md5_hex($secret.$f.$thex);
-
-$t->{REQUEST} = ( <<EOF
-GET /sec/$m/$thex$f HTTP/1.0
-Host: vvv.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-
-ok($tf->handle_http($t) == 0, 'secdownload');
-
-$thex = sprintf("%08x", time - 1800);
-$m = md5_hex($secret.$f.$thex);
-
-$t->{REQUEST} = ( <<EOF
-GET /sec/$m/$thex$f HTTP/1.0
-Host: vvv.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 410 } ];
-
-ok($tf->handle_http($t) == 0, 'secdownload - gone (timeout)');
-
-$t->{REQUEST} = ( <<EOF
-GET /sec$f HTTP/1.0
-Host: vvv.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
-
-ok($tf->handle_http($t) == 0, 'secdownload - direct access');
-
-$t->{REQUEST} = ( <<EOF
-GET $f HTTP/1.0
-Host: www.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-
-ok($tf->handle_http($t) == 0, 'secdownload - conditional access');
-
-
-$f = "/noexists";
-$thex = sprintf("%08x", time);
-$m = md5_hex($secret.$f.$thex);
-
-$t->{REQUEST} = ( <<EOF
-GET /sec/$m/$thex$f HTTP/1.0
-Host: vvv.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
-
-ok($tf->handle_http($t) == 0, 'secdownload - timeout');
-
-ok($tf->stop_proc == 0, "Stopping lighttpd");
-
diff --git a/tests/mod-setenv.t b/tests/mod-setenv.t
index 1e56301..1eb32a1 100755
--- a/tests/mod-setenv.t
+++ b/tests/mod-setenv.t
@@ -1,9 +1,10 @@
#!/usr/bin/env perl
+
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
@@ -13,7 +14,7 @@ use LightyTest;
my $tf = LightyTest->new();
my $t;
-
+
ok($tf->start_proc == 0, "Starting lighttpd") or die();
$t->{REQUEST} = ( <<EOF
diff --git a/tests/mod-ssi.t b/tests/mod-ssi.t
index d5d69db..8bc88cc 100755
--- a/tests/mod-ssi.t
+++ b/tests/mod-ssi.t
@@ -1,9 +1,9 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
@@ -13,7 +13,7 @@ use LightyTest;
my $tf = LightyTest->new();
my $t;
-
+
ok($tf->start_proc == 0, "Starting lighttpd") or die();
# mod-cgi
diff --git a/tests/mod-userdir.t b/tests/mod-userdir.t
index 40f55ef..30d546a 100755
--- a/tests/mod-userdir.t
+++ b/tests/mod-userdir.t
@@ -1,9 +1,9 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
@@ -13,7 +13,7 @@ use LightyTest;
my $tf = LightyTest->new();
my $t;
-
+
ok($tf->start_proc == 0, "Starting lighttpd") or die();
# get current user
diff --git a/tests/prepare.sh b/tests/prepare.sh
index 99fc382..71816d1 100755
--- a/tests/prepare.sh
+++ b/tests/prepare.sh
@@ -42,8 +42,7 @@ cp $srcdir/var-include-sub.conf $tmpdir/../
touch $tmpdir/servers/www.example.org/pages/image.jpg \
$tmpdir/servers/www.example.org/pages/image.JPG \
$tmpdir/servers/www.example.org/pages/Foo.txt \
- $tmpdir/servers/www.example.org/pages/a \
- $tmpdir/servers/www.example.org/pages/index.html~
+ $tmpdir/servers/www.example.org/pages/a
echo "12345" > $tmpdir/servers/www.example.org/pages/range.pdf
printf "%-40s" "preparing infrastructure"
diff --git a/tests/proxy.conf b/tests/proxy.conf
deleted file mode 100644
index 2e959ac..0000000
--- a/tests/proxy.conf
+++ /dev/null
@@ -1,157 +0,0 @@
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
-
-## bind to port (default: 80)
-server.port = 2050
-
-## bind to localhost (default: all interfaces)
-server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
-server.name = "www.example.org"
-server.tag = "Proxy"
-
-server.dir-listing = "enable"
-
-#server.event-handler = "linux-sysepoll"
-#server.event-handler = "linux-rtsig"
-
-#server.modules.path = ""
-server.modules = (
- "mod_rewrite",
- "mod_setenv",
- "mod_access",
- "mod_auth",
-# "mod_httptls",
- "mod_status",
- "mod_expire",
- "mod_simple_vhost",
- "mod_redirect",
-# "mod_evhost",
-# "mod_localizer",
- "mod_fastcgi",
- "mod_proxy",
- "mod_cgi",
- "mod_compress",
- "mod_userdir",
- "mod_accesslog" )
-
-server.indexfiles = ( "index.php", "index.html",
- "index.htm", "default.htm" )
-
-
-######################## MODULE CONFIG ############################
-
-
-accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
-
-mimetype.assign = ( ".png" => "image/png",
- ".jpg" => "image/jpeg",
- ".jpeg" => "image/jpeg",
- ".gif" => "image/gif",
- ".html" => "text/html",
- ".htm" => "text/html",
- ".pdf" => "application/pdf",
- ".swf" => "application/x-shockwave-flash",
- ".spl" => "application/futuresplash",
- ".txt" => "text/plain",
- ".tar.gz" => "application/x-tgz",
- ".tgz" => "application/x-tgz",
- ".gz" => "application/x-gzip",
- ".c" => "text/plain",
- ".conf" => "text/plain" )
-
-compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
-compress.filetype = ("text/plain", "text/html")
-
-setenv.add-environment = ( "TRAC_ENV" => "foo")
-setenv.add-request-header = ( "FOO" => "foo")
-setenv.add-response-header = ( "BAR" => "foo")
-
-proxy.debug = 1
-proxy.server = ( "" => (
- "grisu" => (
- "host" => "127.0.0.1",
- "port" => 2048,
- )
- )
- )
-
-
-cgi.assign = ( ".pl" => "/usr/bin/perl",
- ".cgi" => "/usr/bin/perl",
- ".py" => "/usr/bin/python" )
-
-userdir.include-user = ( "jan" )
-userdir.path = "/"
-
-ssl.engine = "disable"
-# ssl.pemfile = "server.pem"
-
-auth.backend = "plain"
-auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
-auth.backend.plain.groupfile = "lighttpd.group"
-
-auth.backend.ldap.hostname = "localhost"
-auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
-auth.backend.ldap.filter = "(uid=$)"
-
-auth.require = ( "/server-status" =>
- (
- "method" => "digest",
- "realm" => "download archiv",
-# "require" => ("group=www", "user=jan", "host=192.168.2.10")
- "require" => "group=www|user=jan|host=192.168.2.10"
- ),
- "/auth.php" =>
- (
- "method" => "basic",
- "realm" => "download archiv",
-# "require" => ("group=www", "user=jan", "host=192.168.2.10")
- "require" => "user=jan"
- ),
- "/server-config" =>
- (
- "method" => "basic",
- "realm" => "download archiv",
-# "require" => ("group=www", "user=jan", "user=weigon", "host=192.168.2.10")
- "require" => "group=www|user=jan|host=192.168.2.10"
- )
- )
-
-url.access-deny = ( "~", ".inc")
-
-url.redirect = ( "^/redirect/$" => "http://localhost:2048/" )
-
-url.rewrite = ( "^/rewrite/foo($|\?.+)" => "/indexfile/rewrite.php$1",
- "^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1",
- "^/rewrite/all(/.*)$" => "/indexfile/rewrite.php?$1" )
-
-expire.url = ( "/expire/access" => "access 2 hours",
- "/expire/modification" => "access plus 1 seconds 2 minutes")
-
-#cache.cache-dir = "/home/weigon/wwwroot/cache/"
-
-#### status module
-status.status-url = "/server-status"
-status.config-url = "/server-config"
-
-$HTTP["host"] == "vvv.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
-}
-
-$HTTP["host"] == "zzz.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- server.name = "zzz.example.org"
-}
-
-$HTTP["host"] == "no-simple.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/123.example.org/pages/"
- server.name = "zzz.example.org"
-}
-
-$HTTP["host"] !~ "(no-simple\.example\.org)" {
- simple-vhost.document-root = "pages"
- simple-vhost.server-root = env.SRCDIR + "/tmp/lighttpd/servers/"
- simple-vhost.default-host = "www.example.org"
-}
-
diff --git a/tests/request.t b/tests/request.t
index c4bd958..4049013 100755
--- a/tests/request.t
+++ b/tests/request.t
@@ -1,19 +1,19 @@
#!/usr/bin/env perl
BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
}
use strict;
use IO::Socket;
-use Test::More tests => 46;
+use Test::More tests => 29;
use LightyTest;
my $tf = LightyTest->new();
my $t;
-
+
ok($tf->start_proc == 0, "Starting lighttpd") or die();
## Basic Request-Handling
@@ -89,21 +89,6 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '-HTTP
ok($tf->handle_http($t) == 0, 'HEAD request, mimetype text/html, content-length');
$t->{REQUEST} = ( <<EOF
-HEAD http://123.example.org/12345.html HTTP/1.1
-Connection: close
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, '-HTTP-Content' => '', 'Content-Type' => 'text/html', 'Content-Length' => '6'} ];
-ok($tf->handle_http($t) == 0, 'Hostname in first line, HTTP/1.1');
-
-$t->{REQUEST} = ( <<EOF
-HEAD https://123.example.org/12345.html HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '-HTTP-Content' => '', 'Content-Type' => 'text/html', 'Content-Length' => '6'} ];
-ok($tf->handle_http($t) == 0, 'Hostname in first line as https url');
-
-$t->{REQUEST} = ( <<EOF
HEAD /foobar?foobar HTTP/1.0
EOF
);
@@ -116,7 +101,7 @@ Connection: close
Expect: 100-continue
EOF
);
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 417 } ];
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 417, '-HTTP-Content' => ''} ];
ok($tf->handle_http($t) == 0, 'Continue, Expect');
## ranges
@@ -295,7 +280,7 @@ If-None-Match: 5
If-None-Match: 4
EOF
);
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
ok($tf->handle_http($t) == 0, 'Duplicate If-None-Match headers');
$t->{REQUEST} = ( <<EOF
@@ -315,119 +300,7 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'GET, Range with range-requests-disabled');
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Content-Length: 4
-
-1234
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'GET with Content-Length');
-
-$t->{REQUEST} = ( <<EOF
-OPTIONS / HTTP/1.0
-Content-Length: 4
-
-1234
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'OPTIONS with Content-Length');
-
-$t->{REQUEST} = ( <<EOF
-OPTIONS rtsp://221.192.134.146:80 RTSP/1.1
-Host: 221.192.134.146:80
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'OPTIONS for RTSP');
-
-$t->{REQUEST} = ( <<EOF
-HEAD / HTTP/1.0
-Content-Length: 4
-
-1234
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'HEAD with Content-Length');
-$t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-If-Modified-Since: Sun, 01 Jan 2036 00:00:02 GMT
-If-Modified-Since: Sun, 01 Jan 2036 00:00:02 GMT
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
-ok($tf->handle_http($t) == 0, 'Duplicate If-Mod-Since, with equal timestamps');
-
-$t->{REQUEST} = ( "GET / HTTP/1.0\r\nIf-Modified-Since: \0\r\n\r\n" );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'invalid chars in Header values (bug #1286)');
-
-$t->{REQUEST} = ( "GET / HTTP/1.0\r\nIf-Modified-Since: \r\n\r\n" );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'empty If-Modified-Since');
-
-$t->{REQUEST} = ( "GET / HTTP/1.0\r\nIf-Modified-Since: foobar\r\n\r\n" );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'broken If-Modified-Since');
-
-$t->{REQUEST} = ( "GET / HTTP/1.0\r\nIf-Modified-Since: this string is too long to be a valid timestamp\r\n\r\n" );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'broken If-Modified-Since');
-
-
-$t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-If-Modified-Since2: Sun, 01 Jan 2036 00:00:03 GMT
-If-Modified-Since: Sun, 01 Jan 2036 00:00:02 GMT
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
-ok($tf->handle_http($t) == 0, 'Similar Headers (bug #1287)');
-
-$t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-If-Modified-Since: Sun, 01 Jan 2036 00:00:02 GMT
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304, 'Content-Type' => 'text/html' } ];
-ok($tf->handle_http($t) == 0, 'If-Modified-Since');
-
-$t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-If-Modified-Since: Sun, 01 Jan 2036 00:00:02 GMT
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304, '-Content-Length' => '' } ];
-ok($tf->handle_http($t) == 0, 'Status 304 has no Content-Length (#1002)');
-
-$t->{REQUEST} = ( <<EOF
-GET /12345.txt HTTP/1.0
-Host: 123.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'."\n", 'Content-Type' => 'text/plain' } ];
-$t->{SLOWREQUEST} = 1;
-ok($tf->handle_http($t) == 0, 'GET, slow \\r\\n\\r\\n (#2105)');
-
-print "\nPathinfo for static files\n";
-$t->{REQUEST} = ( <<EOF
-GET /image.jpg/index.php HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Type' => 'image/jpeg' } ];
-ok($tf->handle_http($t) == 0, 'static file accepting pathinfo by default');
-
-$t->{REQUEST} = ( <<EOF
-GET /image.jpg/index.php HTTP/1.0
-Host: zzz.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
-ok($tf->handle_http($t) == 0, 'static file with forbidden pathinfo');
ok($tf->stop_proc == 0, "Stopping lighttpd");
diff --git a/tests/run-tests.pl b/tests/run-tests.pl
index 6136eac..44e76a9 100755
--- a/tests/run-tests.pl
+++ b/tests/run-tests.pl
@@ -2,19 +2,18 @@
use strict;
-use Test::Harness qw(&runtests $verbose);
-$verbose = (defined $ENV{'VERBOSE'} ? $ENV{'VERBOSE'} : 0);
-my $tests = (defined $ENV{'RUNTESTS'} ? $ENV{'RUNTESTS'} : '');
+use Test::Harness qw(&runtests $verbose);
+$verbose=0;
my $srcdir = (defined $ENV{'srcdir'} ? $ENV{'srcdir'} : '.');
opendir DIR, $srcdir;
my (@fs, $f);
while ($f = readdir(DIR)) {
- if ($f =~ /^(.*)\.t$/) {
- next if ($tests ne '' and $tests !~ /(^|\s+)$1(\s+|$)/);
+ if ($f =~ /\.t$/) {
push @fs, $srcdir.'/'.$f;
}
}
closedir DIR;
-runtests (sort @fs);
+runtests @fs;
+
diff --git a/tests/symlink.t b/tests/symlink.t
deleted file mode 100755
index 9b275bd..0000000
--- a/tests/symlink.t
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/usr/bin/env perl
-BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
-}
-
-use strict;
-use IO::Socket;
-use Test::More tests => 10;
-use LightyTest;
-
-my $tf = LightyTest->new();
-my $t;
-my $docroot = $tf->{'TESTDIR'}."/tmp/lighttpd/servers/www.example.org/pages";
-
-sub init_testbed {
- return 0 unless eval { symlink("",""); 1 };
- my $f = "$docroot/index.html";
- my $l = "$docroot/index.xhtml";
- my $rc = undef;
- unless (-l $l) {
- return 0 unless symlink($f,$l);
- };
- $f = "$docroot/expire";
- $l = "$docroot/symlinked";
- $rc = undef;
- unless (-l $l) {
- return 0 unless symlink($f,$l);
- }
- return 1;
-};
-
-SKIP: {
- skip "perl does not support symlinking or setting up the symlinks failed.", 10 unless init_testbed;
- ok($tf->start_proc == 0, "Starting lighttpd") or die();
-
-# allow case
-# simple file
- $t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-Host: symlink.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
- ok($tf->handle_http($t) == 0, 'allow: simple file');
-
-# symlinked file
- $t->{REQUEST} = ( <<EOF
-GET /index.xhtml HTTP/1.0
-Host: symlink.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
- ok($tf->handle_http($t) == 0, 'allow: symlinked file');
-
-# directly symlinked dir
- $t->{REQUEST} = ( <<EOF
-GET /symlinked/ HTTP/1.0
-Host: symlink.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
- ok($tf->handle_http($t) == 0, 'allow: directly symlinked dir');
-
-# symlinked dir in path
- $t->{REQUEST} = ( <<EOF
-GET /symlinked/access.txt HTTP/1.0
-Host: symlink.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
- ok($tf->handle_http($t) == 0, 'allow: symlinked dir in path');
-
-# deny case
-# simple file
- $t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-Host: nosymlink.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
- ok($tf->handle_http($t) == 0, 'deny: simple file');
-
-# symlinked file
- $t->{REQUEST} = ( <<EOF
-GET /index.xhtml HTTP/1.0
-Host: nosymlink.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
- ok($tf->handle_http($t) == 0, 'deny: symlinked file');
-
-# directly symlinked dir
- $t->{REQUEST} = ( <<EOF
-GET /symlinked/ HTTP/1.0
-Host: nosymlink.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
- ok($tf->handle_http($t) == 0, 'deny: directly symlinked dir');
-
-# symlinked dir in path
- $t->{REQUEST} = ( <<EOF
-GET /symlinked/access.txt HTTP/1.0
-Host: nosymlink.example.org
-EOF
- );
- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
- ok($tf->handle_http($t) == 0, 'deny: symlinked dir in path');
-
-# cleanup
- ok($tf->stop_proc == 0, "Stopping lighttpd");
-};
diff --git a/tests/var-include.conf b/tests/var-include.conf
index 04b8271..00595ba 100644
--- a/tests/var-include.conf
+++ b/tests/var-include.conf
@@ -2,38 +2,38 @@
debug.log-request-handling = "enable"
debug.log-condition-handling = "enable"
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
+server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid"
## bind to port (default: 80)
server.port = 2048
## bind to localhost (default: all interfaces)
server.bind = "localhost"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log"
server.name = "www.example.org"
server.tag = "Apache 1.3.29"
server.modules = ( "mod_redirect",
- "mod_accesslog" )
+ "mod_accesslog" )
######################## MODULE CONFIG ############################
-accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
+accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log"
mimetype.assign = ( ".html" => "text/html" )
url.redirect = ("^" => "/default")
$HTTP["host"] == "www.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "www.example.org"
url.redirect = ("^" => "/redirect")
}
$HTTP["host"] == "test.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
+ server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "test.example.org"
var.myvar = "good"
var.one = 1
diff --git a/tests/wrapper.sh b/tests/wrapper.sh
index 571594c..5ba80ed 100755
--- a/tests/wrapper.sh
+++ b/tests/wrapper.sh
@@ -2,8 +2,8 @@
## get some parameters from the makefile
-srcdir=$1
-top_builddir=$2
-export SHELL srcdir top_builddir
+export srcdir=$1
+export top_builddir=$2
+export SHELL
-exec $3
+$3