diff --git a/Doc/Makefile.in b/Doc/Makefile.in index 705fe433..2bac29fd 100644 --- a/Doc/Makefile.in +++ b/Doc/Makefile.in @@ -109,6 +109,9 @@ clean: -rm -rf tools/jinja2 -rm -rf tools/docutils +distclean: clean + rm -f Makefile + dist: rm -rf dist mkdir -p dist diff --git a/Doc/commandline.rst b/Doc/commandline.rst index e2a31ca0..7b44ab3b 100644 --- a/Doc/commandline.rst +++ b/Doc/commandline.rst @@ -122,13 +122,10 @@ WSGI application which is located in ``/path/to/myapp`` and defined in The above example will create a Python-based configuration in ``/path/to/new/server_root/conf/http_conf.py`` which is a simple -Pythong script. When executed, the output of the script becomes an +Python script. When executed, the output of the script becomes an Apache configuration (``create`` will take care of generating the -first Apache config for you). +first Apache config for you). You should be able to run this Apache instance by executing:: mod_python start /path/to/new/server_root/conf/httpd.conf - - - diff --git a/Doc/conf.py b/Doc/conf.py index f3a3c408..0176928e 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -26,8 +26,10 @@ # release = '2.6a0' # version -import commands -v, r = commands.getoutput("../dist/version.sh").rsplit('.', 1) +import subprocess +v, r = subprocess.check_output( + os.path.dirname(__file__) + "/../dist/version.sh", encoding='ASCII' +).rsplit('.', 1) version, release = v, v+'.'+r # Ignore .rst in Sphinx its self. @@ -55,11 +57,6 @@ # typographically correct entities. html_use_smartypants = True -# Custom sidebar templates, filenames relative to this file. -html_sidebars = { - 'index': 'indexsidebar.html', -} - # Output file base name for HTML help builder. htmlhelp_basename = 'mod_python' + release.replace('.', '') diff --git a/Doc/copyright.rst b/Doc/copyright.rst index f770901c..ce3cb009 100644 --- a/Doc/copyright.rst +++ b/Doc/copyright.rst @@ -4,7 +4,7 @@ Copyright Mod_python and this documentation is: -Copyright © 2000, 2001, 2013 Gregory Trubetskoy +Copyright © 2000, 2001, 2013, 2024 Gregory Trubetskoy Copyright © 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation diff --git a/Doc/contents.rst b/Doc/index.rst similarity index 100% rename from Doc/contents.rst rename to Doc/index.rst diff --git a/Doc/pythonapi.rst b/Doc/pythonapi.rst index 61d78f20..5eb051e0 100644 --- a/Doc/pythonapi.rst +++ b/Doc/pythonapi.rst @@ -145,6 +145,7 @@ Every handler can return: HTTP_UNSUPPORTED_MEDIA_TYPE = 415 HTTP_RANGE_NOT_SATISFIABLE = 416 HTTP_EXPECTATION_FAILED = 417 + HTTP_IM_A_TEAPOT = 418 HTTP_UNPROCESSABLE_ENTITY = 422 HTTP_LOCKED = 423 HTTP_FAILED_DEPENDENCY = 424 diff --git a/Doc/ssi.rst b/Doc/ssi.rst index cd265c76..e2ce2653 100644 --- a/Doc/ssi.rst +++ b/Doc/ssi.rst @@ -93,9 +93,9 @@ Global data constitutes variables as well as module imports, function and class definitions.:: @@ -149,10 +149,10 @@ within the page.:: from mod_python import apache - import cgi, time + import html, time def _escape(object): - return cgi.escape(str(object)) + return html.escape(str(object)) def _header(filter): print >> filter, '...' diff --git a/Makefile.in b/Makefile.in index df6afa4d..8e08617b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -61,7 +61,7 @@ install_dso: dso @echo "Performing DSO installation." @echo $(INSTALL) -d $(DESTDIR)$(LIBEXECDIR) - $(INSTALL) src/mod_python.so $(DESTDIR)$(LIBEXECDIR) + $(INSTALL) -m 0644 src/mod_python.so $(DESTDIR)$(LIBEXECDIR) install_py_lib: cd dist && $(MAKE) install_py_lib @@ -80,7 +80,7 @@ distclean: clean cd scripts && $(MAKE) distclean cd test && $(MAKE) distclean rm -rf Makefile config.h config.status config.cache config.log \ - test/testconf.py + test/testconf.py test: @ALL@ cd test && $(MAKE) test diff --git a/NEWS b/NEWS index 198fa665..797dc0e1 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,20 @@ +Jan 23 2026 - 3.5.0.7 32-bit compile fix + +Dec 30 2025 - 3.5.0.6 Fix publisher query string bug + +Nov 8 2025 - 3.5.0.5 Compatibility with Python 3.13 and 3.14. + +Sep 5 2024 - 3.5.0.4 fix sys.version bug and quiet compiler warnings. + +May 7 2024 - 3.5.0.3 release tagged, it addresses test failures and + restores 2.7 compatibility. + +Feb 25 2024 - 3.5.0.2 released. Address the deprecation of the imp module in + Python 3.12. + +Aug 18 2023 - 3.5.0.1 released. It addresses compatibility issues with + Python 3.11. + Nov 13 2013 - 3.5.0 released Oct 22 2013 - 3.4.1 released @@ -12,47 +29,47 @@ July 19 2006 - 3.2.10 is being tagged from branches/3.2.x July 19 2006 - The public release of 3.2.9 is being abandoned due to some recently reported memory leaks. Although 3.2.9 is ready for - release, it is felt that it is prudent to address these now - and proceed immediately to 3.2.10. See MODPYTHON-172 for - on the specific details on the issues. + release, it is felt that it is prudent to address these now + and proceed immediately to 3.2.10. See MODPYTHON-172 for + on the specific details on the issues. -June 29 2006 - 3.2.9 is being tagged from branches/3.2.x +June 29 2006 - 3.2.9 is being tagged from branches/3.2.x -Feb 19 2006 - 3.2.8 is being tagged from branches/3.2.x +Feb 19 2006 - 3.2.8 is being tagged from branches/3.2.x 3.2.8 is a security release to fix the possible - directory traversal attack in FileSession. + directory traversal attack in FileSession. Feb 9 2006 - Created 3.2.x stable bugfix branch in svn as branches/3.2.x -Feb 3 2006 - 3.2.7 is being tagged +Feb 3 2006 - 3.2.7 is being tagged -Jan 16 2006 - 3.2.6 final is being tagged (no changes from 3.2.6b) +Jan 16 2006 - 3.2.6 final is being tagged (no changes from 3.2.6b) -Jan 14 2006 - 3.2.6b is being tagged +Jan 14 2006 - 3.2.6b is being tagged -Nov 15 2005 - 3.2.5b is being tagged +Nov 15 2005 - 3.2.5b is being tagged -Oct 28 2005 - 3.2.4b is being tagged +Oct 28 2005 - 3.2.4b is being tagged -Oct 22 2005 - 3.2.3b is being tagged +Oct 22 2005 - 3.2.3b is being tagged -Sep 13 2005 - 3.2.2b is being tagged +Sep 13 2005 - 3.2.2b is being tagged -Sep 6 2005 - 3.2.1b is being tagged +Sep 6 2005 - 3.2.1b is being tagged Aug 16 2005 - 3.2.0b is being tagged -Feb 17 2004 - 3.1.3 is being tagged +Feb 17 2004 - 3.1.3 is being tagged -Oct 14 2003 - 3.1.1b is tagged +Oct 14 2003 - 3.1.1b is tagged -Aug 29 2003 - 3.1.0a (Alpha) is out +Aug 29 2003 - 3.1.0a (Alpha) is out -Mar 17 2003 - 3.0.3 is released +Mar 17 2003 - 3.0.3 is released - This file will no longer have details, since those - are in CVS anyway. + This file will no longer have details, since those + are in CVS anyway. Feb 12 2003 - Added a test for req.headers_out @@ -91,170 +108,170 @@ Nov 26 2002 - 3.0.1 is about to be released. This was file has not been updated during the 3.0 development because of too many things changing. -Nov 28 2001 - Now compiles against Apache 2.0.28 +Nov 28 2001 - Now compiles against Apache 2.0.28 -Nov 6 2001 - More internal changes. Bugs from previous change, cleaner - reference keeping. +Nov 6 2001 - More internal changes. Bugs from previous change, cleaner + reference keeping. -Nov 1 2001 - Many internal changes. We no longer use req->notes for things - that shouldn't be there, handler directives can be restricted - to specific file extensions thereby allowing multiple handlers - per directory, etc. The config is now stored in a new hlist - object, which can be accessed from python via an hlistobject. +Nov 1 2001 - Many internal changes. We no longer use req->notes for things + that shouldn't be there, handler directives can be restricted + to specific file extensions thereby allowing multiple handlers + per directory, etc. The config is now stored in a new hlist + object, which can be accessed from python via an hlistobject. Aug 16 2001 - Mod_python is compiling and running with Apache 2.0 and the - filter functionality seems to work. There is still a lot of - work to be done though. + filter functionality seems to work. There is still a lot of + work to be done though. Aug 4 2001 - 2.7.6 released. Sometime prior a publisher upload bug was fixed. -Jun 11 2001 - 2.7.5 released for those who want Python 2.1 +Jun 11 2001 - 2.7.5 released for those who want Python 2.1 -Jun 11 2001 - Changed configure.in to accomodate Python 2.1. It looks like - everything else works without any changes. +Jun 11 2001 - Changed configure.in to accomodate Python 2.1. It looks like + everything else works without any changes. -Jun 4 2001 - 2.7.4 released. +Jun 4 2001 - 2.7.4 released. -May 28 2001 - Renamed make_table, log_error, table_add and copy_table with - mp_ so as to not get confused with the ones in ap_compat.h +May 28 2001 - Renamed make_table, log_error, table_add and copy_table with + mp_ so as to not get confused with the ones in ap_compat.h -May 24 2001 - PythonNoReload obsoleted in favor of PythonAutoReload. +May 24 2001 - PythonNoReload obsoleted in favor of PythonAutoReload. -May 23 2001 - The "fix" re import on Apr 10 turned out to be a bug and - I put it back. But in the process found that the FLAG directives - were not read correctly - e.g. mere presence sometimes indicated - On. Also, ReportError was returning DONE in finally clause which - was wrong. +May 23 2001 - The "fix" re import on Apr 10 turned out to be a bug and + I put it back. But in the process found that the FLAG directives + were not read correctly - e.g. mere presence sometimes indicated + On. Also, ReportError was returning DONE in finally clause which + was wrong. May 22 2001 - The bug that was supposedly fixed below was a bit more - complicated than it seemed at first. The fix below caused - a circular reference, and some further fixing had to be done, - and now it's really fixed, thanks to Chris's dilligence. + complicated than it seemed at first. The fix below caused + a circular reference, and some further fixing had to be done, + and now it's really fixed, thanks to Chris's dilligence. -May 17 2001 - Fixed a threading bug reported by Chris Trengove where - the callback object could have the reference to self.req - overwritten by other threads. The reference to the Request - object is now stored inside the requestobject C structure. +May 17 2001 - Fixed a threading bug reported by Chris Trengove where + the callback object could have the reference to self.req + overwritten by other threads. The reference to the Request + object is now stored inside the requestobject C structure. -May 12 2001 - 2.7.3 released +May 12 2001 - 2.7.3 released -Apr 10 2001 - Fixed a PythonImport bug reported by Chris Hagner. Removed - the atol hack as per Miguel Marques patch. Fixed apache.py - to use a messier looking but for some obscure reason that - now escapes me necessary way of importing modules via imp. +Apr 10 2001 - Fixed a PythonImport bug reported by Chris Hagner. Removed + the atol hack as per Miguel Marques patch. Fixed apache.py + to use a messier looking but for some obscure reason that + now escapes me necessary way of importing modules via imp. Apr 7 2001 - "Dissapearing args" on Solaris fixed. It was a problem - in parse_qsl. + in parse_qsl. Apr 6 2001 - Missing _eprintf() on Solaris/gcc workaround added. I - wonder if this applies to other OS's? + wonder if this applies to other OS's? -Apr 5 2001 - A couple doc fixes. +Apr 5 2001 - A couple doc fixes. -Feb 10 2001 - 2.7.2 released +Feb 10 2001 - 2.7.2 released Feb 10 2001 - Fixed the dissapearing / in PATH_INFO. -Jan 23 2001 - Fixed the bug where req.server.register_cleanup was - expecting a builtin _req object rather than the new real - Python Request. +Jan 23 2001 - Fixed the bug where req.server.register_cleanup was + expecting a builtin _req object rather than the new real + Python Request. -Jan 21 2001 - The Publisher handler __auth__ can now be a dictionary or. - a const. There is also new __access__, which can be a list. +Jan 21 2001 - The Publisher handler __auth__ can now be a dictionary or. + a const. There is also new __access__, which can be a list. -Jan 19 2001 - Added req._content_type_set flag which is set to 1 when - a value is assigned to content_type from Python. This way - the publisher handler can know if it's been purposely set - and will not attempt to guess it. +Jan 19 2001 - Added req._content_type_set flag which is set to 1 when + a value is assigned to content_type from Python. This way + the publisher handler can know if it's been purposely set + and will not attempt to guess it. -Jan 18 2001 - Documented req.form. Fixed a security problem with the - Publisher handler - it now does not allow modules to be - published, so a user can't access test.os.renames, etc. +Jan 18 2001 - Documented req.form. Fixed a security problem with the + Publisher handler - it now does not allow modules to be + published, so a user can't access test.os.renames, etc. -Dec 18 2000 - 2.7 had a typo in it + win32 wants types initialized - separately like I thought. Time for 2.7.1. +Dec 18 2000 - 2.7 had a typo in it + win32 wants types initialized + separately like I thought. Time for 2.7.1. -Dec 16 2000 - Releasing 2.7.... +Dec 16 2000 - Releasing 2.7.... Dec 16 2000 - Found another bug related to ALLOW_THREADS macros which are - noops without threads, but that is actually wrong, because - what they is needed wvwn without threads. Also, some days - ago 2.6.4 was released. + noops without threads, but that is actually wrong, because + what they is needed wvwn without threads. Also, some days + ago 2.6.4 was released. -Dec 13 2000 - The initial documentation for the util module and for the - publisher handler is done. Perhaps the tutorial should have - a bit on the publisher handler. +Dec 13 2000 - The initial documentation for the util module and for the + publisher handler is done. Perhaps the tutorial should have + a bit on the publisher handler. -Dec 12 2000 - publisher handler appears to be working pretty well. Now need - to document it. +Dec 12 2000 - publisher handler appears to be working pretty well. Now need + to document it. -Dec 11 2000 - It appears I found a big booboo with mispalced #ifdef - WITH_THREADS... The "Dispatch returned nothing" should be - gone now. This means 2.6.3 has major problems with multiple - interpreters. +Dec 11 2000 - It appears I found a big booboo with mispalced #ifdef + WITH_THREADS... The "Dispatch returned nothing" should be + gone now. This means 2.6.3 has major problems with multiple + interpreters. Dec 8 2000 - connection.user now writable. More Doc improvements. -Dec 6 2000 - The COPYRIGHT no longer has the advertizing clause. +Dec 6 2000 - The COPYRIGHT no longer has the advertizing clause. -Dec 4 2000 - Initial (not proof-read) LaTeX source for documentation is - checked in. +Dec 4 2000 - Initial (not proof-read) LaTeX source for documentation is + checked in. -Nov 26 2000 - Dilligently migrating all the documentation to LaTeX using the - Python standards. +Nov 26 2000 - Dilligently migrating all the documentation to LaTeX using the + Python standards. -Nov 17 2000 - I forgot to uncomment type initialization. type(req.headers_in) - would segfault. Fixed. Continuing work on publisher.py module. +Nov 17 2000 - I forgot to uncomment type initialization. type(req.headers_in) + would segfault. Fixed. Continuing work on publisher.py module. -Nov 08 2000 - read() and reqadline() now behave very much like the standard - Python file object counterparts. Added James Gessling's VMS - instructions. +Nov 08 2000 - read() and reqadline() now behave very much like the standard + Python file object counterparts. Added James Gessling's VMS + instructions. -Nov 07 2000 - Initial version of req.readline(), also some fixes to - req.read() (both now raise appropriate errors). Both still need - some work. +Nov 07 2000 - Initial version of req.readline(), also some fixes to + req.read() (both now raise appropriate errors). Both still need + some work. -Nov 04 2000 - Implemented _apache.parse_qs. Also, CGIStin had a read() bug. - PythonHandlerModule is documented. +Nov 04 2000 - Implemented _apache.parse_qs. Also, CGIStin had a read() bug. + PythonHandlerModule is documented. -Oct 30 2000 - Implemented PythonHandlerModule. Still need to document it. +Oct 30 2000 - Implemented PythonHandlerModule. Still need to document it. -Oct 29 2000 - 2.6.3 release. Mostly static install bug fixes. +Oct 29 2000 - 2.6.3 release. Mostly static install bug fixes. Oct 22 2000 - 2.6.2 release Oct 22 2000 - "Fatal Python error: PyThreadState_Get: no current thread" upon - exit is now fixed. Also, --with-python was improved to point - to the right Makefile (Modules/Makefile) when scanning for LIBS. + exit is now fixed. Also, --with-python was improved to point + to the right Makefile (Modules/Makefile) when scanning for LIBS. Oct 21 2000 - 2.6.1 release -Oct 20 2000 - Fixed some minor installation bugs. +Oct 20 2000 - Fixed some minor installation bugs. Oct 19 2000 - 2.6 out -Oct 16 2000 - Began a major file reorganization. All objects are now in - separate files, and all external functions have an Mp prefix - and named consistently with Python C API conventions. +Oct 16 2000 - Began a major file reorganization. All objects are now in + separate files, and all external functions have an Mp prefix + and named consistently with Python C API conventions. -Oct 15 2000 - We now use mkdep. +Oct 15 2000 - We now use mkdep. Oct 12 2000 - Autoconf now works. Documentation has been adjusted. Also - added Windows installation instructions to the docs. + added Windows installation instructions to the docs. Oct 2 2000 - PythonInterpPerServer is now default behavior, and this - directive is therefore obsolete. The old default behavior can - be achieved via the new PythonInterpPerDirective directive. + directive is therefore obsolete. The old default behavior can + be achieved via the new PythonInterpPerDirective directive. Sep ? 2000 - Request is now a real python object. This means that it can be - used to retain state between requests. + used to retain state between requests. Sep 9 2000 - Added server.register_cleanup(). This happened to be a little - trickier than I thought since it turned out that server_rec does - not have a pool member. Py_Finalze() has been moved to a - cleanup from the ChildExit handler because ChildExit runs *before* - any cleanups. (Now I know why mod_perl doesn't use child_exit.) + trickier than I thought since it turned out that server_rec does + not have a pool member. Py_Finalze() has been moved to a + cleanup from the ChildExit handler because ChildExit runs *before* + any cleanups. (Now I know why mod_perl doesn't use child_exit.) Sep 8 2000 - Sean True's fix to call note_basic_auth_failure added. @@ -265,38 +282,38 @@ Sep 5 2000 - 2.5 released. Sep 4 2000 - Added the PythonCleanupHandler. Sep 4 2000 - Added req.register_cleanup(). Still need server.register_cleanup(), - as well as a PythonCleanupHandler. + as well as a PythonCleanupHandler. Sep 2 2000 - Added PythonInterpPerServer directive. Fixed a bug relating - to ap_add_version_component. + to ap_add_version_component. -Aug 28 2000 - Added Richard Barret's patch that gives python socket module - behaviour from req.connection.local_addr and remote_addr. +Aug 28 2000 - Added Richard Barret's patch that gives python socket module + behaviour from req.connection.local_addr and remote_addr. Aug 27 2000 - Added PythonInitHandler. Also, it looks like dynamic handler - addition now works correctly, after trying 15 different ways of - implementing it, resorting to req->notes seems to be the only - option. + addition now works correctly, after trying 15 different ways of + implementing it, resorting to req->notes seems to be the only + option. Aug 18 2000 - Added req.get_remote_host() Aug 16 2000 - Added Dr. Timochouk's PythonOptimize directive patch. Aug 15 2000 - Extensive improvements to req.read() prompted by Dr. Timochouk's - patches. + patches. -Aug 10 2000 - Documentation change - get_basic_auth_pw must be called before - using connection.user. +Aug 10 2000 - Documentation change - get_basic_auth_pw must be called before + using connection.user. Aug 06 2000 - Table oject now has a new method "add" which allows creation - of multiple keys. This is useful with things like "Set-Cookie" - headers. + of multiple keys. This is useful with things like "Set-Cookie" + headers. Jul 22 2000 - Added req.add_handler (dynamic handler registration) Jul 18 2000 - Added PythonEnablePdb - ChildExitHandler now properly calls Py_Finalize() - python_handler is now cumulative rather than overriding + ChildExitHandler now properly calls Py_Finalize() + python_handler is now cumulative rather than overriding Jul 04 2000 - 2.4.1 Released. Mostly bug fixes. Should be pretty stable. @@ -305,16 +322,16 @@ Jun 20 2000 - 2.4 Released. Jun 17 2000 - Started the tutorial.html. Jun 11 2000 - Stephane Bidoul's thread-safe win32 changes put in. As part - of this, all chdir()'s are gone and now instead of '.', the - file path is prepended to pythonpath. + of this, all chdir()'s are gone and now instead of '.', the + file path is prepended to pythonpath. Jun 8 2000 - 2.3 Released. -Jun 7 2000 - PythonImport now works. +Jun 7 2000 - PythonImport now works. -Jun 5 2000 - PythonDebug and other on/off type handlers are now of type FLAG - so they require an argument of On or Off. +Jun 5 2000 - PythonDebug and other on/off type handlers are now of type FLAG + so they require an argument of On or Off. -Apr 2000 - rename to mod_python and go apache-specific. -Nov 1998 - support for multiple interpreters introduced. -May 1998 - initial release (httpdapy). +Apr 2000 - rename to mod_python and go apache-specific. +Nov 1998 - support for multiple interpreters introduced. +May 1998 - initial release (httpdapy). diff --git a/README.md b/README.md index 3a9a9958..adc5f78f 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ mod_python Documentation for mod_python is on http://www.modpython.org/ +Mod_python is going to be maintained on GitHub from here on. For issues and questions +please use GitHub. + Quick Start ----------- @@ -16,22 +19,3 @@ $ make test ``` If the above worked - read the tutorial in the documentation. - -OS Hints --------- - -### Windows: - -HELP NEEDED! I do not have access to a Windows development -environment. If you get a Windows compile working, please create a -pull request or drop a note on the mod_python mailing list: -mod_python@modpython.org (Note: subscription required). - -### Mac OS X/Darwin: - -At least on OS X 10.8.5, the following was required in order for compile to work: - -```shell -sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain \ - /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain -``` diff --git a/configure b/configure index b0beb765..2695f2b3 100755 --- a/configure +++ b/configure @@ -1,18 +1,20 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63. +# Generated by GNU Autoconf 2.69. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 +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 @@ -20,23 +22,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -44,7 +38,13 @@ export as_nl 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 -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# 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 @@ -55,7 +55,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -78,13 +78,6 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi -# 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 @@ -94,15 +87,16 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +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 + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -114,12 +108,16 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# 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 PS1='$ ' PS2='> ' @@ -131,330 +129,343 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# 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'` - # CDPATH. -$as_unset 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 - if (eval ":") 2>/dev/null; then - as_have_required=yes + 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 - as_have_required=no + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +" + 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 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi +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 : -if as_func_ret_success; then - : else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : + 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" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes else - exitcode=1 - echo positional parameters were not saved. + as_have_required=no fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in + as_found=: + case $as_dir in #( /*) for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + # 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 - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -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 - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -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 ;; + 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 - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. +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." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break 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 - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi +## --------------------- ## +## 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 - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi +# 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" -fi -fi +} # 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 -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +# 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 -exitcode=0 -if as_func_success; then - : +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. + as_expr=false fi -if as_func_ret_success; then - : +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. + as_basename=false fi -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname else - exitcode=1 - echo positional parameters were not saved. + as_dirname=false fi -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} - +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'` +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - # 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 after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, 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 - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) + 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/= @@ -471,9 +482,12 @@ test \$exitcode = 0") || { s/-\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 - { (exit 1); exit 1; }; } + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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). @@ -482,29 +496,18 @@ test \$exitcode = 0") || { exit } - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -519,49 +522,29 @@ if (echo >conf$$.file) 2>/dev/null; then # ... 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 -p'. + # 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 -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -569,12 +552,72 @@ 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'" +as_awk_strverscmp=' + # Use only awk features that work with 7th edition Unix awk (1978). + # My, what an old awk you have, Mr. Solaris! + END { + while (length(v1) && length(v2)) { + # Set d1 to be the next thing to compare from v1, and likewise for d2. + # Normally this is a single character, but if v1 and v2 contain digits, + # compare them as integers and fractions as strverscmp does. + if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) { + # Split v1 and v2 into their leading digit string components d1 and d2, + # and advance v1 and v2 past the leading digit strings. + for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue + for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue + d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1) + d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1) + if (d1 ~ /^0/) { + if (d2 ~ /^0/) { + # Compare two fractions. + while (d1 ~ /^0/ && d2 ~ /^0/) { + d1 = substr(d1, 2); len1-- + d2 = substr(d2, 2); len2-- + } + if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) { + # The two components differ in length, and the common prefix + # contains only leading zeros. Consider the longer to be less. + d1 = -len1 + d2 = -len2 + } else { + # Otherwise, compare as strings. + d1 = "x" d1 + d2 = "x" d2 + } + } else { + # A fraction is less than an integer. + exit 1 + } + } else { + if (d2 ~ /^0/) { + # An integer is greater than a fraction. + exit 2 + } else { + # Compare two integers. + d1 += 0 + d2 += 0 + } + } + } else { + # The normal case, without worrying about digits. + d1 = substr(v1, 1, 1); v1 = substr(v1, 2) + d2 = substr(v2, 1, 1); v2 = substr(v2, 2) + } + if (d1 < d2) exit 1 + if (d1 > d2) exit 2 + } + # Beware Solaris /usr/xgp4/bin/awk (at least through Solaris 10), + # which mishandles some comparisons of empty strings to integers. + if (length(v2)) exit 1 + if (length(v1)) exit 2 + } +' - -exec 7<&0 &1 +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -589,7 +632,6 @@ cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= @@ -597,6 +639,7 @@ PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= +PACKAGE_URL= ac_unique_file="src/mod_python.c" ac_subst_vars='LTLIBOBJS @@ -654,6 +697,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -665,6 +709,7 @@ bindir program_transform_name prefix exec_prefix +PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION @@ -728,6 +773,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -752,8 +798,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -798,8 +845,7 @@ do ac_useropt=`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_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + 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 @@ -825,8 +871,7 @@ do ac_useropt=`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_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + 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 @@ -981,6 +1026,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1030,8 +1084,7 @@ do ac_useropt=`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_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + 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 @@ -1047,8 +1100,7 @@ do ac_useropt=`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_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + 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 @@ -1078,17 +1130,17 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1097,7 +1149,7 @@ Try \`$0 --help' for more information." >&2 $as_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} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1105,15 +1157,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1122,7 +1172,7 @@ fi 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 + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1136,8 +1186,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } + 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' @@ -1151,8 +1200,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_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 @@ -1167,11 +1214,9 @@ 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_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1210,13 +1255,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } + 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_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } + 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 @@ -1256,7 +1299,7 @@ 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 @@ -1282,6 +1325,7 @@ Fine tuning of the installation directories: --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] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1308,16 +1352,16 @@ if test -n "$ac_init_help"; then Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-apxs=NAME name of the apxs executable [apxs] ---with-apache=DIR Path to Apache sources ---with-python=PATH Path to specific Python binary ---with-mutex-dir=DIR Mutex directory ---with-max-locks=INTEGER Maximum number of locks ---with-flex=PATH Path to specific flex binary. - Flex Version 2.5.31 or greater is required to regenerate psp_parser.c - from psp_parse.l. A prepared psp_parser.c file is included with the - source, so you will only need flex if you make changes to psp_parser.l - See the README for more information. + --with-apxs=NAME name of the apxs executable [[apxs]] +--with-apache=DIR Path to Apache sources +--with-python=PATH Path to specific Python binary +--with-mutex-dir=DIR Mutex directory +--with-max-locks=INTEGER Maximum number of locks +--with-flex=PATH Path to specific flex binary. + Flex Version 2.5.31 or greater is required to regenerate psp_parser.c + from psp_parse.l. A prepared psp_parser.c file is included with the + source, so you will only need flex if you make changes to psp_parser.l + See the README for more information. Some influential environment variables: CC C compiler command @@ -1325,12 +1369,13 @@ Some influential environment variables: LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory 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 the package provider. _ACEOF ac_status=$? fi @@ -1390,25 +1435,112 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix done fi -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.63 +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +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;; +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 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 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 +# 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;; +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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -1444,8 +1576,8 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" -done + $as_echo "PATH: $as_dir" + done IFS=$as_save_IFS } >&5 @@ -1482,9 +1614,9 @@ do ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" + as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -1500,13 +1632,13 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args '$ac_arg'" + as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done -$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; } +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1518,11 +1650,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -1531,13 +1661,13 @@ _ASBOX case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 + *_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= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -1556,11 +1686,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -1573,11 +1701,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -1591,11 +1717,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -1609,46 +1733,53 @@ _ASBOX exit $exit_status ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal + trap 'ac_signal='$ac_signal'; as_fn_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 + # Predefined preprocessor variables. 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" +_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 - ac_site_file1=$CONFIG_SITE + # 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 @@ -1659,19 +1790,23 @@ fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 + 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;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$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; } 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. - if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 + # 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;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; @@ -1679,7 +1814,7 @@ $as_echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1694,11 +1829,11 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { $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;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 + { $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;} ac_cache_corrupted=: ;; ,);; @@ -1708,17 +1843,17 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} 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:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { $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:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 + { $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:$LINENO: former value: \`$ac_old_val'" >&5 + { $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:$LINENO: current value: \`$ac_new_val'" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac @@ -1730,35 +1865,20 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { $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:$LINENO: error: changes in the environment can compromise the build" >&5 + { $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_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi - - - - - - - - - - - - - - - - +## -------------------- ## +## Main body of script. ## +## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -1768,6 +1888,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # includes INCLUDES="-I`pwd`/src/include" @@ -1779,9 +1900,9 @@ 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:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -1792,24 +1913,24 @@ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -1819,9 +1940,9 @@ 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:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -1832,24 +1953,24 @@ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -1858,7 +1979,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -1872,9 +1993,9 @@ 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. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -1885,24 +2006,24 @@ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -1912,9 +2033,9 @@ 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:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -1926,18 +2047,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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_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:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then @@ -1956,10 +2077,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -1971,9 +2092,9 @@ if test -z "$CC"; then 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:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -1984,24 +2105,24 @@ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2015,9 +2136,9 @@ if test -z "$CC"; then 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:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2028,24 +2149,24 @@ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2058,7 +2179,7 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -2069,57 +2190,37 @@ fi fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +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_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" +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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 +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 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $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 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2135,8 +2236,8 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM 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:$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}: 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: @@ -2152,17 +2253,17 @@ do done rm -f $ac_rmfiles -if { (ac_try="$ac_link_default" +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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +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:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $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, @@ -2179,7 +2280,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -2198,84 +2299,41 @@ test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi - -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 +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 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +{ { $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:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } +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; } 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 -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&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' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_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 - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_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 -$as_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 -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +{ $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" +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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +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:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 @@ -2290,32 +2348,83 @@ for ac_file in conftest.exe conftest conftest.*; do esac done else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { { $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:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi - -rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +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_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +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 test "${ac_cv_objext+set}" = set; then +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2327,17 +2436,17 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" +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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +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:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $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; case $ac_file in @@ -2350,31 +2459,23 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +{ { $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:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +{ $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 test "${ac_cv_c_compiler_gnu+set}" = set; then +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2388,37 +2489,16 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no + ac_compiler_gnu=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +{ $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 @@ -2427,20 +2507,16 @@ else fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then +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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2451,35 +2527,11 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2490,36 +2542,12 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_compile "$LINENO"; then : - ac_c_werror_flag=$ac_save_c_werror_flag +else + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2530,42 +2558,17 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes -else - $as_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 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:$LINENO: result: $ac_cv_prog_cc_g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -2582,23 +2585,18 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +{ $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 test "${ac_cv_prog_cc_c89+set}" = set; then +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* 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); @@ -2650,32 +2648,9 @@ for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg -else - $as_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 done @@ -2686,17 +2661,19 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2709,9 +2686,9 @@ for ac_prog in ar aal 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:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -2722,24 +2699,24 @@ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:$LINENO: result: $AR" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2765,9 +2742,7 @@ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do fi done if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2793,10 +2768,10 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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:$LINENO: checking for a BSD-compatible install" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2804,11 +2779,11 @@ 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. @@ -2816,7 +2791,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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_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. @@ -2845,7 +2820,7 @@ case $as_dir/ in ;; esac -done + done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir @@ -2861,7 +2836,7 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -2872,11 +2847,11 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +{ $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 { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2884,7 +2859,7 @@ SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# 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;; @@ -2894,30 +2869,25 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi - -{ $as_echo "$as_me:$LINENO: checking for main in -lm" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5 $as_echo_n "checking for main in -lm... " >&6; } -if test "${ac_cv_lib_m_main+set}" = set; then +if ${ac_cv_lib_m_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -2927,45 +2897,20 @@ main () return main (); ; return 0; -} -_ACEOF -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;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_main=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_m_main=no + ac_cv_lib_m_main=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +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:$LINENO: result: $ac_cv_lib_m_main" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5 $as_echo "$ac_cv_lib_m_main" >&6; } -if test "x$ac_cv_lib_m_main" = x""yes; then +if test "x$ac_cv_lib_m_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF @@ -2976,26 +2921,22 @@ fi -{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +{ $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 test "${ac_cv_c_const+set}" = set; then +if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -/* FIXME: Include the comments suggested by Paul. */ + #ifndef __cplusplus - /* Ultrix mips cc rejects this. */ + /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; - const charset cs; + const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; @@ -3012,8 +2953,9 @@ main () ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; @@ -3029,10 +2971,10 @@ main () iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this saying + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; @@ -3045,53 +2987,30 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_const=no + ac_cv_c_const=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then -cat >>confdefs.h <<\_ACEOF -#define const /**/ -_ACEOF +$as_echo "#define const /**/" >>confdefs.h fi ### humor lowers blood pressure -{ $as_echo "$as_me:$LINENO: checking your blood pressure" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking your blood pressure" >&5 $as_echo_n "checking your blood pressure... " >&6; } -{ $as_echo "$as_me:$LINENO: result: a bit high, but we can proceed" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: a bit high, but we can proceed" >&5 $as_echo "a bit high, but we can proceed" >&6; } ## The goal is to find apxs -{ $as_echo "$as_me:$LINENO: checking whether apxs is available..." >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether apxs is available..." >&5 $as_echo "$as_me: checking whether apxs is available..." >&6;} @@ -3100,7 +3019,7 @@ $as_echo "$as_me: checking whether apxs is available..." >&6;} # check for --with-apxs # Check whether --with-apxs was given. -if test "${with_apxs+set}" = set; then +if test "${with_apxs+set}" = set; then : withval=$with_apxs; APXS="$with_apxs" fi @@ -3110,9 +3029,9 @@ if test -z "${APXS}"; then 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:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_APXS+set}" = set; then +if ${ac_cv_path_APXS+:} false; then : $as_echo_n "(cached) " >&6 else case $APXS in @@ -3126,14 +3045,14 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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_APXS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -3141,10 +3060,10 @@ esac fi APXS=$ac_cv_path_APXS if test -n "$APXS"; then - { $as_echo "$as_me:$LINENO: result: $APXS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $APXS" >&5 $as_echo "$APXS" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3162,9 +3081,9 @@ fi if test -z "$APXS"; then - { $as_echo "$as_me:$LINENO: WARNING: **** apxs was not found, DSO compilation will not be available." >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: **** apxs was not found, DSO compilation will not be available." >&5 $as_echo "$as_me: WARNING: **** apxs was not found, DSO compilation will not be available." >&2;} - { $as_echo "$as_me:$LINENO: WARNING: **** You can use --with-apxs to specify where your apxs is." >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: **** You can use --with-apxs to specify where your apxs is." >&5 $as_echo "$as_me: WARNING: **** You can use --with-apxs to specify where your apxs is." >&2;} DSO="no_dso" ALL="static" @@ -3173,42 +3092,40 @@ else ALL="dso" # check Apache version - { $as_echo "$as_me:$LINENO: checking Apache version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Apache version" >&5 $as_echo_n "checking Apache version... " >&6; } HTTPD="`${APXS} -q SBINDIR`/`${APXS} -q TARGET`" HTTPD_VERSION=`$HTTPD -v | awk '/version/ {print $3}' | awk -F/ '{print $2}' | awk '{print $1}'` APR_VERSION=`${APXS} -q APR_VERSION` - { $as_echo "$as_me:$LINENO: result: $HTTPD_VERSION" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HTTPD_VERSION" >&5 $as_echo "$HTTPD_VERSION" >&6; } # make sure version begins with 2 - if test -z "`echo $HTTPD_VERSION | egrep \^2`"; then - { { $as_echo "$as_me:$LINENO: error: This version of mod_python only works with Apache 2. The one we have ($HTTPD) seems to be $HTTPD_VERSION." >&5 -$as_echo "$as_me: error: This version of mod_python only works with Apache 2. The one we have ($HTTPD) seems to be $HTTPD_VERSION." >&2;} - { (exit 1); exit 1; }; } + if test -z "`echo $HTTPD_VERSION | grep -E \^2`"; then + as_fn_error $? "This version of mod_python only works with Apache 2. The one we have ($HTTPD) seems to be $HTTPD_VERSION." "$LINENO" 5 fi # determine LIBEXEC - { $as_echo "$as_me:$LINENO: checking for Apache libexec directory" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Apache libexec directory" >&5 $as_echo_n "checking for Apache libexec directory... " >&6; } LIBEXECDIR=`${APXS} -q LIBEXECDIR` - { $as_echo "$as_me:$LINENO: result: $LIBEXECDIR" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBEXECDIR" >&5 $as_echo "$LIBEXECDIR" >&6; } # determine INCLUDES - { $as_echo "$as_me:$LINENO: checking for Apache include directory" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Apache include directory" >&5 $as_echo_n "checking for Apache include directory... " >&6; } AP_INCLUDES="-I`${APXS} -q INCLUDEDIR`" - { $as_echo "$as_me:$LINENO: result: $AP_INCLUDES" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AP_INCLUDES" >&5 $as_echo "$AP_INCLUDES" >&6; } if test "`uname`" = "SunOS"; then - { $as_echo "$as_me:$LINENO: checking for gcc on Solaris possible missing _eprintf problem" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc on Solaris possible missing _eprintf problem" >&5 $as_echo_n "checking for gcc on Solaris possible missing _eprintf problem... " >&6; } if test "$CC" = "gcc"; then SOLARIS_HACKS="_eprintf.o _floatdidf.o _muldi3.o" fi - { $as_echo "$as_me:$LINENO: result: \"done\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"done\"" >&5 $as_echo "\"done\"" >&6; } fi @@ -3222,24 +3139,20 @@ fi ##AC_MSG_CHECKING(for --with-apache) # Check whether --with-apache was given. -if test "${with_apache+set}" = set; then +if test "${with_apache+set}" = set; then : withval=$with_apache; # temporarily disable static on 2.0 until I figure out how to # do it right - { { $as_echo "$as_me:$LINENO: error: Sorry, --with-apache (static compilation) is not supported at this time!" >&5 -$as_echo "$as_me: error: Sorry, --with-apache (static compilation) is not supported at this time!" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "Sorry, --with-apache (static compilation) is not supported at this time!" "$LINENO" 5 AP_SRC=`cd $withval; pwd` if test ! -f "$AP_SRC/include/httpd.h"; then - { { $as_echo "$as_me:$LINENO: error: $withval does not look like an Apache 2.0 source directory." >&5 -$as_echo "$as_me: error: $withval does not look like an Apache 2.0 source directory." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "$withval does not look like an Apache 2.0 source directory." "$LINENO" 5 fi - { $as_echo "$as_me:$LINENO: result: $AP_SRC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AP_SRC" >&5 $as_echo "$AP_SRC" >&6; } AP_INCLUDES="-I${AP_SRC}/src/include -I${AP_SRC}/src/os/unix" @@ -3261,35 +3174,34 @@ else fi if test "$STATIC" = "no_static" -a "$DSO" = "no_dso"; then - { { $as_echo "$as_me:$LINENO: error: Neither static nor DSO option available, there is no point in continuing." >&5 -$as_echo "$as_me: error: Neither static nor DSO option available, there is no point in continuing." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "Neither static nor DSO option available, there is no point in continuing." "$LINENO" 5 fi -{ $as_echo "$as_me:$LINENO: checking for --with-python" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-python" >&5 $as_echo_n "checking for --with-python... " >&6; } # Check whether --with-python was given. -if test "${with_python+set}" = set; then +if test "${with_python+set}" = set; then : withval=$with_python; PYTHON_BIN="$withval" - { $as_echo "$as_me:$LINENO: result: $PYTHON_BIN" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_BIN" >&5 $as_echo "$PYTHON_BIN" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # check for Python executable if test -z "$PYTHON_BIN"; then - # Extract the first word of "python", so it can be a program name with args. -set dummy python; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 + for python in python3 python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do + # Extract the first word of "$python", so it can be a program name with args. +set dummy $python; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PYTHON_BIN+set}" = set; then +if ${ac_cv_path_PYTHON_BIN+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHON_BIN in @@ -3302,14 +3214,14 @@ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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_PYTHON_BIN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -3317,100 +3229,134 @@ esac fi PYTHON_BIN=$ac_cv_path_PYTHON_BIN if test -n "$PYTHON_BIN"; then - { $as_echo "$as_me:$LINENO: result: $PYTHON_BIN" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_BIN" >&5 $as_echo "$PYTHON_BIN" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test -z "$PYTHON_BIN"; then - { { $as_echo "$as_me:$LINENO: error: python binary not found in path" >&5 -$as_echo "$as_me: error: python binary not found in path" >&2;} - { (exit 1); exit 1; }; } + if test -n "$PYTHON_BIN"; then + break fi + done +fi + +if test -z "$PYTHON_BIN"; then + as_fn_error $? "python binary not found in path" "$LINENO" 5 +else + as_ac_File=`$as_echo "ac_cv_file_${PYTHON_BIN}-config" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${PYTHON_BIN}-config" >&5 +$as_echo_n "checking for ${PYTHON_BIN}-config... " >&6; } +if eval \${$as_ac_File+:} false; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${PYTHON_BIN}-config"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes"; then : + PYTHON_CONFIG=${PYTHON_BIN}-config +fi + fi # find out python version -{ $as_echo "$as_me:$LINENO: checking Python version" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python version" >&5 $as_echo_n "checking Python version... " >&6; } -PyVERSION=`$PYTHON_BIN -c 'import sys; print(sys.version[:3])'` -PyMAJVERSION=`$PYTHON_BIN -c 'import sys; print(sys.version[:1])'` -PyMINVERSION=`$PYTHON_BIN -c 'import sys; print(sys.version.split(".")[1])'` -{ $as_echo "$as_me:$LINENO: result: $PyVERSION" >&5 +PyVERSION=`$PYTHON_BIN -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))'` +PyMAJVERSION=`$PYTHON_BIN -c 'import sys; print(sys.version_info.major)'` +PyMINVERSION=`$PYTHON_BIN -c 'import sys; print(sys.version_info.minor)'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PyVERSION" >&5 $as_echo "$PyVERSION" >&6; } # make sure Python version is >= 2.6 for 2 and >= 3.3 for 3 if test "$PyMAJVERSION" -lt "2"; then - { { $as_echo "$as_me:$LINENO: error: This version of mod_python only works with Python major version 2 or higher. The one you have seems to be $PyVERSION." >&5 -$as_echo "$as_me: error: This version of mod_python only works with Python major version 2 or higher. The one you have seems to be $PyVERSION." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "This version of mod_python only works with Python major version 2 or higher. The one you have seems to be $PyVERSION." "$LINENO" 5 fi if test "$PyMAJVERSION" -eq "2"; then if test "$PyMINVERSION" -lt "6"; then - { { $as_echo "$as_me:$LINENO: error: This version of mod_python only works with Python 2.x version 2.6 or higher. The one you have seems to be $PyVERSION." >&5 -$as_echo "$as_me: error: This version of mod_python only works with Python 2.x version 2.6 or higher. The one you have seems to be $PyVERSION." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "This version of mod_python only works with Python 2.x version 2.6 or higher. The one you have seems to be $PyVERSION." "$LINENO" 5 fi fi if test "$PyMAJVERSION" -eq "3"; then if test "$PyMINVERSION" -lt "3"; then - { { $as_echo "$as_me:$LINENO: error: This version of mod_python only works with Python 3.x version 3.3 or higher. The one you have seems to be $PyVERSION." >&5 -$as_echo "$as_me: error: This version of mod_python only works with Python 3.x version 3.3 or higher. The one you have seems to be $PyVERSION." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "This version of mod_python only works with Python 3.x version 3.3 or higher. The one you have seems to be $PyVERSION." "$LINENO" 5 fi fi -# calculate compiler options -CPPFLAGS1=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ - print("-I" + sysconfig.get_config_var("INCLUDEPY"))'` - -CPPFLAGS2=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ - print(" ".join(filter(lambda x: x.startswith("-D"), \ - sysconfig.get_config_var("CFLAGS").split())))'` - -CPPFLAGS="${CPPFLAGS1} ${CPPFLAGS2}" - - - -PYTHONFRAMEWORKDIR=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ - print(sysconfig.get_config_var("PYTHONFRAMEWORKDIR"))'` -PYTHONFRAMEWORKPREFIX=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ - print(sysconfig.get_config_var("PYTHONFRAMEWORKPREFIX"))'` -PYTHONFRAMEWORK=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ - print(sysconfig.get_config_var("PYTHONFRAMEWORK"))'` +if test -n "$PYTHON_CONFIG" -a "$PyMAJVERSION" -gt "2"; then # 2.7.18 python-config missies the -L and does not support --embed + CPPFLAGS=`${PYTHON_CONFIG} --includes` + LDFLAGS=`${PYTHON_CONFIG} --ldflags --embed` + LDLIBS="" +else -if test "${PYTHONFRAMEWORKDIR}" = "no-framework"; then - # this directory may contain the .so library, our preference, list 1st - LDFLAGS1=`${PYTHON_BIN} -c 'import distutils.sysconfig; \ - print("-L" + distutils.sysconfig.get_config_var("LIBDIR"))'` - LDFLAGS2=`${PYTHON_BIN} -c 'import distutils.sysconfig; \ - print("-L" + distutils.sysconfig.get_python_lib(plat_specific=1, \ - standard_lib=1) +"/config")'` - LDFLAGS="${LDFLAGS1} ${LDFLAGS2}" + # calculate compiler options + CPPFLAGS1=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ + print("-I" + sysconfig.get_config_var("INCLUDEPY"))'` + + CPPFLAGS2=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ + print(" ".join(filter(lambda x: x.startswith("-D"), \ + sysconfig.get_config_var("CFLAGS").split())))'` + + CPPFLAGS="${CPPFLAGS1} ${CPPFLAGS2}" + + PYTHONFRAMEWORKDIR=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ + print(sysconfig.get_config_var("PYTHONFRAMEWORKDIR"))'` + PYTHONFRAMEWORKPREFIX=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ + print(sysconfig.get_config_var("PYTHONFRAMEWORKPREFIX"))'` + PYTHONFRAMEWORK=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ + print(sysconfig.get_config_var("PYTHONFRAMEWORK"))'` + + if test "${PYTHONFRAMEWORKDIR}" = "no-framework"; then + # this directory may contain the .so library, our preference, list 1st + LDFLAGS1=`${PYTHON_BIN} -c 'import distutils.sysconfig; \ + print("-L" + distutils.sysconfig.get_config_var("LIBDIR"))'` + LDFLAGS2=`${PYTHON_BIN} -c 'import distutils.sysconfig; \ + print("-L" + distutils.sysconfig.get_python_lib(plat_specific=1, \ + standard_lib=1) +"/config")'` + LDFLAGS="${LDFLAGS1} ${LDFLAGS2}" + + PYTHON_CODE=$(cat <&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-mutex-dir" >&5 $as_echo_n "checking for --with-mutex-dir... " >&6; } # Check whether --with-mutex-dir was given. -if test "${with_mutex_dir+set}" = set; then +if test "${with_mutex_dir+set}" = set; then : withval=$with_mutex_dir; MUTEX_DIR="$withval" - { $as_echo "$as_me:$LINENO: result: $MUTEX_DIR" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MUTEX_DIR" >&5 $as_echo "$MUTEX_DIR" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3462,23 +3410,23 @@ if test -z "$MUTEX_DIR"; then MUTEX_DIR="/tmp" fi # TODO - check if MUTEX_DIR is an absolute path -{ $as_echo "$as_me:$LINENO: result: Using MUTEX_DIR $MUTEX_DIR" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Using MUTEX_DIR $MUTEX_DIR" >&5 $as_echo "Using MUTEX_DIR $MUTEX_DIR" >&6; } # configure the MAX_LOCKS for number of mutex locks -{ $as_echo "$as_me:$LINENO: checking for --with-max-locks" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-max-locks" >&5 $as_echo_n "checking for --with-max-locks... " >&6; } # Check whether --with-max-locks was given. -if test "${with_max_locks+set}" = set; then +if test "${with_max_locks+set}" = set; then : withval=$with_max_locks; MAX_LOCKS="$withval" - { $as_echo "$as_me:$LINENO: result: $MAX_LOCKS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAX_LOCKS" >&5 $as_echo "$MAX_LOCKS" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3486,7 +3434,7 @@ fi if test -z "$MAX_LOCKS"; then MAX_LOCKS="8" fi -{ $as_echo "$as_me:$LINENO: result: Using $MAX_LOCKS MAX_LOCKS." >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $MAX_LOCKS MAX_LOCKS." >&5 $as_echo "Using $MAX_LOCKS MAX_LOCKS." >&6; } # Check for correct flex version @@ -3494,18 +3442,18 @@ $as_echo "Using $MAX_LOCKS MAX_LOCKS." >&6; } # See README for more details -{ $as_echo "$as_me:$LINENO: checking for --with-flex" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-flex" >&5 $as_echo_n "checking for --with-flex... " >&6; } # Check whether --with-flex was given. -if test "${with_flex+set}" = set; then +if test "${with_flex+set}" = set; then : withval=$with_flex; LEX="$withval" - { $as_echo "$as_me:$LINENO: result: $LEX" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3514,9 +3462,9 @@ fi if test -z "$LEX"; then # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_LEX+set}" = set; then +if ${ac_cv_path_LEX+:} false; then : $as_echo_n "(cached) " >&6 else case $LEX in @@ -3529,14 +3477,14 @@ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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_LEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -3544,10 +3492,10 @@ esac fi LEX=$ac_cv_path_LEX if test -n "$LEX"; then - { $as_echo "$as_me:$LINENO: result: $LEX" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3555,21 +3503,28 @@ fi fi if test "$LEX" && test -x "$LEX"; then - { $as_echo "$as_me:$LINENO: result: found $LEX, we'll use this. Use --with-flex to specify another." >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $LEX, we'll use this. Use --with-flex to specify another." >&5 $as_echo "found $LEX, we'll use this. Use --with-flex to specify another." >&6; } - { $as_echo "$as_me:$LINENO: checking flex version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking flex version" >&5 $as_echo_n "checking flex version... " >&6; } FlexVERSION=`$LEX --version | sed 's/version//g' | awk '/flex/ {print $2}'` - Flex_MAJOR=`echo $FlexVERSION| awk -F . '{print $1}'` - Flex_MINOR=`echo $FlexVERSION| awk -F . '{print $2}'` - Flex_PATCH=`echo $FlexVERSION| awk -F . '{print $3}'` - if test "$Flex_MAJOR" -eq "2" && test "$Flex_MINOR" -eq "5" && test "$Flex_PATCH" -ge "31"; then - { $as_echo "$as_me:$LINENO: result: $FlexVERSION. Good" >&5 -$as_echo "$FlexVERSION. Good" >&6; } - else - { $as_echo "$as_me:$LINENO: WARNING: Flex version $FlexVERSION found. + as_arg_v1=${FlexVERSION} +as_arg_v2="2.5.31" +awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null +case $? in #( + 1) : + warn=1 ;; #( + 0) : + warn=0 ;; #( + 2) : + warn=0 ;; #( + *) : + ;; +esac + if test "$warn" -eq "1"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Flex version $FlexVERSION found. Version 2.5.31 or greater is required. You can generally ignore this warning unless you need to regenerate psp_parser.c from psp_parse.l. If you do need regenerate psp_parser.c, use --with-flex to specify the @@ -3579,10 +3534,13 @@ $as_echo "$as_me: WARNING: Flex version $FlexVERSION found. warning unless you need to regenerate psp_parser.c from psp_parse.l. If you do need regenerate psp_parser.c, use --with-flex to specify the location of the correct flex version. See the README for more information." >&2;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FlexVERSION. Good" >&5 +$as_echo "$FlexVERSION. Good" >&6; } fi else - { $as_echo "$as_me:$LINENO: WARNING: flex $LEX not found + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: flex $LEX not found You can generally ignore this warning unless you need to regenerate psp_parser.c from psp_parse.l. If you do need regenerate psp_parser.c, use --with-flex to specify the location of flex. @@ -3626,13 +3584,13 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 + *_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= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -3640,8 +3598,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; (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 \). + # `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" @@ -3663,12 +3621,23 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&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" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 + 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;} - cat confcache >$cache_file + 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 else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 + { $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;} fi fi @@ -3718,14 +3687,15 @@ DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= +U= 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. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -3733,13 +3703,14 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -3749,17 +3720,18 @@ cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +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 +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 @@ -3767,23 +3739,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -3791,7 +3755,13 @@ export as_nl 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 -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# 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 @@ -3802,7 +3772,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -3825,13 +3795,6 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi -# 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 @@ -3841,15 +3804,16 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +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 + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -3861,12 +3825,16 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# 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 PS1='$ ' PS2='> ' @@ -3878,7 +3846,89 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# Required to use basename. +# 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 + 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 + + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -3892,8 +3942,12 @@ 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 -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -3913,76 +3967,25 @@ $as_echo X/"$0" | } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # 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 after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, 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 - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\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 - { (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 sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +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 +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -3997,49 +4000,85 @@ if (echo >conf$$.file) 2>/dev/null; then # ... 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 -p'. + # 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 -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' 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 () +{ + + 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 if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# 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 # 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'" @@ -4049,13 +4088,19 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -# Save the log message, to keep $[0] and so on meaningful, and to +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, 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 $as_me, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4082,13 +4127,15 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +\`$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. -Usage: $0 [OPTION]... [FILE]... +Usage: $0 [OPTION]... [TAG]... -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 -d, --debug don't remove temporary files @@ -4099,16 +4146,17 @@ Usage: $0 [OPTION]... [FILE]... Configuration files: $config_files -Report bugs to ." +Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -4124,11 +4172,16 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) + --*=?*) 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 @@ -4142,14 +4195,17 @@ do 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 ) 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 - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -4158,11 +4214,10 @@ do ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" + *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac @@ -4179,7 +4234,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + 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' @@ -4218,9 +4273,7 @@ do "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/mod_python") CONFIG_FILES="$CONFIG_FILES scripts/mod_python" ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -4241,26 +4294,24 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} +} || 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. @@ -4268,7 +4319,13 @@ $debug || if test -n "$CONFIG_FILES"; then -ac_cr=' ' +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` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' @@ -4276,7 +4333,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -4285,24 +4342,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -4310,7 +4361,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -4324,7 +4375,7 @@ s/'"$ac_delim"'$// t delim :nl h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p @@ -4338,7 +4389,7 @@ s/.\{148\}// t nl :delim h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p @@ -4358,7 +4409,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -4390,23 +4441,29 @@ 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 < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } +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 $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# 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[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + 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 @@ -4424,9 +4481,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -4445,7 +4500,7 @@ $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) 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 `:'. @@ -4454,12 +4509,10 @@ $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; + 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 - ac_file_inputs="$ac_file_inputs '$ac_f'" + as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't @@ -4470,7 +4523,7 @@ $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. @@ -4482,10 +4535,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -4513,47 +4564,7 @@ $as_echo X"$ac_file" | q } s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - 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_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in @@ -4605,7 +4616,6 @@ 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 @@ -4615,12 +4625,11 @@ ac_sed_dataroot=' /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/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:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 + { $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 @@ -4630,7 +4639,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF @@ -4657,27 +4666,24 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } +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' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 + { 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;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -4692,15 +4698,12 @@ $as_echo "$as_me: error: could not create $ac_file" >&2;} done # for ac_tag -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -4721,10 +4724,10 @@ 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 || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 + { $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;} fi diff --git a/configure.in b/configure.in index a669c872..08a696e4 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,7 +17,8 @@ # dnl Process this file with autoconf to produce a configure script. -AC_INIT(src/mod_python.c) +AC_INIT +AC_CONFIG_SRCDIR([src/mod_python.c]) # includes INCLUDES="-I`pwd`/src/include" @@ -42,14 +43,13 @@ AC_MSG_CHECKING(your blood pressure) AC_MSG_RESULT([a bit high, but we can proceed]) ## The goal is to find apxs -AC_CHECKING(whether apxs is available) +AS_MESSAGE([checking whether apxs is available...]) AC_SUBST(APXS) AC_SUBST(DSO) AC_SUBST(ALL) # check for --with-apxs -AC_ARG_WITH(apxs, AC_HELP_STRING([--with-apxs=NAME], - [name of the apxs executable [[apxs]]]), +AC_ARG_WITH(apxs, AS_HELP_STRING([--with-apxs=NAME],[name of the apxs executable [[apxs]]]), [APXS="$with_apxs"]) if test -z "${APXS}"; then @@ -81,7 +81,7 @@ else AC_MSG_RESULT($HTTPD_VERSION) # make sure version begins with 2 - if test -z "`echo $HTTPD_VERSION | egrep \^2`"; then + if test -z "`echo $HTTPD_VERSION | grep -E \^2`"; then AC_MSG_ERROR([This version of mod_python only works with Apache 2. The one we have ($HTTPD) seems to be $HTTPD_VERSION.]) fi @@ -112,7 +112,7 @@ AC_SUBST(AP_SRC_OWN) AC_SUBST(AP_SRC_GRP) ## static is disabled, thus no --with-apache ##AC_MSG_CHECKING(for --with-apache) -AC_ARG_WITH(apache, [--with-apache=DIR Path to Apache sources], +AC_ARG_WITH(apache, [--with-apache=DIR Path to Apache sources], [ # temporarily disable static on 2.0 until I figure out how to @@ -150,7 +150,7 @@ fi AC_SUBST(PYTHON_BIN) AC_MSG_CHECKING(for --with-python) -AC_ARG_WITH(python, [--with-python=PATH Path to specific Python binary], +AC_ARG_WITH(python, [--with-python=PATH Path to specific Python binary], [ PYTHON_BIN="$withval" AC_MSG_RESULT($PYTHON_BIN) @@ -159,17 +159,25 @@ AC_MSG_RESULT(no)) # check for Python executable if test -z "$PYTHON_BIN"; then - AC_PATH_PROG(PYTHON_BIN, python) - if test -z "$PYTHON_BIN"; then - AC_MSG_ERROR(python binary not found in path) + for python in python3 python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do + AC_PATH_PROG(PYTHON_BIN, [$python]) + if test -n "$PYTHON_BIN"; then + break fi + done +fi + +if test -z "$PYTHON_BIN"; then + AC_MSG_ERROR(python binary not found in path) +else + AC_CHECK_FILE([${PYTHON_BIN}]-config, PYTHON_CONFIG=[${PYTHON_BIN}]-config) fi # find out python version AC_MSG_CHECKING(Python version) -PyVERSION=`$PYTHON_BIN -c ['import sys; print(sys.version[:3])'`] -PyMAJVERSION=`$PYTHON_BIN -c ['import sys; print(sys.version[:1])'`] -PyMINVERSION=`$PYTHON_BIN -c ['import sys; print(sys.version.split(".")[1])'`] +PyVERSION=`$PYTHON_BIN -c ['import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))'`] +PyMAJVERSION=`$PYTHON_BIN -c ['import sys; print(sys.version_info.major)'`] +PyMINVERSION=`$PYTHON_BIN -c ['import sys; print(sys.version_info.minor)'`] AC_MSG_RESULT($PyVERSION) # make sure Python version is >= 2.6 for 2 and >= 3.3 for 3 @@ -187,55 +195,70 @@ if test "$PyMAJVERSION" -eq "3"; then fi fi -# calculate compiler options -CPPFLAGS1=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ - print("-I" + sysconfig.get_config_var("INCLUDEPY"))'` - -CPPFLAGS2=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ - print(" ".join(filter(lambda x: x.startswith("-D"), \ - sysconfig.get_config_var("CFLAGS").split())))'` - -CPPFLAGS="${CPPFLAGS1} ${CPPFLAGS2}" - -AC_SUBST(CPPFLAGS) - -PYTHONFRAMEWORKDIR=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ - print(sysconfig.get_config_var("PYTHONFRAMEWORKDIR"))'` -PYTHONFRAMEWORKPREFIX=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ - print(sysconfig.get_config_var("PYTHONFRAMEWORKPREFIX"))'` -PYTHONFRAMEWORK=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ - print(sysconfig.get_config_var("PYTHONFRAMEWORK"))'` - -if test "${PYTHONFRAMEWORKDIR}" = "no-framework"; then - # this directory may contain the .so library, our preference, list 1st - LDFLAGS1=`${PYTHON_BIN} -c 'import distutils.sysconfig; \ - print("-L" + distutils.sysconfig.get_config_var("LIBDIR"))'` - LDFLAGS2=`${PYTHON_BIN} -c 'import distutils.sysconfig; \ - print("-L" + distutils.sysconfig.get_python_lib(plat_specific=1, \ - standard_lib=1) +"/config")'` - LDFLAGS="${LDFLAGS1} ${LDFLAGS2}" - - if test "$PyMAJVERSION" -eq "3"; then - LDLIBS1="-lpython${PyMAJVERSION}" - else - LDLIBS1="-lpython${PyVERSION}" - fi - LDLIBS2=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ - print(sysconfig.get_config_var("LIBS"))'` - - LDLIBS="${LDLIBS1} ${LDLIBS2}" +if test -n "$PYTHON_CONFIG" -a "$PyMAJVERSION" -gt "2"; then # 2.7.18 python-config missies the -L and does not support --embed + CPPFLAGS=`${PYTHON_CONFIG} --includes` + LDFLAGS=`${PYTHON_CONFIG} --ldflags --embed` + LDLIBS="" else - LDFLAGS1="-Wl,-F${PYTHONFRAMEWORKPREFIX} -framework ${PYTHONFRAMEWORK}" - STRING="${PYTHONFRAMEWORKDIR}/Versions/${PyVERSION}/${PYTHONFRAMEWORK}" - LDFLAGS2=`${PYTHON_BIN} -c "from distutils import sysconfig; \ - print(sysconfig.get_config_var(\"LINKFORSHARED\").replace( \ - \"${STRING}\", ''))"` + # calculate compiler options + CPPFLAGS1=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ + print("-I" + sysconfig.get_config_var("INCLUDEPY"))'` + + CPPFLAGS2=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ + print(" ".join(filter(lambda x: x.startswith("-D"), \ + sysconfig.get_config_var("CFLAGS").split())))'` + + CPPFLAGS="${CPPFLAGS1} ${CPPFLAGS2}" + + PYTHONFRAMEWORKDIR=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ + print(sysconfig.get_config_var("PYTHONFRAMEWORKDIR"))'` + PYTHONFRAMEWORKPREFIX=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ + print(sysconfig.get_config_var("PYTHONFRAMEWORKPREFIX"))'` + PYTHONFRAMEWORK=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ + print(sysconfig.get_config_var("PYTHONFRAMEWORK"))'` + + if test "${PYTHONFRAMEWORKDIR}" = "no-framework"; then + # this directory may contain the .so library, our preference, list 1st + LDFLAGS1=`${PYTHON_BIN} -c 'import distutils.sysconfig; \ + print("-L" + distutils.sysconfig.get_config_var("LIBDIR"))'` + LDFLAGS2=`${PYTHON_BIN} -c 'import distutils.sysconfig; \ + print("-L" + distutils.sysconfig.get_python_lib(plat_specific=1, \ + standard_lib=1) +"/config")'` + LDFLAGS="${LDFLAGS1} ${LDFLAGS2}" + + PYTHON_CODE=$(cat <@, str) and lookingFor in cfg@<:@key@:>@: + ret = cfg@<:@key@:>@ + break +print(ret@<:@ret.find(lookingFor) if ret.find(lookingFor) != -1 else 0:@:>@) +END +) + + LDLIBS1=`${PYTHON_BIN} -c "$PYTHON_CODE"` + LDLIBS2=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ + print(sysconfig.get_config_var("LIBS"))'` + + LDLIBS="${LDLIBS1} ${LDLIBS2}" + else + LDFLAGS1="-Wl,-F${PYTHONFRAMEWORKPREFIX} -framework ${PYTHONFRAMEWORK}" + + STRING="${PYTHONFRAMEWORKDIR}/Versions/${PyVERSION}/${PYTHONFRAMEWORK}" + LDFLAGS2=`${PYTHON_BIN} -c "from distutils import sysconfig; \ + print(sysconfig.get_config_var(\"LINKFORSHARED\").replace( \ + \"${STRING}\", ''))"` - LDFLAGS="${LDFLAGS1} ${LDFLAGS2}" + LDFLAGS="${LDFLAGS1} ${LDFLAGS2}" - LDLIBS=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ - print(sysconfig.get_config_var("LIBS"))'` + LDLIBS=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ + print(sysconfig.get_config_var("LIBS"))'` + fi fi CFLAGS="" @@ -251,6 +274,8 @@ if test -x /usr/bin/lipo; then LDFLAGS="${LDFLAGS3} ${LDFLAGS}" fi +AC_SUBST(CPPFLAGS) + AC_SUBST(CFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(LDLIBS) @@ -268,7 +293,7 @@ TEST_MOD_PYTHON_SO="`pwd`/src/mod_python.so" # configure the MUTEX_DIR for location of mutex locks AC_SUBST(MUTEX_DIR) AC_MSG_CHECKING(for --with-mutex-dir) -AC_ARG_WITH(mutex-dir, [--with-mutex-dir=DIR Mutex directory], +AC_ARG_WITH(mutex-dir, [--with-mutex-dir=DIR Mutex directory], [ MUTEX_DIR="$withval" AC_MSG_RESULT($MUTEX_DIR) @@ -284,7 +309,7 @@ AC_MSG_RESULT([Using MUTEX_DIR $MUTEX_DIR]) # configure the MAX_LOCKS for number of mutex locks AC_SUBST(MAX_LOCKS) AC_MSG_CHECKING(for --with-max-locks) -AC_ARG_WITH(max-locks, [--with-max-locks=INTEGER Maximum number of locks], +AC_ARG_WITH(max-locks, [--with-max-locks=INTEGER Maximum number of locks], [ MAX_LOCKS="$withval" AC_MSG_RESULT($MAX_LOCKS) @@ -302,11 +327,11 @@ AC_MSG_RESULT([Using $MAX_LOCKS MAX_LOCKS.]) AC_SUBST(LEX) AC_MSG_CHECKING(for --with-flex) -AC_ARG_WITH(flex, [--with-flex=PATH Path to specific flex binary. - Flex Version 2.5.31 or greater is required to regenerate psp_parser.c - from psp_parse.l. A prepared psp_parser.c file is included with the - source, so you will only need flex if you make changes to psp_parser.l - See the README for more information.], +AC_ARG_WITH(flex, [--with-flex=PATH Path to specific flex binary. + Flex Version 2.5.31 or greater is required to regenerate psp_parser.c + from psp_parse.l. A prepared psp_parser.c file is included with the + source, so you will only need flex if you make changes to psp_parser.l + See the README for more information.], [ LEX="$withval" AC_MSG_RESULT($LEX) @@ -323,18 +348,16 @@ if test "$LEX" && test -x "$LEX"; then AC_MSG_CHECKING(flex version) FlexVERSION=`$LEX --version | sed 's/version//g' | awk '/flex/ {print $2}'` - Flex_MAJOR=`echo $FlexVERSION| awk -F. '{print $1}'` - Flex_MINOR=`echo $FlexVERSION| awk -F. '{print $2}'` - Flex_PATCH=`echo $FlexVERSION| awk -F. '{print $3}'` - if test "$Flex_MAJOR" -eq "2" && test "$Flex_MINOR" -eq "5" && test "$Flex_PATCH" -ge "31"; then - AC_MSG_RESULT([$FlexVERSION. Good]) - else + AS_VERSION_COMPARE(${FlexVERSION}, "2.5.31", [warn=1], [warn=0], [warn=0]) + if test "$warn" -eq "1"; then AC_MSG_WARN([Flex version $FlexVERSION found. Version 2.5.31 or greater is required. You can generally ignore this warning unless you need to regenerate psp_parser.c from psp_parse.l. If you do need regenerate psp_parser.c, use --with-flex to specify the location of the correct flex version. See the README for more information.]) + else + AC_MSG_RESULT([$FlexVERSION. Good]) fi else diff --git a/dist/setup.py.in b/dist/setup.py.in index 68581f36..bdc2d22d 100644 --- a/dist/setup.py.in +++ b/dist/setup.py.in @@ -16,9 +16,16 @@ # # $Id: setup.py.in 475516 2006-11-16 01:12:40Z grahamd $ -from distutils.core import setup, Extension - import sys +if sys.version_info[0]*100 + sys.version_info[1] > 310: + from setuptools import setup, Extension + import sysconfig +else: + from distutils.core import setup, Extension + from distutils import sysconfig + + +import string import re import os.path if sys.version[0] == '2': @@ -183,9 +190,6 @@ else: data_files = [] ext_modules = [PSPModule] -import string -from distutils import sysconfig - generate_version_py() if sys.platform == "darwin": diff --git a/dist/version.sh b/dist/version.sh index e50000d2..cf99e2a4 100755 --- a/dist/version.sh +++ b/dist/version.sh @@ -13,7 +13,7 @@ if type git >/dev/null 2>&1; then # but not on a tag (which means this is a release) if test -z "`git log 'HEAD^!' --format=%d 2>/dev/null | grep 'tag: '`"; then # append git revision hash to version - GIT="-`git describe --always`" + GIT="+`git describe --always --exclude '*'`" fi fi fi diff --git a/dist/win32_postinstall.py b/dist/win32_postinstall.py index 2a959343..fed1a67e 100644 --- a/dist/win32_postinstall.py +++ b/dist/win32_postinstall.py @@ -21,7 +21,6 @@ import sys, os, shutil -import distutils.sysconfig def getApacheDirOptions(): """find potential apache directories in the registry...""" @@ -102,7 +101,13 @@ def askForApacheDir(apachediroptions): # if we're called during removal, just exit if len(sys.argv) == 1 or (len(sys.argv) > 1 and sys.argv[1] != "-remove"): - mp = os.path.join(distutils.sysconfig.get_python_lib(), "mod_python_so.pyd") + if sys.version_info[0]*100 + sys.version_info[1] > 310: + import sysconfig + lib = get_path('platlib') + else: + import distutils.sysconfig + lib = distutils.sysconfig.get_python_lib() + mp = os.path.join(lib, "mod_python_so.pyd") apachediroptions = getApacheDirOptions() diff --git a/lib/python/mod_python/Cookie.py b/lib/python/mod_python/Cookie.py index 25ad2317..52bedc2c 100644 --- a/lib/python/mod_python/Cookie.py +++ b/lib/python/mod_python/Cookie.py @@ -1,6 +1,6 @@ # vim: set sw=4 expandtab : # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -59,7 +59,7 @@ def __new__(cls, clsname, bases, clsdict): _valid_attr = ( "version", "path", "domain", "secure", - "comment", "expires", "max_age", + "comment", "expires", "max_age", "samesite", # RFC 2965 "commentURL", "discard", "port", # Microsoft Extension @@ -74,6 +74,10 @@ def __new__(cls, clsname, bases, clsdict): clsdict["_valid_attr"] = _valid_attr clsdict["__slots__"] = __slots__ + return type.__new__(cls, clsname, bases, clsdict) + + def __init__(cls, clsname, bases, clsdict): + def set_expires(self, value): if type(value) == type(""): @@ -96,9 +100,7 @@ def set_expires(self, value): def get_expires(self): return self._expires - clsdict["expires"] = property(fget=get_expires, fset=set_expires) - - return type.__new__(cls, clsname, bases, clsdict) + cls.expires = property(fget=get_expires, fset=set_expires) # metaclass= workaround, see # http://mikewatkins.ca/2008/11/29/python-2-and-3-metaclasses/#using-the-metaclass-in-python-2-x-and-3-x @@ -350,7 +352,7 @@ def _parse_cookie(str, Class, names=None): # We just ditch the cookies names which start with a dollar sign since # those are in fact RFC2965 cookies attributes. See bug [#MODPYTHON-3]. - if key[0]!='$' and names is None or key in names: + if key[0]!='$' and (names is None or key in names): result[key] = Class(key, val) return result diff --git a/lib/python/mod_python/Session.py b/lib/python/mod_python/Session.py index 38694c28..8bd56be1 100644 --- a/lib/python/mod_python/Session.py +++ b/lib/python/mod_python/Session.py @@ -1,6 +1,6 @@ # vim: set sw=4 expandtab : # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -124,7 +124,7 @@ def _new_sid(req): g = _get_generator() rnd1 = g.randint(0, 999999999) rnd2 = g.randint(0, 999999999) - ip = req.connection.remote_ip + ip = req.connection.client_ip return md5_hash("%d%d%d%d%s" % (t, pid, rnd1, rnd2, ip)) @@ -338,9 +338,9 @@ def unlock_session_cleanup(sess): ## DbmSession def dbm_cleanup(data): - dbm, server = data + filename, server = data _apache._global_lock(server, None, 0) - db = dbm.open(dbm, 'c') + db = dbm.open(filename, 'c') try: old = [] s = db.first() diff --git a/lib/python/mod_python/__init__.py b/lib/python/mod_python/__init__.py index 4e8a79ed..b1b0191e 100644 --- a/lib/python/mod_python/__init__.py +++ b/lib/python/mod_python/__init__.py @@ -1,5 +1,5 @@ # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -30,5 +30,3 @@ # httpdconf, so we fail silently from . import apache except: pass - - diff --git a/lib/python/mod_python/apache.py b/lib/python/mod_python/apache.py index 7748108e..5ac484e7 100644 --- a/lib/python/mod_python/apache.py +++ b/lib/python/mod_python/apache.py @@ -1,6 +1,6 @@ # vim: set sw=4 expandtab : # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -24,10 +24,14 @@ import os import pdb import stat -import imp +import inspect +import importlib import types -import cgi import _apache +try: + from html import escape +except: + from cgi import escape try: import threading @@ -549,7 +553,7 @@ def ReportError(self, etype, evalue, etb, req=None, filter=None, srv=None, s = '\n
\nMod_python error: "%s %s"\n\n' % (phase, hname)
                     for e in traceback.format_exception(etype, evalue, etb):
-                        s = s + cgi.escape(e) + '\n'
+                        s = s + escape(e) + '\n'
                     s = s + "
\n" if filter: @@ -578,79 +582,63 @@ def import_module(module_name, autoreload=1, log=0, path=None): # nlehuen: this is a big lock, we'll have to refine it later to get better performance. # For now, we'll concentrate on thread-safety. - imp.acquire_lock() - try: - # (Re)import - if module_name in sys.modules: + # (Re)import + if module_name in sys.modules: - # The module has been imported already - module = sys.modules[module_name] - oldmtime, mtime = 0, 0 + # The module has been imported already + module = sys.modules[module_name] + oldmtime, mtime = 0, 0 - if autoreload: + if autoreload: - # but is it in the path? + # but is it in the path? + try: + file = module.__dict__["__file__"] + except KeyError: + file = None + + # the "and not" part of this condition is to prevent execution + # of arbitrary already imported modules, such as os. The + # reason we use startswith as opposed to exact match is that + # modules inside packages are actually in subdirectories. + + if not file or (path and not list(filter(file.startswith, path))): + # there is a script by this name already imported, but it's in + # a different directory, therefore it's a different script + mtime, oldmtime = 0, -1 # trigger import + else: try: - file = module.__dict__["__file__"] + last_check = module.__dict__["__mtime_check__"] except KeyError: - file = None - - # the "and not" part of this condition is to prevent execution - # of arbitrary already imported modules, such as os. The - # reason we use startswith as opposed to exact match is that - # modules inside packages are actually in subdirectories. - - if not file or (path and not list(filter(file.startswith, path))): - # there is a script by this name already imported, but it's in - # a different directory, therefore it's a different script - mtime, oldmtime = 0, -1 # trigger import - else: - try: - last_check = module.__dict__["__mtime_check__"] - except KeyError: - last_check = 0 + last_check = 0 - if (time.time() - last_check) > 1: - oldmtime = module.__dict__.get("__mtime__", 0) - mtime = module_mtime(module) - else: - pass + if (time.time() - last_check) > 1: + oldmtime = module.__dict__.get("__mtime__", 0) + mtime = module_mtime(module) else: - mtime, oldmtime = 0, -1 + pass + else: + mtime, oldmtime = 0, -1 - if mtime != oldmtime: + if mtime != oldmtime: - # Import the module - if log: - if path: - s = "mod_python: (Re)importing module '%s' with path set to '%s'" % (module_name, path) - else: - s = "mod_python: (Re)importing module '%s'" % module_name - _apache.log_error(s, APLOG_NOTICE) + # Import the module + if log: + if path: + s = "mod_python: (Re)importing module '%s' with path set to '%s'" % (module_name, path) + else: + s = "mod_python: (Re)importing module '%s'" % module_name + _apache.log_error(s, APLOG_NOTICE) - parent = None - parts = module_name.split('.') - for i in range(len(parts)): - f, p, d = imp.find_module(parts[i], path) - try: - mname = ".".join(parts[:i+1]) - module = imp.load_module(mname, f, p, d) - if parent: - setattr(parent,parts[i],module) - parent = module - finally: - if f: f.close() - if hasattr(module, "__path__"): - path = module.__path__ + parent = None + module = importlib.import_module(module_name) - if mtime == 0: - mtime = module_mtime(module) + if mtime == 0: + mtime = module_mtime(module) - module.__mtime__ = mtime + module.__mtime__ = mtime - return module - finally: - imp.release_lock() + return module def module_mtime(module): """Get modification time of module""" @@ -706,9 +694,9 @@ class passing the request as single argument obj = getattr(obj, obj_str) - if hasattr(obj, "im_self") and not obj.__self__: - # this is an unbound method, its class - # needs to be instantiated + if inspect.isclass(parent): + # The parent of this object is a class, + # it needs to be instantiated instance = parent(arg) obj = getattr(instance, obj_str) @@ -984,6 +972,7 @@ def init(name, server): HTTP_UNSUPPORTED_MEDIA_TYPE = 415 HTTP_RANGE_NOT_SATISFIABLE = 416 HTTP_EXPECTATION_FAILED = 417 +HTTP_IM_A_TEAPOT = 418 HTTP_UNPROCESSABLE_ENTITY = 422 HTTP_LOCKED = 423 HTTP_FAILED_DEPENDENCY = 424 diff --git a/lib/python/mod_python/cache.py b/lib/python/mod_python/cache.py index c6b2bf70..edce1eca 100644 --- a/lib/python/mod_python/cache.py +++ b/lib/python/mod_python/cache.py @@ -1,5 +1,5 @@ # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -280,7 +280,7 @@ def build(self, key, name, opened, entry): def parseRFC822Time(t): return mktime(parsedate(t)) -re_max_age=re.compile('max-age\s*=\s*(\d+)', re.I) +re_max_age=re.compile(r'max-age\s*=\s*(\d+)', re.I) class HTTPEntity(object): def __init__(self, entity, metadata): @@ -369,7 +369,7 @@ class ModuleCache(FileCache): This module is not inserted into sys.modules. """ def __init__(self, max_size=0): - FileCache.__init__(self, max_size, 'r') + FileCache.__init__(self, max_size, 'rb') def build(self, key, name, opened, entry): try: @@ -377,7 +377,8 @@ def build(self, key, name, opened, entry): opened_as_str = opened.read() module = types.ModuleType(re_not_word.sub('_',key)) module.__file__ = key - exec(opened_as_str, module.__dict__) + code = compile(opened_as_str, key, 'exec') + exec(code, module.__dict__) return module finally: opened.close() diff --git a/lib/python/mod_python/cgihandler.py b/lib/python/mod_python/cgihandler.py index a46a3461..210f6284 100644 --- a/lib/python/mod_python/cgihandler.py +++ b/lib/python/mod_python/cgihandler.py @@ -1,5 +1,5 @@ # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -18,9 +18,14 @@ # from . import apache -import imp import os import sys +PY2 = sys.version[0] == '2' + +if PY2 or sys.hexversion < 0x030c0000: # 3.12.0 + import imp +else: + import importlib.util # if threads are not available # create a functionless lock object @@ -86,24 +91,53 @@ def handler(req): # simulate cgi environment env, si, so = apache.setup_cgi(req) - try: - # we do not search the pythonpath (security reasons) - fd, path, desc = imp.find_module(module_name, [dir]) - except ImportError: + scriptPath = os.path.join(dir, file) + + if not os.path.exists(scriptPath): + raise apache.SERVER_RETURN(apache.HTTP_NOT_FOUND) + + # avoid loading modules outside dir + # (e.g. shenanigans like ../../../../etc/passwd) + scriptPath = os.path.abspath(scriptPath) + if not scriptPath.startswith(dir): raise apache.SERVER_RETURN(apache.HTTP_NOT_FOUND) - # this executes the module - imp.load_module(module_name, fd, path, desc) + if PY2 or sys.hexversion < 0x030c0000: # 3.12.0 + + try: + # we do not search the pythonpath (security reasons) + fd, path, desc = imp.find_module(module_name, [dir]) + except ImportError: + raise apache.SERVER_RETURN(apache.HTTP_NOT_FOUND) + + # this executes the module + imp.load_module(module_name, fd, path, desc) + + else: + + try: + # we do not search the pythonpath (security reasons) + spec = importlib.util.spec_from_file_location(module_name, scriptPath) + except (ModuleNotFoundError, ValueError): + raise apache.SERVER_RETURN(apache.HTTP_NOT_FOUND) + + if spec is None: + raise apache.SERVER_RETURN(apache.HTTP_NOT_FOUND) + + module = importlib.util.module_from_spec(spec) + sys.modules[module_name] = module + spec.loader.exec_module(module) return apache.OK finally: # unsimulate the cgi environment apache.restore_nocgi(env, si, so) - try: - fd.close() - except: pass + if PY2: + try: + fd.close() + except: pass os.chdir(cwd) + finally: _lock.release() - diff --git a/lib/python/mod_python/httpdconf.py b/lib/python/mod_python/httpdconf.py index c5970bba..3c0ee877 100644 --- a/lib/python/mod_python/httpdconf.py +++ b/lib/python/mod_python/httpdconf.py @@ -1,5 +1,5 @@ # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/lib/python/mod_python/psp.py b/lib/python/mod_python/psp.py index f994847e..4892540f 100644 --- a/lib/python/mod_python/psp.py +++ b/lib/python/mod_python/psp.py @@ -1,6 +1,6 @@ # vim: set sw=4 expandtab : # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -25,9 +25,14 @@ import os import marshal import types -from cgi import escape import dbm, dbm import tempfile +try: + from html import escape +except: + from cgi import escape + +PY2 = sys.version[0] == '2' # dbm types for cache dbm_types = {} @@ -268,7 +273,10 @@ def __init__(self, label, file, cache): # run error page psp.error_page.run({"exception": (et, ev, etb)}, flush) else: - raise et(ev).with_traceback(etb) + if PY2: + exec('raise et, ev, etb') + else: + raise et(ev).with_traceback(etb) finally: # if session was created here, unlock it and don't leave # it behind in request object in unlocked state as it @@ -467,4 +475,3 @@ def get(self, filename, mtime): return None mem_fcache = FileCache() - diff --git a/lib/python/mod_python/publisher.py b/lib/python/mod_python/publisher.py index 75d103fa..ecc7c79b 100644 --- a/lib/python/mod_python/publisher.py +++ b/lib/python/mod_python/publisher.py @@ -1,5 +1,5 @@ # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -34,7 +34,6 @@ import sys import os from os.path import exists, isabs, normpath, split, isfile, join, dirname -import imp import re import base64 @@ -43,16 +42,14 @@ import collections -imp_suffixes = " ".join([x[0][1:] for x in imp.get_suffixes()]) - # Python 2/3 compat workaround PY2 = sys.version[0] == '2' def _callable(obj): if PY2: return callable(obj) else: - return (isinstance(obj, collections.Callable) or - (hasattr(obj, "__call__") and isinstance(obj.__call__, collections.Callable))) + return (isinstance(obj, collections.abc.Callable) or + (hasattr(obj, "__call__") and isinstance(obj.__call__, collections.abc.Callable))) ####################### The published page cache ############################## @@ -258,10 +255,19 @@ def lookup(name): if name in names: i = list(names).index(name) if i is not None: - if PY2: - return (1, func_code.co_consts[i+1]) + # Python 3.11 moved qualified name into code object + # https://github.com/python/cpython/pull/26941 + # commit 2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f + if PY2 or sys.hexversion >= 0x030b0000: + # Python 3.14 added CO_HAS_DOCSTRING (0x4000000) + # https://github.com/python/cpython/issues/126072 + # https://github.com/python/cpython/pull/126101 + # commit 35df4eb959b3923c08aaaeff728c5ed1706f31cf + offset = 1 if sys.hexversion < 0x030e0000 or (func_code.co_flags & 0x4000000) != 0 else 0 + return (1, func_code.co_consts[offset+i]) else: return (1, func_code.co_consts[1+i*2]) + return (0, None) (found_auth, __auth__) = lookup('__auth__') @@ -299,7 +305,7 @@ def lookup(name): s = base64.decodestring(s) else: s = req.headers_in["Authorization"][6:].encode() - s = base64.decodestring(s).decode() + s = base64.decodebytes(s).decode() user, passwd = s.split(":", 1) except: raise apache.SERVER_RETURN(apache.HTTP_BAD_REQUEST) diff --git a/lib/python/mod_python/python22.py b/lib/python/mod_python/python22.py index 544517c7..1d0f1cb0 100644 --- a/lib/python/mod_python/python22.py +++ b/lib/python/mod_python/python22.py @@ -1,5 +1,5 @@ # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -22,6 +22,6 @@ import sys if sys.version < '2.3': import builtins as hack - + # Enumerate does not exists in Python 2.2 hack.enumerate = lambda s : list(zip(list(range(len(s))),s)) diff --git a/lib/python/mod_python/testhandler.py b/lib/python/mod_python/testhandler.py index 3985ee64..9b2092d2 100644 --- a/lib/python/mod_python/testhandler.py +++ b/lib/python/mod_python/testhandler.py @@ -1,5 +1,5 @@ # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/lib/python/mod_python/util.py b/lib/python/mod_python/util.py index 393da84c..698762f4 100644 --- a/lib/python/mod_python/util.py +++ b/lib/python/mod_python/util.py @@ -1,6 +1,6 @@ # vim: set sw=4 expandtab : # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -156,7 +156,11 @@ class StringField(bytes): disp_options = None def __new__(self, value): - return bytes.__new__(self, value, "utf8") + if PY2: + return bytes.__new__(self, value) + else: + str_value = value.decode("utf-8") if isinstance(value, bytes) else value + return bytes.__new__(self, str(str_value), encoding="utf-8") def __init__(self, value): self.value = value @@ -245,7 +249,7 @@ def __init__(self, req, keep_blank_values=0, strict_parsing=0, file_callback=Non # always process GET-style parameters if req.args: - pairs = parse_qsl(req.args, keep_blank_values) + pairs = self.parse_qsl_safely(req.args, keep_blank_values) for pair in pairs: self.add_field(pair[0], pair[1]) @@ -270,7 +274,7 @@ def __init__(self, req, keep_blank_values=0, strict_parsing=0, file_callback=Non v = req.read(clen) if not isinstance(v, bytes): raise TypeError("req.read() must return bytes") - pairs = parse_qsl(v, keep_blank_values) + pairs = self.parse_qsl_safely(v, keep_blank_values) for pair in pairs: self.add_field(pair[0], pair[1]) return @@ -364,12 +368,12 @@ def __init__(self, req, keep_blank_values=0, strict_parsing=0, file_callback=Non filename = None if b"filename" in disp_options: filename = disp_options[b"filename"] - if file_callback and isinstance(file_callback, collections.Callable): + if file_callback and isinstance(file_callback, collections.abc.Callable): file = file_callback(filename) else: file = tempfile.TemporaryFile("w+b") else: - if field_callback and isinstance(field_callback, collections.Callable): + if field_callback and isinstance(field_callback, collections.abc.Callable): file = field_callback() else: file = BytesIO() @@ -393,6 +397,22 @@ def __init__(self, req, keep_blank_values=0, strict_parsing=0, file_callback=Non field.headers = headers self.list.append(field) + def parse_qsl_safely(self, query_string, keep_blank_values): + """ + This script calls urllib.parse.parse_qsl if there is exception in processing parse_qsl function + + :param query_string: The query string which needs to be parsed + :type query_string: string + :param keep_blank_values: keep_blank_values is a flag indicating whether blank values in percent-encoded queries should be treated as blank strings. + :type keep_blank_values: int/boolean + """ + try: + pairs = parse_qsl(query_string, keep_blank_values) + except SystemError as er: + import urllib.parse + pairs = urllib.parse.parse_qsl(query_string, keep_blank_values) + return pairs + def add_field(self, key, value): """Insert a field as key/value pair""" item = StringField(value) diff --git a/lib/python/mod_python/wsgi.py b/lib/python/mod_python/wsgi.py index dbd66084..64c288df 100644 --- a/lib/python/mod_python/wsgi.py +++ b/lib/python/mod_python/wsgi.py @@ -1,5 +1,5 @@ # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -76,5 +76,3 @@ def handler(req): getattr(response, 'close', lambda: None)() return apache.OK - - diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 806227f3..52f98d35 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -1,4 +1,4 @@ - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,7 +17,7 @@ # INSTALL=@INSTALL@ -BINDIR=@prefix@/bin +BINDIR=`dirname @PYTHON_BIN@` clean: rm -rf *~ diff --git a/scripts/mod_python.in b/scripts/mod_python.in index b242c1ff..17e96160 100644 --- a/scripts/mod_python.in +++ b/scripts/mod_python.in @@ -1,6 +1,6 @@ #!@PYTHON_BIN@ - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -64,7 +64,9 @@ def cmd_genconfig(): if len(args) != 1: parser.error("Must specify ") - execfile(args[0]) + src = args[0] + with open(src, "rb") as fh: + exec(compile(fh.read(), src, "exec")) def cmd_create(): @@ -163,5 +165,3 @@ if __name__ == "__main__": ### Local Variables: ### mode:python ### End: - - diff --git a/src/Makefile.in b/src/Makefile.in index c32fac5f..be840314 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,4 +1,4 @@ - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/_apachemodule.c b/src/_apachemodule.c index aeda244e..976e8da5 100644 --- a/src/_apachemodule.c +++ b/src/_apachemodule.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -24,7 +24,7 @@ #include "mod_python.h" -/* A referende to the _apache.SERVER_RETURN */ +/* A reference to the _apache.SERVER_RETURN */ PyObject *Mp_ServerReturn; @@ -217,15 +217,15 @@ static PyObject *parse_qs(PyObject *self, PyObject *args) // https://url.spec.whatwg.org/#percent-encoded-bytes PyObject *list, *ukey, *uval; ukey = PyUnicode_DecodeUTF8(ckey, strlen(ckey), NULL); - uval = PyUnicode_DecodeUTF8(ckey, strlen(cval), NULL); + uval = PyUnicode_DecodeUTF8(cval, strlen(cval), NULL); list = PyDict_GetItem(dict, ukey); if (list) { PyList_Append(list, uval); - Py_DECREF(uval); + Py_XDECREF(uval); } else { list = Py_BuildValue("[O]", uval); PyDict_SetItem(dict, ukey, list); - Py_DECREF(ukey); + Py_XDECREF(ukey); Py_DECREF(list); } } else { @@ -370,14 +370,18 @@ static PyObject *parse_qsl(PyObject *self, PyObject *args) _PyBytes_Resize(&val, strlen(cval)); if (key && val) { + + ckey = PyBytes_AS_STRING(key); + cval = PyBytes_AS_STRING(val); + PyObject *listitem = NULL; if (unicode) { PyObject *ukey, *uval; ukey = PyUnicode_DecodeUTF8(ckey, strlen(ckey), NULL); uval = PyUnicode_DecodeUTF8(cval, strlen(cval), NULL); listitem = Py_BuildValue("(O,O)", ukey, uval); - Py_DECREF(ukey); - Py_DECREF(uval); + Py_XDECREF(ukey); + Py_XDECREF(uval); } else listitem = Py_BuildValue("(O,O)", key, val); if(listitem) { @@ -852,8 +856,6 @@ PyObject *_apache_module_init() m = Py_InitModule("_apache", _apache_module_methods); #else m = PyModule_Create(&_apache_moduledef); - PyObject *name = PyUnicode_FromString("_apache"); - _PyImport_FixupExtensionObject(m, name, name); #endif d = PyModule_GetDict(m); Mp_ServerReturn = PyErr_NewException("_apache.SERVER_RETURN", NULL, NULL); diff --git a/src/_pspmodule.c b/src/_pspmodule.c index 00213cc9..3d1cb210 100644 --- a/src/_pspmodule.c +++ b/src/_pspmodule.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -28,9 +28,6 @@ #include "_pspmodule.h" #include "Python.h" -/* calm down compile warning from psp_flex.h*/ -static int yy_init_globals (yyscan_t yyscanner ) {return 0;}; - static psp_parser_t *psp_parser_init(void) { psp_parser_t *parser; @@ -134,7 +131,6 @@ static PyObject * _psp_module_parsestring(PyObject *self, PyObject *argv) char *c_str = NULL; yyscan_t scanner; psp_parser_t *parser; - YY_BUFFER_STATE bs; if (!PyArg_ParseTuple(argv, "S", &str)) { return NULL; @@ -154,7 +150,7 @@ static PyObject * _psp_module_parsestring(PyObject *self, PyObject *argv) if (!c_str) c_str = "UNICODE ERROR"; - bs = yy_scan_string(c_str, scanner); + yy_scan_string(c_str, scanner); yylex(scanner); Py_XDECREF(latin); diff --git a/src/connobject.c b/src/connobject.c index 6f029a44..1ac66780 100644 --- a/src/connobject.c +++ b/src/connobject.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -232,7 +232,7 @@ static PyObject * conn_readline(connobject *self, PyObject *args) static PyObject * conn_write(connobject *self, PyObject *args) { char *buff; - int len; + Py_ssize_t len; apr_bucket_brigade *bb; apr_bucket *b; PyObject *s; @@ -279,6 +279,7 @@ static PyMemberDef conn_memberlist[] = { {"remote_ip", T_STRING, OFF(client_ip), READONLY}, /* bw compat */ #else {"remote_addr", T_OBJECT, 0, READONLY}, + {"client_ip", T_STRING, OFF(remote_ip), READONLY}, {"remote_ip", T_STRING, OFF(remote_ip), READONLY}, #endif {"remote_host", T_STRING, OFF(remote_host), READONLY}, @@ -461,5 +462,3 @@ PyTypeObject MpConn_Type = { 0, /* tp_as_mapping*/ 0, /* tp_hash*/ }; - - diff --git a/src/filterobject.c b/src/filterobject.c index 966d2f8b..1e142174 100644 --- a/src/filterobject.c +++ b/src/filterobject.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -315,7 +315,7 @@ static PyObject *filter_write(filterobject *self, PyObject *args) { char *buff; - int len; + Py_ssize_t len; apr_bucket *b; PyObject *s; conn_rec *c = self->request_obj->request_rec->connection; @@ -569,4 +569,3 @@ PyTypeObject MpFilter_Type = { 0, /* tp_as_mapping*/ 0, /* tp_hash*/ }; - diff --git a/src/finfoobject.c b/src/finfoobject.c index cf3b226e..1912ded2 100644 --- a/src/finfoobject.c +++ b/src/finfoobject.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/src/hlist.c b/src/hlist.c index cae10e72..547a1889 100644 --- a/src/hlist.c +++ b/src/hlist.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -148,4 +148,3 @@ void hlist_extend(apr_pool_t *p, hl_entry *hle1, hle2 = hle2->next; } } - diff --git a/src/hlistobject.c b/src/hlistobject.c index ede227a2..619cb3b9 100644 --- a/src/hlistobject.c +++ b/src/hlistobject.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -179,5 +179,3 @@ PyTypeObject MpHList_Type = { 0, /* tp_as_mapping*/ 0, /* tp_hash*/ }; - - diff --git a/src/include/_apachemodule.h b/src/include/_apachemodule.h index 061df3e8..35ee6754 100644 --- a/src/include/_apachemodule.h +++ b/src/include/_apachemodule.h @@ -2,7 +2,7 @@ #define Mp_APACHEMODULE_H /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -29,6 +29,5 @@ */ PyObject *get_ServerReturn(void); -PyMODINIT_FUNC init_apache(void); #endif /* !Mp_APACHEMODULE_H */ diff --git a/src/include/_pspmodule.h b/src/include/_pspmodule.h index 4fdc0227..ce3d6c7e 100644 --- a/src/include/_pspmodule.h +++ b/src/include/_pspmodule.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -31,4 +31,3 @@ #endif #endif /* __PSP_MODULE_H */ - diff --git a/src/include/connobject.h b/src/include/connobject.h index a4f2fc63..87683508 100644 --- a/src/include/connobject.h +++ b/src/include/connobject.h @@ -5,7 +5,7 @@ extern "C" { #endif /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/src/include/filterobject.h b/src/include/filterobject.h index b8151efb..e558e13e 100644 --- a/src/include/filterobject.h +++ b/src/include/filterobject.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/src/include/finfoobject.h b/src/include/finfoobject.h index c052d598..0671c1f9 100644 --- a/src/include/finfoobject.h +++ b/src/include/finfoobject.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/src/include/hlist.h b/src/include/hlist.h index 2666bfca..3a367a91 100644 --- a/src/include/hlist.h +++ b/src/include/hlist.h @@ -1,7 +1,7 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you * may not use this file except in compliance with the License. You * may obtain a copy of the License at @@ -17,10 +17,10 @@ * Originally developed by Gregory Trubetskoy. * * - * hlist.h + * hlist.h * * - * See accompanying documentation and source code comments + * See accompanying documentation and source code comments * for details. * */ @@ -43,9 +43,9 @@ extern "C" { no error should be reported */ struct hl_entry *next; } hl_entry; - - hl_entry *hlist_new(apr_pool_t *p, const char *h, const char *d, - char d_is_fnmatch, char d_is_location, + + hl_entry *hlist_new(apr_pool_t *p, const char *h, const char *d, + char d_is_fnmatch, char d_is_location, ap_regex_t *regex, const char silent); hl_entry *hlist_append(apr_pool_t *p, hl_entry *hle, const char * h, const char *d, char d_is_fnmatch, char d_is_location, diff --git a/src/include/hlistobject.h b/src/include/hlistobject.h index aebbfdfc..fdb5bd4d 100644 --- a/src/include/hlistobject.h +++ b/src/include/hlistobject.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/src/include/mod_python.h b/src/include/mod_python.h index 68a77d46..27d8aca1 100644 --- a/src/include/mod_python.h +++ b/src/include/mod_python.h @@ -2,7 +2,7 @@ #define Mp_MOD_PYTHON_H /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -22,8 +22,6 @@ * * mod_python.h * - * $Id: mod_python.h 231054 2005-08-09 15:37:04Z jgallacher $ - * * See accompanying documentation and source code comments * for details. * @@ -43,6 +41,7 @@ */ /* Python headers */ +#define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" diff --git a/src/include/mod_python.h.in b/src/include/mod_python.h.in index 7d536c52..688ea72a 100644 --- a/src/include/mod_python.h.in +++ b/src/include/mod_python.h.in @@ -2,7 +2,7 @@ #define Mp_MOD_PYTHON_H /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -43,6 +43,7 @@ */ /* Python headers */ +#define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" diff --git a/src/include/psp_flex.h b/src/include/psp_flex.h index 888440f4..9817f1e9 100644 --- a/src/include/psp_flex.h +++ b/src/include/psp_flex.h @@ -12,8 +12,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -58,7 +58,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -89,27 +88,23 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) +#endif /* ! C99 */ -#define YY_USE_CONST +#endif /* ! FLEXINT_H */ -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +/* begin standard C++ headers. */ -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* An opaque pointer. */ @@ -131,7 +126,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif #ifndef YY_TYPEDEF_YY_BUFFER_STATE @@ -156,7 +159,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -184,7 +187,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -195,25 +198,25 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ -void yyrestart (FILE *input_file ,yyscan_t yyscanner ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void yypop_buffer_state (yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -void *yyalloc (yy_size_t ,yyscan_t yyscanner ); -void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void yyfree (void * ,yyscan_t yyscanner ); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); /* Begin user sect3 */ -#define yywrap(n) 1 +#define yywrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define yytext_ptr yytext_r @@ -242,36 +245,40 @@ void yyfree (void * ,yyscan_t yyscanner ); int yylex_init (yyscan_t* scanner); -int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); -int yyget_debug (yyscan_t yyscanner ); +int yyget_debug ( yyscan_t yyscanner ); -void yyset_debug (int debug_flag ,yyscan_t yyscanner ); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *yyget_in (yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -void yyset_in (FILE * in_str ,yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *yyget_out (yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -void yyset_out (FILE * out_str ,yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int yyget_leng (yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -char *yyget_text (yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -int yyget_lineno (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -void yyset_lineno (int line_number ,yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -279,18 +286,18 @@ void yyset_lineno (int line_number ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int yywrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT @@ -299,7 +306,12 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Number of entries by which start-condition stack grows. */ @@ -332,9 +344,154 @@ extern int yylex (yyscan_t yyscanner); #undef YY_DECL #endif -#line 239 "psp_parser.l" +#ifndef yy_create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef yy_delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef yy_scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef yy_scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef yy_scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef yy_init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef yy_flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef yy_load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef yy_switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef yypush_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef yypop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef yyensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef yylex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef yyrestart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef yylex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef yylex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef yylex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef yyget_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef yyset_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef yyget_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef yyset_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef yyget_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef yyset_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef yyget_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef yyset_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef yyget_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef yyget_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef yyget_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef yyset_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef yyget_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef yyset_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef yywrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef yyget_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef yyset_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef yyget_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef yyset_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef yyalloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef yyrealloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef yyfree_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef yytext_ALREADY_DEFINED +#undef yytext +#endif +#ifndef yyleng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef yyin_ALREADY_DEFINED +#undef yyin +#endif +#ifndef yyout_ALREADY_DEFINED +#undef yyout +#endif +#ifndef yy_flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef yylineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef yytables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef yytables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef yyTABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 240 "psp_parser.l" -#line 339 "include/psp_flex.h" +#line 496 "include/psp_flex.h" #undef yyIN_HEADER #endif /* yyHEADER_H */ diff --git a/src/include/psp_parser.h b/src/include/psp_parser.h index d1b1b883..6ab4b1e3 100644 --- a/src/include/psp_parser.h +++ b/src/include/psp_parser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/src/include/psp_string.h b/src/include/psp_string.h index e925ca61..e68cae43 100644 --- a/src/include/psp_string.h +++ b/src/include/psp_string.h @@ -1,7 +1,7 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you * may not use this file except in compliance with the License. You * may obtain a copy of the License at @@ -41,4 +41,3 @@ void psp_string_clear(psp_string *); void psp_string_free(psp_string *); #endif /* __PSP_STRING_H */ - diff --git a/src/include/requestobject.h b/src/include/requestobject.h index b6aee687..0d2d6a38 100644 --- a/src/include/requestobject.h +++ b/src/include/requestobject.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/src/include/serverobject.h b/src/include/serverobject.h index b034e08a..43b93bae 100644 --- a/src/include/serverobject.h +++ b/src/include/serverobject.h @@ -5,7 +5,7 @@ extern "C" { #endif /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/src/include/tableobject.h b/src/include/tableobject.h index e0680cc7..789c51bf 100644 --- a/src/include/tableobject.h +++ b/src/include/tableobject.h @@ -5,7 +5,7 @@ extern "C" { #endif /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/src/include/util.h b/src/include/util.h index 495d7245..153bff95 100644 --- a/src/include/util.h +++ b/src/include/util.h @@ -2,9 +2,9 @@ #define Mp_UTIL_H /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you * may not use this file except in compliance with the License. You * may obtain a copy of the License at @@ -20,10 +20,10 @@ * Originally developed by Gregory Trubetskoy. * * - * util.h + * util.h * * - * See accompanying documentation and source code comments + * See accompanying documentation and source code comments * for details. * */ diff --git a/src/mod_python.c b/src/mod_python.c index 8c33c04f..b79a5a6a 100644 --- a/src/mod_python.c +++ b/src/mod_python.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -44,6 +44,16 @@ static APR_OPTIONAL_FN_TYPE(ap_register_include_handler) *optfn_register_include static APR_OPTIONAL_FN_TYPE(ap_ssi_get_tag_and_value) *optfn_ssi_get_tag_and_value; static APR_OPTIONAL_FN_TYPE(ap_ssi_parse_string) *optfn_ssi_parse_string; +/* + * Python3 uses wchar_t * for strings; Python2 uses char *. + * So for printing we need a different format string. + */ +#if PY_MAJOR_VERSION < 3 +# define PRIs "%s" +#else +# define PRIs "%ls" +#endif + /** ** make_obcallback ** @@ -59,12 +69,6 @@ static PyObject * make_obcallback(const char *name) PyObject *m = NULL; PyObject *obCallBack = NULL; - /* This makes _apache appear imported, and subsequent - * >>> import _apache - * will not give an error. - */ - _apache_module_init(); - /* Now execute the equivalent of * >>> import * >>> @@ -293,7 +297,9 @@ static void release_interpreter(interpreterdata *idata) { PyThreadState *tstate = PyThreadState_Get(); #ifdef WITH_THREAD +#if PY_MAJOR_VERSION <= 3 && PY_MINOR_VERSION < 9 PyThreadState_Clear(tstate); +#endif if (idata) APR_ARRAY_PUSH(idata->tstates, PyThreadState *) = tstate; else @@ -698,7 +704,6 @@ static int python_init(apr_pool_t *p, apr_pool_t *ptemp, const char *userdata_key = "python_init"; apr_status_t rc; - const char *py_compile_version = PY_VERSION; const char *py_dynamic_version = 0; /* The "initialized" flag is a fudge for Mac OS X. It @@ -740,19 +745,7 @@ static int python_init(apr_pool_t *p, apr_pool_t *ptemp, /* mod_python version */ ap_add_version_component(p, mp_version_component); - py_dynamic_version = strtok((char *)Py_GetVersion(), " "); - - if (strcmp(py_compile_version, py_dynamic_version) != 0) { - ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, - "python_init: Python version mismatch, expected '%s', found '%s'.", - py_compile_version, py_dynamic_version); - ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, - "python_init: Python executable found '%s'.", - Py_GetProgramFullPath()); - ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, - "python_init: Python path being used '%s'.", - Py_GetPath()); - } + py_dynamic_version = strtok(apr_pstrdup(p, Py_GetVersion()), " "); /* Python version */ sprintf(buff, "Python/%.200s", py_dynamic_version); @@ -771,14 +764,40 @@ static int python_init(apr_pool_t *p, apr_pool_t *ptemp, if (initialized == 0 || !Py_IsInitialized()) { initialized = 1; - +#if PY_VERSION_HEX < 0x030C0000 /* disable user site directories */ Py_NoUserSiteDirectory = 1; +#endif + /* Initialze the main interpreter. */ +#if PY_MAJOR_VERSION == 2 && \ + (PY_MINOR_VERSION < 7 || (PY_MINOR_VERSION == 7 && PY_MICRO_VERSION < 14)) + /* + * We do not want site.py to + * be imported because as of Python 2.7.9 it would cause a + * circular dependency related to _locale which breaks + * graceful restart so we set Py_NoSiteFlag to 1 just for this + * one time. (https://github.com/grisha/mod_python/issues/46) + */ + Py_NoSiteFlag = 1; +#endif + +#if PY_MAJOR_VERSION == 2 + PyMODINIT_FUNC init_apache(void); + PyImport_AppendInittab("_apache", &init_apache); +#else + PyMODINIT_FUNC PyInit_apache(void); + PyImport_AppendInittab("_apache", &PyInit_apache); +#endif - /* initialze the interpreter */ Py_Initialize(); -#ifdef WITH_THREAD +#if PY_MAJOR_VERSION == 2 && \ + (PY_MINOR_VERSION < 7 || (PY_MINOR_VERSION == 7 && PY_MICRO_VERSION < 14)) + Py_NoSiteFlag = 0; +#endif + + /* see https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads */ +#if defined (WITH_THREAD) && PY_VERSION_HEX < 0x03070000 /* create and acquire the interpreter lock */ PyEval_InitThreads(); #endif @@ -1948,6 +1967,25 @@ static apr_status_t handle_python(include_ctx_t *ctx, return APR_SUCCESS; } + /* get configuration */ + conf = (py_config *) ap_get_module_config(req->per_dir_config, + &python_module); + + /* determine interpreter to use */ + interp_name = select_interp_name(req, NULL, conf, NULL, NULL); + + /* get/create interpreter */ + idata = get_interpreter(interp_name); + + if (!idata) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, req, + "handle_python: Can't get/create interpreter."); + + Py_XDECREF(tagobject); + Py_XDECREF(codeobject); + return HTTP_INTERNAL_SERVER_ERROR; + } + /* process tags */ while (1) { optfn_ssi_get_tag_and_value(ctx, &tag, &tag_val, 1); @@ -2001,25 +2039,6 @@ static apr_status_t handle_python(include_ctx_t *ctx, return APR_SUCCESS; } - /* get configuration */ - conf = (py_config *) ap_get_module_config(req->per_dir_config, - &python_module); - - /* determine interpreter to use */ - interp_name = select_interp_name(req, NULL, conf, NULL, NULL); - - /* get/create interpreter */ - idata = get_interpreter(interp_name); - - if (!idata) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, req, - "handle_python: Can't get/create interpreter."); - - Py_XDECREF(tagobject); - Py_XDECREF(codeobject); - return HTTP_INTERNAL_SERVER_ERROR; - } - /* create/acquire request object */ request_obj = python_get_request_object(req, 0); @@ -2394,8 +2413,10 @@ static const char *directive_PythonOption(cmd_parms *cmd, void * mconfig, static const char *directive_PythonOptimize(cmd_parms *cmd, void *mconfig, int val) { +#if PY_VERSION_HEX < 0x030C0000 if ((val) && (Py_OptimizeFlag != 2)) Py_OptimizeFlag = 2; +#endif return NULL; } @@ -2619,7 +2640,12 @@ static void PythonChildInitHandler(apr_pool_t *p, server_rec *s) /* accordig Py C Docs we must do this after forking */ PyEval_RestoreThread(global_tstate); + +#if PY_VERSION_HEX < 0x03070000 PyOS_AfterFork(); +#elif PY_VERSION_HEX < 0x030D0000 + PyOS_AfterFork_Child(); +#endif interpreterdata *idata = save_interpreter(MAIN_INTERPRETER, PyThreadState_Get()); if (!idata) @@ -2649,7 +2675,7 @@ static void PythonChildInitHandler(apr_pool_t *p, server_rec *s) * problems as well. Thus disable cleanup of Python when * child processes are being shutdown. (MODPYTHON-109) * - apr_pool_cleanup_register(p, NULL, python_finalize, apr_pool_cleanup_null); + * apr_pool_cleanup_register(p, NULL, python_finalize, apr_pool_cleanup_null); */ /* @@ -2963,11 +2989,3 @@ module python_module = python_commands, /* command table */ python_register_hooks /* register hooks */ }; - - - - - - - - diff --git a/src/psp_parser.c b/src/psp_parser.c index 2f1768cb..d4b2de2a 100644 --- a/src/psp_parser.c +++ b/src/psp_parser.c @@ -8,8 +8,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -54,7 +54,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -85,38 +84,32 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) +#endif /* ! C99 */ -#define YY_USE_CONST +#endif /* ! FLEXINT_H */ -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +/* begin standard C++ headers. */ -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -140,25 +133,29 @@ typedef void* yyscan_t; * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ,yyscanner ) - +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -170,11 +167,17 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -189,14 +192,8 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -209,7 +206,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -237,7 +234,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -271,84 +268,77 @@ struct yy_buffer_state #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] -void yyrestart (FILE *input_file ,yyscan_t yyscanner ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void yypop_buffer_state (yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -static void yyensure_buffer_stack (yyscan_t yyscanner ); -static void yy_load_buffer_state (yyscan_t yyscanner ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); - -void *yyalloc (yy_size_t ,yyscan_t yyscanner ); -void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void yyfree (void * ,yyscan_t yyscanner ); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define yywrap(n) 1 +#define yywrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; +typedef flex_uint8_t YY_CHAR; typedef int yy_state_type; #define yytext_ptr yytext_r -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; - #define YY_NUM_RULES 23 #define YY_END_OF_BUFFER 24 /* This struct is not used in this scanner, @@ -358,7 +348,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[73] = +static const flex_int16_t yy_accept[73] = { 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 24, 2, 1, 2, 11, 10, 11, 11, @@ -370,7 +360,7 @@ static yyconst flex_int16_t yy_accept[73] = 20, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -402,14 +392,14 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[25] = +static const YY_CHAR yy_meta[25] = { 0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[79] = +static const flex_int16_t yy_base[79] = { 0, 0, 2, 4, 16, 28, 35, 6, 43, 4, 5, 81, 80, 87, 90, 90, 83, 90, 90, 82, 77, @@ -421,7 +411,7 @@ static yyconst flex_int16_t yy_base[79] = 11, 90, 57, 59, 61, 63, 65, 0 } ; -static yyconst flex_int16_t yy_def[79] = +static const flex_int16_t yy_def[79] = { 0, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 77, 77, 72, 72, 72, 72, 72, 72, 72, 72, @@ -433,7 +423,7 @@ static yyconst flex_int16_t yy_def[79] = 78, 0, 72, 72, 72, 72, 72, 72 } ; -static yyconst flex_int16_t yy_nxt[115] = +static const flex_int16_t yy_nxt[115] = { 0, 70, 72, 15, 16, 15, 16, 18, 19, 28, 29, 33, 33, 30, 20, 68, 69, 71, 21, 18, 19, @@ -450,7 +440,7 @@ static yyconst flex_int16_t yy_nxt[115] = 72, 72, 72, 72 } ; -static yyconst flex_int16_t yy_chk[115] = +static const flex_int16_t yy_chk[115] = { 0, 78, 0, 1, 1, 2, 2, 3, 3, 7, 7, 9, 10, 7, 3, 67, 67, 71, 3, 4, 4, @@ -477,9 +467,9 @@ static yyconst flex_int16_t yy_chk[115] = #line 1 "psp_parser.l" #line 2 "psp_parser.l" /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you * may not use this file except in compliance with the License. You * may obtain a copy of the License at @@ -494,7 +484,7 @@ static yyconst flex_int16_t yy_chk[115] = * * * This file originally written by Sterling Hughes. - * + * */ /* NOTE The seemingly unusual generated Python code (sometime using @@ -511,13 +501,10 @@ static yyconst flex_int16_t yy_chk[115] = #define CLEAR_WHITESPACE(__wsstring) psp_string_clear((__wsstring)); +#line 505 "psp_parser.c" #define YY_NO_UNISTD_H 1 - - - - -#line 520 "psp_parser.c" +#line 508 "psp_parser.c" #define INITIAL 0 #define TEXT 1 @@ -572,40 +559,44 @@ struct yyguts_t }; /* end struct yyguts_t */ -static int yy_init_globals (yyscan_t yyscanner ); +static int yy_init_globals ( yyscan_t yyscanner ); int yylex_init (yyscan_t* scanner); -int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); -int yyget_debug (yyscan_t yyscanner ); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -void yyset_debug (int debug_flag ,yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -FILE *yyget_in (yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -void yyset_in (FILE * in_str ,yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -FILE *yyget_out (yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -void yyset_out (FILE * out_str ,yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -int yyget_leng (yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -char *yyget_text (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -int yyget_lineno (yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); -void yyset_lineno (int line_number ,yyscan_t yyscanner ); +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -613,35 +604,43 @@ void yyset_lineno (int line_number ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int yywrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif - static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); +#ifndef YY_NO_UNPUT + + static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner); +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); +static int yyinput ( yyscan_t yyscanner ); #else -static int input (yyscan_t yyscanner ); +static int input ( yyscan_t yyscanner ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -649,7 +648,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -660,7 +659,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -673,7 +672,7 @@ static int input (yyscan_t yyscanner ); else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -728,7 +727,7 @@ extern int yylex (yyscan_t yyscanner); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -741,16 +740,11 @@ extern int yylex (yyscan_t yyscanner); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 46 "psp_parser.l" - - -#line 752 "psp_parser.c" - if ( !yyg->yy_init ) { yyg->yy_init = 1; @@ -771,13 +765,19 @@ YY_DECL if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } - yy_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 47 "psp_parser.l" + + +#line 779 "psp_parser.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; @@ -794,7 +794,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -804,9 +804,9 @@ YY_DECL { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 73 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 90 ); @@ -836,9 +836,9 @@ YY_DECL case 1: /* rule 1 can match eol */ YY_RULE_SETUP -#line 48 "psp_parser.l" +#line 49 "psp_parser.l" { - psp_string_appendl(&PSP_PG(pycode), STATIC_STR("req.write(\"\"\"")); + psp_string_appendl(&PSP_PG(pycode), STATIC_STR("req.write(\"\"\"")); yyless(0); BEGIN TEXT; @@ -846,9 +846,9 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 55 "psp_parser.l" +#line 56 "psp_parser.l" { - psp_string_appendl(&PSP_PG(pycode), STATIC_STR("req.write(\"\"\"")); + psp_string_appendl(&PSP_PG(pycode), STATIC_STR("req.write(\"\"\"")); yyless(0); BEGIN TEXT; @@ -856,28 +856,28 @@ YY_RULE_SETUP YY_BREAK case 3: YY_RULE_SETUP -#line 62 "psp_parser.l" +#line 63 "psp_parser.l" { psp_string_appendl(&PSP_PG(pycode), STATIC_STR("\\\\n")); } YY_BREAK case 4: YY_RULE_SETUP -#line 66 "psp_parser.l" +#line 67 "psp_parser.l" { psp_string_appendl(&PSP_PG(pycode), STATIC_STR("\\\\r")); } YY_BREAK case 5: YY_RULE_SETUP -#line 70 "psp_parser.l" +#line 71 "psp_parser.l" { psp_string_appendl(&PSP_PG(pycode), STATIC_STR("\\\\t")); } YY_BREAK case 6: YY_RULE_SETUP -#line 74 "psp_parser.l" +#line 75 "psp_parser.l" { /* expression */ psp_string_appendl(&PSP_PG(pycode), STATIC_STR("\"\"\",0); req.write(str(")); PSP_PG(is_psp_echo) = 1; @@ -887,24 +887,24 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 81 "psp_parser.l" +#line 82 "psp_parser.l" { /* python code */ - psp_string_appendl(&PSP_PG(pycode), STATIC_STR("\"\"\",0);")); - CLEAR_WHITESPACE(&PSP_PG(whitespace)); + psp_string_appendl(&PSP_PG(pycode), STATIC_STR("\"\"\",0);")); + CLEAR_WHITESPACE(&PSP_PG(whitespace)); PSP_PG(seen_newline) = 0; BEGIN PYCODE; } YY_BREAK case 8: YY_RULE_SETUP -#line 88 "psp_parser.l" +#line 89 "psp_parser.l" { /* directive */ BEGIN DIR; } YY_BREAK case 9: YY_RULE_SETUP -#line 92 "psp_parser.l" +#line 93 "psp_parser.l" { /* comment */ BEGIN COMMENT; } @@ -912,14 +912,14 @@ YY_RULE_SETUP case 10: /* rule 10 can match eol */ YY_RULE_SETUP -#line 96 "psp_parser.l" +#line 97 "psp_parser.l" { psp_string_appendc(&PSP_PG(pycode), '\n'); } YY_BREAK case 11: YY_RULE_SETUP -#line 100 "psp_parser.l" +#line 101 "psp_parser.l" { if (yytext[0] == '"') { psp_string_appendl(&PSP_PG(pycode), STATIC_STR("\\\"")); @@ -929,7 +929,7 @@ YY_RULE_SETUP } YY_BREAK case YY_STATE_EOF(TEXT): -#line 108 "psp_parser.l" +#line 109 "psp_parser.l" { yypop_buffer_state(yyscanner); if (!YY_CURRENT_BUFFER) { @@ -946,23 +946,23 @@ case YY_STATE_EOF(TEXT): case 12: /* rule 12 can match eol */ YY_RULE_SETUP -#line 121 "psp_parser.l" +#line 122 "psp_parser.l" { psp_string_appendc(&PSP_PG(pycode), '\n'); - + PSP_PG(seen_newline) = 1; BEGIN INDENT; } YY_BREAK case 13: YY_RULE_SETUP -#line 128 "psp_parser.l" +#line 129 "psp_parser.l" { if (PSP_PG(is_psp_echo)) { psp_string_appendl(&PSP_PG(pycode), STATIC_STR("),0); req.write(\"\"\"")); PSP_PG(is_psp_echo) = 0; - } + } else { if (!PSP_PG(seen_newline)) { /* this will happen is you have <%%> */ @@ -970,7 +970,7 @@ YY_RULE_SETUP } if (PSP_PG(after_colon)) { - /* this is dumb mistake-proof measure, if %> + /* this is dumb mistake-proof measure, if %> is immediately following where there should be an indent */ psp_string_appendc(&PSP_PG(whitespace), '\t'); PSP_PG(after_colon) = 0; @@ -978,13 +978,13 @@ YY_RULE_SETUP OUTPUT_WHITESPACE(&PSP_PG(whitespace)); psp_string_appendl(&PSP_PG(pycode), STATIC_STR("req.write(\"\"\"")); } - + BEGIN TEXT; } YY_BREAK case 14: YY_RULE_SETUP -#line 153 "psp_parser.l" +#line 154 "psp_parser.l" { psp_string_appendc(&PSP_PG(pycode), yytext[0]); PSP_PG(after_colon) = 1; @@ -992,7 +992,7 @@ YY_RULE_SETUP YY_BREAK case 15: YY_RULE_SETUP -#line 158 "psp_parser.l" +#line 159 "psp_parser.l" { psp_string_appendc(&PSP_PG(pycode), yytext[0]); PSP_PG(after_colon) = 0; @@ -1000,10 +1000,10 @@ YY_RULE_SETUP YY_BREAK case 16: YY_RULE_SETUP -#line 163 "psp_parser.l" +#line 164 "psp_parser.l" { - CLEAR_WHITESPACE(&PSP_PG(whitespace)); + CLEAR_WHITESPACE(&PSP_PG(whitespace)); psp_string_appendl(&PSP_PG(whitespace), yytext, yyleng); psp_string_appendl(&PSP_PG(pycode), yytext, yyleng); @@ -1012,7 +1012,7 @@ YY_RULE_SETUP YY_BREAK case 17: YY_RULE_SETUP -#line 172 "psp_parser.l" +#line 173 "psp_parser.l" { yyless(0); BEGIN PYCODE; @@ -1021,18 +1021,18 @@ YY_RULE_SETUP case 18: /* rule 18 can match eol */ YY_RULE_SETUP -#line 177 "psp_parser.l" +#line 178 "psp_parser.l" { - CLEAR_WHITESPACE(&PSP_PG(whitespace)); + CLEAR_WHITESPACE(&PSP_PG(whitespace)); yyless(0); BEGIN PYCODE; } YY_BREAK case 19: YY_RULE_SETUP -#line 183 "psp_parser.l" +#line 184 "psp_parser.l" { - CLEAR_WHITESPACE(&PSP_PG(whitespace)); + CLEAR_WHITESPACE(&PSP_PG(whitespace)); yyless(0); BEGIN PYCODE; } @@ -1040,7 +1040,7 @@ YY_RULE_SETUP case 20: /* rule 20 can match eol */ YY_RULE_SETUP -#line 189 "psp_parser.l" +#line 190 "psp_parser.l" { char *filename; @@ -1075,7 +1075,8 @@ YY_RULE_SETUP PyErr_SetFromErrnoWithFilename(PyExc_IOError, path); } else { - yypush_buffer_state(yy_create_buffer(f,YY_BUF_SIZE,yyscanner),yyscanner); + yypush_buffer_state(yy_create_buffer(f, YY_BUF_SIZE, yyscanner), + yyscanner); BEGIN(TEXT); } @@ -1084,24 +1085,24 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 231 "psp_parser.l" +#line 232 "psp_parser.l" { BEGIN TEXT; } YY_BREAK case 22: YY_RULE_SETUP -#line 235 "psp_parser.l" +#line 236 "psp_parser.l" { BEGIN TEXT; } YY_BREAK case 23: YY_RULE_SETUP -#line 239 "psp_parser.l" +#line 240 "psp_parser.l" ECHO; YY_BREAK -#line 1104 "psp_parser.c" +#line 1106 "psp_parser.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(PYCODE): case YY_STATE_EOF(INDENT): @@ -1183,7 +1184,7 @@ case YY_STATE_EOF(COMMENT): { yyg->yy_did_buffer_switch_on_eof = 0; - if ( yywrap(yyscanner ) ) + if ( yywrap( yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -1236,6 +1237,7 @@ case YY_STATE_EOF(COMMENT): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1248,9 +1250,9 @@ case YY_STATE_EOF(COMMENT): static int yy_get_next_buffer (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = yyg->yytext_ptr; - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) @@ -1279,7 +1281,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1299,7 +1301,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); @@ -1315,11 +1317,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1337,7 +1340,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, (size_t) num_to_read ); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -1347,7 +1350,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ,yyscanner); + yyrestart( yyin , yyscanner); } else @@ -1361,12 +1364,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } yyg->yy_n_chars += number_to_move; @@ -1382,8 +1388,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner) static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; @@ -1391,7 +1397,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1401,9 +1407,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 73 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1416,11 +1422,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { - register int yy_is_jam; + int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - register char *yy_cp = yyg->yy_c_buf_p; + char *yy_cp = yyg->yy_c_buf_p; - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1430,17 +1436,20 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 73 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 72); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp , yyscan_t yyscanner) { - register char *yy_cp; + char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_cp = yyg->yy_c_buf_p; @@ -1451,10 +1460,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yyg->yy_n_chars + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + int number_to_move = yyg->yy_n_chars + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1463,7 +1472,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -1476,6 +1485,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yyg->yy_c_buf_p = yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) @@ -1501,7 +1512,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -1518,14 +1529,14 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ /* Reset buffer status. */ - yyrestart(yyin ,yyscanner); + yyrestart( yyin , yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap(yyscanner ) ) - return EOF; + if ( yywrap( yyscanner ) ) + return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -1565,11 +1576,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - yy_load_buffer_state(yyscanner ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); } /** Switch to a different input buffer. @@ -1598,7 +1609,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -1627,7 +1638,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1636,13 +1647,13 @@ static void yy_load_buffer_state (yyscan_t yyscanner) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ,yyscanner); + yy_init_buffer( b, file , yyscanner); return b; } @@ -1662,15 +1673,11 @@ static void yy_load_buffer_state (yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ,yyscanner ); + yyfree( (void *) b->yy_ch_buf , yyscanner ); - yyfree((void *) b ,yyscanner ); + yyfree( (void *) b , yyscanner ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. @@ -1681,7 +1688,7 @@ extern int isatty (int ); int oerrno = errno; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flush_buffer(b ,yyscanner); + yy_flush_buffer( b , yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -1725,7 +1732,7 @@ extern int isatty (int ); b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); } /** Pushes the new state onto the stack. The new state becomes @@ -1757,7 +1764,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } @@ -1771,13 +1778,13 @@ void yypop_buffer_state (yyscan_t yyscanner) if (!YY_CURRENT_BUFFER) return; - yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { - yy_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } @@ -1787,7 +1794,7 @@ void yypop_buffer_state (yyscan_t yyscanner) */ static void yyensure_buffer_stack (yyscan_t yyscanner) { - int num_to_alloc; + yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -1796,15 +1803,15 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; @@ -1813,7 +1820,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc @@ -1833,7 +1840,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { @@ -1843,23 +1850,23 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer(b ,yyscanner ); + yy_switch_to_buffer( b , yyscanner ); return b; } @@ -1872,20 +1879,20 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) { - return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; @@ -1893,8 +1900,8 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yysc int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ,yyscanner ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); @@ -1903,7 +1910,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yysc buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer(buf,n ,yyscanner); + b = yy_scan_buffer( buf, n , yyscanner); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); @@ -1919,9 +1926,11 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yysc #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) { - (void) fprintf( stderr, "%s\n", msg ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -1959,7 +1968,7 @@ YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) int yyget_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; @@ -1972,7 +1981,7 @@ int yyget_lineno (yyscan_t yyscanner) int yyget_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; @@ -2027,51 +2036,51 @@ void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) } /** Set the current line number. - * @param line_number + * @param _line_number line number * @param yyscanner The scanner object. */ -void yyset_lineno (int line_number , yyscan_t yyscanner) +void yyset_lineno (int _line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); - yylineno = line_number; + yylineno = _line_number; } /** Set the current column. - * @param line_number + * @param _column_no column number * @param yyscanner The scanner object. */ -void yyset_column (int column_no , yyscan_t yyscanner) +void yyset_column (int _column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "yyset_column called with no buffer" , yyscanner); + YY_FATAL_ERROR( "yyset_column called with no buffer" ); - yycolumn = column_no; + yycolumn = _column_no; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * @param yyscanner The scanner object. * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str , yyscan_t yyscanner) +void yyset_in (FILE * _in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str , yyscan_t yyscanner) +void yyset_out (FILE * _out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; + yyout = _out_str ; } int yyget_debug (yyscan_t yyscanner) @@ -2080,10 +2089,10 @@ int yyget_debug (yyscan_t yyscanner) return yy_flex_debug; } -void yyset_debug (int bdebug , yyscan_t yyscanner) +void yyset_debug (int _bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } /* Accessor methods for yylval and yylloc */ @@ -2094,9 +2103,7 @@ void yyset_debug (int bdebug , yyscan_t yyscanner) * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ - int yylex_init(yyscan_t* ptr_yy_globals) - { if (ptr_yy_globals == NULL){ errno = EINVAL; @@ -2123,9 +2130,7 @@ int yylex_init(yyscan_t* ptr_yy_globals) * The user defined value in the first argument will be available to yyalloc in * the yyextra field. */ - -int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) { struct yyguts_t dummy_yyguts; @@ -2135,20 +2140,20 @@ int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) errno = EINVAL; return 1; } - + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } - + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - + yyset_extra (yy_user_defined, *ptr_yy_globals); - + return yy_init_globals ( *ptr_yy_globals ); } @@ -2159,10 +2164,10 @@ static int yy_init_globals (yyscan_t yyscanner) * This function is called from yylex_destroy(), so don't allocate here. */ - yyg->yy_buffer_stack = 0; + yyg->yy_buffer_stack = NULL; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; + yyg->yy_c_buf_p = NULL; yyg->yy_init = 0; yyg->yy_start = 0; @@ -2175,8 +2180,8 @@ static int yy_init_globals (yyscan_t yyscanner) yyin = stdin; yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -2192,17 +2197,17 @@ int yylex_destroy (yyscan_t yyscanner) /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(yyscanner); } /* Destroy the stack itself. */ - yyfree(yyg->yy_buffer_stack ,yyscanner); + yyfree(yyg->yy_buffer_stack , yyscanner); yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ - yyfree(yyg->yy_start_stack ,yyscanner ); + yyfree( yyg->yy_start_stack , yyscanner ); yyg->yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time @@ -2220,18 +2225,21 @@ int yylex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) { - register int i; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -2241,11 +2249,16 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) void *yyalloc (yy_size_t size , yyscan_t yyscanner) { - return (void *) malloc( size ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2253,18 +2266,19 @@ void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } void yyfree (void * ptr , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 239 "psp_parser.l" - +#line 240 "psp_parser.l" /* this is for emacs diff --git a/src/psp_parser.l b/src/psp_parser.l index aeaf4d3f..be51c473 100644 --- a/src/psp_parser.l +++ b/src/psp_parser.l @@ -1,8 +1,8 @@ %{ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you * may not use this file except in compliance with the License. You * may obtain a copy of the License at @@ -17,7 +17,7 @@ * * * This file originally written by Sterling Hughes. - * + * */ /* NOTE The seemingly unusual generated Python code (sometime using @@ -47,14 +47,14 @@ %% \r\n|\n { - psp_string_appendl(&PSP_PG(pycode), STATIC_STR("req.write(\"\"\"")); + psp_string_appendl(&PSP_PG(pycode), STATIC_STR("req.write(\"\"\"")); yyless(0); BEGIN TEXT; } . { - psp_string_appendl(&PSP_PG(pycode), STATIC_STR("req.write(\"\"\"")); + psp_string_appendl(&PSP_PG(pycode), STATIC_STR("req.write(\"\"\"")); yyless(0); BEGIN TEXT; @@ -80,8 +80,8 @@ } "<%" { /* python code */ - psp_string_appendl(&PSP_PG(pycode), STATIC_STR("\"\"\",0);")); - CLEAR_WHITESPACE(&PSP_PG(whitespace)); + psp_string_appendl(&PSP_PG(pycode), STATIC_STR("\"\"\",0);")); + CLEAR_WHITESPACE(&PSP_PG(whitespace)); PSP_PG(seen_newline) = 0; BEGIN PYCODE; } @@ -121,7 +121,7 @@ \r\n|\n|\r { psp_string_appendc(&PSP_PG(pycode), '\n'); - + PSP_PG(seen_newline) = 1; BEGIN INDENT; } @@ -131,7 +131,7 @@ if (PSP_PG(is_psp_echo)) { psp_string_appendl(&PSP_PG(pycode), STATIC_STR("),0); req.write(\"\"\"")); PSP_PG(is_psp_echo) = 0; - } + } else { if (!PSP_PG(seen_newline)) { /* this will happen is you have <%%> */ @@ -139,7 +139,7 @@ } if (PSP_PG(after_colon)) { - /* this is dumb mistake-proof measure, if %> + /* this is dumb mistake-proof measure, if %> is immediately following where there should be an indent */ psp_string_appendc(&PSP_PG(whitespace), '\t'); PSP_PG(after_colon) = 0; @@ -147,7 +147,7 @@ OUTPUT_WHITESPACE(&PSP_PG(whitespace)); psp_string_appendl(&PSP_PG(pycode), STATIC_STR("req.write(\"\"\"")); } - + BEGIN TEXT; } @@ -163,7 +163,7 @@ ^[\t ]* { - CLEAR_WHITESPACE(&PSP_PG(whitespace)); + CLEAR_WHITESPACE(&PSP_PG(whitespace)); psp_string_appendl(&PSP_PG(whitespace), yytext, yyleng); psp_string_appendl(&PSP_PG(pycode), yytext, yyleng); @@ -176,13 +176,13 @@ } \r\n|\n { - CLEAR_WHITESPACE(&PSP_PG(whitespace)); + CLEAR_WHITESPACE(&PSP_PG(whitespace)); yyless(0); BEGIN PYCODE; } . { - CLEAR_WHITESPACE(&PSP_PG(whitespace)); + CLEAR_WHITESPACE(&PSP_PG(whitespace)); yyless(0); BEGIN PYCODE; } @@ -221,7 +221,7 @@ PyErr_SetFromErrnoWithFilename(PyExc_IOError, path); } else { - yypush_buffer_state(yy_create_buffer(f, YY_BUF_SIZE, yyscanner), + yypush_buffer_state(yy_create_buffer(f, YY_BUF_SIZE, yyscanner), yyscanner); BEGIN(TEXT); } diff --git a/src/psp_string.c b/src/psp_string.c index 76815f54..0f7a3ba7 100644 --- a/src/psp_string.c +++ b/src/psp_string.c @@ -1,7 +1,7 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you * may not use this file except in compliance with the License. You * may obtain a copy of the License at @@ -18,7 +18,7 @@ * * * - * See accompanying documentation and source code comments + * See accompanying documentation and source code comments * for details. * */ @@ -26,12 +26,12 @@ #include "psp_string.h" #define psp_string_alloc(__pspstring, __length) \ - if ((__length) > (__pspstring)->allocated) { \ + if ((size_t)(__length) > (__pspstring)->allocated) { \ (__pspstring)->blob = realloc((__pspstring)->blob, (__length) + PSP_STRING_BLOCK); \ (__pspstring)->allocated = (__length) + PSP_STRING_BLOCK; \ } -void +void psp_string_0(psp_string *s) { if (!s->length) { @@ -49,7 +49,7 @@ psp_string_appendl(psp_string *s, char *text, size_t length) if (text == NULL) { return; } - + psp_string_alloc(s, newlen); memcpy(s->blob + s->length, text, length); s->length = newlen; @@ -64,17 +64,17 @@ psp_string_append(psp_string *s, char *text) psp_string_appendl(s, text, strlen(text)); } -void +void psp_string_appendc(psp_string *s, char c) { int newlen = s->length + 1; - + psp_string_alloc(s, newlen); s->blob[s->length] = c; s->length = newlen; } -void +void psp_string_clear(psp_string *s) { memset(s->blob, 0, s->length); @@ -88,4 +88,4 @@ psp_string_free(psp_string *s) s->blob = NULL; s->length = 0; s->allocated = 0; -} +} diff --git a/src/requestobject.c b/src/requestobject.c index 3683eb22..22d98274 100644 --- a/src/requestobject.c +++ b/src/requestobject.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -1576,7 +1576,7 @@ static PyObject * req_update_mtime(requestobject *self, PyObject *args) static PyObject * req_write(requestobject *self, PyObject *args) { - int len; + Py_ssize_t len; int rc; char *buff; int flush=1; @@ -2251,7 +2251,7 @@ static PyGetSetDef request_getsets[] = { {"no_local_copy", (getter)getreq_recmbr, (setter)setreq_recmbr, "There is no local copy of the response", "no_local_copy"}, {"unparsed_uri", (getter)getreq_recmbr, NULL, "The URI without any parsing performed", "unparsed_uri"}, {"filename", (getter)getreq_recmbr, (setter)setreq_recmbr, "The file name on disk that this request corresponds to", "filename"}, - {"canonical_filename", (getter)getreq_recmbr, (setter)setreq_recmbr, "The true filename (req.filename is canonicalized if they dont match)", "canonical_filename"}, + {"canonical_filename", (getter)getreq_recmbr, (setter)setreq_recmbr, "The true filename (req.filename is canonicalized if they don't match)", "canonical_filename"}, {"path_info", (getter)getreq_recmbr, (setter)setreq_recmbr, "Path_info, if any", "path_info"}, {"args", (getter)getreq_recmbr, (setter)setreq_recmbr, "QUERY_ARGS, if any", "args"}, {"finfo", (getter)getreq_rec_fi, (setter)setreq_recmbr, "File information", "finfo"}, @@ -2424,9 +2424,3 @@ PyTypeObject MpRequest_Type = { 0, /* tp_new */ 0, /* tp_free */ }; - - - - - - diff --git a/src/serverobject.c b/src/serverobject.c index d540988a..7af6cb0d 100644 --- a/src/serverobject.c +++ b/src/serverobject.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -415,8 +415,3 @@ PyTypeObject MpServer_Type = { 0, /* tp_new */ server_dealloc, /* tp_free */ }; - - - - - diff --git a/src/tableobject.c b/src/tableobject.c index 49ce4b99..6d317085 100644 --- a/src/tableobject.c +++ b/src/tableobject.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you @@ -1158,7 +1158,7 @@ static int table_init(tableobject *self, PyObject *args, PyObject *kwds) return result; } -static long table_nohash(PyObject *self) +static Py_hash_t table_nohash(PyObject *self) { TABLE_DEBUG("table_nohash"); @@ -1369,5 +1369,3 @@ PyTypeObject MpTableIter_Type = { 0, /* tp_descr_get */ 0, /* tp_descr_set */ }; - - diff --git a/src/util.c b/src/util.c index 99e73a23..4b32f0d0 100644 --- a/src/util.c +++ b/src/util.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + * Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/test/Makefile.in b/test/Makefile.in index 9d51e53c..4e8e8f09 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,4 +1,4 @@ - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,11 +20,11 @@ test: $(PYTHON_BIN) test.py clean: - rm -f *.pyc *.pyo + rm -f *.pyc *.pyo cd conf && rm -f test.conf cd htdocs && rm -f *pyc *pyo rm -rf logs rm -rf tmp distclean: clean - rm -f Makefile testconf.py + rm -f Makefile testconf.py diff --git a/test/htdocs/tests.py b/test/htdocs/tests.py index c44d61d8..40f437db 100644 --- a/test/htdocs/tests.py +++ b/test/htdocs/tests.py @@ -682,10 +682,10 @@ def test_req_add_handler_directory(req): if req.phase == "PythonFixupHandler": req.add_handler("PythonHandler", "tests::test_req_add_handler_directory", dir1) else: - # dir2 should only use forward slashes and - # should have a trailing forward slash added by - # call to req.add_handler(). When dir1 and dir2 - # are normalised for current operating system, + # dir2 should only use forward slashes and + # should have a trailing forward slash added by + # call to req.add_handler(). When dir1 and dir2 + # are normalised for current operating system, # they should be equivalent. dir2 = req.hlist.directory if dir2[-1] != '/' or dir2.count('\\') != 0: @@ -703,7 +703,7 @@ def test_req_add_handler_directory(req): def req_allow_methods(req): - req.allow_methods(["PYTHONIZE"]) + req.allow_methods(["MKWORKSPACE"]) return apache.HTTP_METHOD_NOT_ALLOWED def req_get_basic_auth_pw(req): @@ -1500,9 +1500,9 @@ def __getitem__(self, key): log(" table.setdefault()") d = apache.table() d.setdefault('key0') - if d.setdefault('key0') is not "": + if d.setdefault('key0') != "": raise TestFailed('missing {} setdefault, no 2nd arg') - if d.setdefault('key0') is not "": + if d.setdefault('key0') != "": raise TestFailed('present {} setdefault, no 2nd arg') # dict.popitem() log(" table.popitem()") diff --git a/test/test.py b/test/test.py index 0739a89b..73544da2 100644 --- a/test/test.py +++ b/test/test.py @@ -1,5 +1,5 @@ # - # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy + # Copyright (C) 2000, 2001, 2013, 2024 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you @@ -314,7 +314,8 @@ def makeConfig(self, append=Container()): IfModule("!worker.c", IfModule("!perchild.c", IfModule("!mpm_winnt.c", - LoadModule("mpm_prefork_module modules/mod_mpm_prefork.so"), + LoadModule("mpm_prefork_module %s" % + quote_if_space(os.path.join(modpath, "mod_mpm_prefork.so"))), )))), IfModule("prefork.c", StartServers("3"), @@ -728,7 +729,7 @@ def test_req_allow_methods(self): server_hdr = response.getheader("Allow", "") conn.close() - self.failUnless(server_hdr.find("PYTHONIZE") > -1, "req.allow_methods() didn't work") + self.assertTrue(server_hdr.find("MKWORKSPACE") > -1, "req.allow_methods() didn't work") def test_req_unauthorized_conf(self): @@ -763,10 +764,11 @@ def test_req_unauthorized(self): conn = http_connection("127.0.0.1:%s" % PORT) conn.putrequest("GET", "/tests.py", skip_host=1) conn.putheader("Host", "%s:%s" % ("test_req_unauthorized", PORT)) - auth = base64.encodestring(b"spam:eggs").strip() if PY2: + auth = base64.encodestring("spam:eggs").strip() conn.putheader("Authorization", "Basic %s" % auth) else: + auth = base64.encodebytes(b"spam:eggs").strip() conn.putheader("Authorization", "Basic %s" % auth.decode("latin1")) conn.endheaders() response = conn.getresponse() @@ -779,10 +781,11 @@ def test_req_unauthorized(self): conn = http_connection("127.0.0.1:%s" % PORT) conn.putrequest("GET", "/tests.py", skip_host=1) conn.putheader("Host", "%s:%s" % ("test_req_unauthorized", PORT)) - auth = base64.encodestring(b"spam:BAD PASSWD").strip() if PY2: + auth = base64.encodestring("spam:BAD PASSWD").strip() conn.putheader("Authorization", "Basic %s" % auth) else: + auth = base64.encodebytes(b"spam:BAD PASSWD").strip() conn.putheader("Authorization", "Basic %s" % auth.decode("latin1")) conn.endheaders() response = conn.getresponse() @@ -828,10 +831,11 @@ def test_req_get_basic_auth_pw(self): conn = http_connection("127.0.0.1:%s" % PORT) conn.putrequest("GET", "/tests.py", skip_host=1) conn.putheader("Host", "%s:%s" % ("test_req_get_basic_auth_pw", PORT)) - auth = base64.encodestring(b"spam:eggs").strip() if PY2: + auth = base64.encodestring(b"spam:eggs").strip() conn.putheader("Authorization", "Basic %s" % auth) else: + auth = base64.encodebytes(b"spam:eggs").strip() conn.putheader("Authorization", "Basic %s" % auth.decode("latin1")) conn.endheaders() response = conn.getresponse() @@ -851,10 +855,11 @@ def test_req_get_basic_auth_pw_latin1(self): conn = http_connection("127.0.0.1:%s" % PORT) conn.putrequest("GET", "/tests.py", skip_host=1) conn.putheader("Host", "%s:%s" % ("test_req_get_basic_auth_pw", PORT)) - auth = base64.encodestring(b'sp\xe1m:\xe9ggs').strip() if PY2: + auth = base64.encodestring('sp\xe1m:\xe9ggs').strip() conn.putheader("Authorization", "Basic %s" % auth) else: + auth = base64.encodebytes(b'sp\xe1m:\xe9ggs').strip() conn.putheader("Authorization", "Basic %s" % auth.decode("latin1")) conn.endheaders() response = conn.getresponse() @@ -919,10 +924,11 @@ def test_req_requires(self): conn = http_connection("127.0.0.1:%s" % PORT) conn.putrequest("GET", "/tests.py", skip_host=1) conn.putheader("Host", "%s:%s" % ("test_req_requires", PORT)) - auth = base64.encodestring(b"spam:eggs").strip() if PY2: + auth = base64.encodestring("spam:eggs").strip() conn.putheader("Authorization", "Basic %s" % auth) else: + auth = base64.encodebytes(b"spam:eggs").strip() conn.putheader("Authorization", "Basic %s" % auth.decode("latin1")) conn.endheaders() response = conn.getresponse() @@ -2483,10 +2489,11 @@ def test_publisher_auth_nested(self): #conn.set_debuglevel(1000) conn.putrequest("GET", "/tests.py/test_publisher_auth_nested", skip_host=1) conn.putheader("Host", "%s:%s" % ("test_publisher_auth_nested", PORT)) - auth = base64.encodestring(b"spam:eggs").strip() if PY2: + auth = base64.encodestring("spam:eggs").strip() conn.putheader("Authorization", "Basic %s" % auth) else: + auth = base64.encodebytes(b"spam:eggs").strip() conn.putheader("Authorization", "Basic %s" % auth.decode("latin1")) conn.endheaders() response = conn.getresponse() @@ -2512,10 +2519,11 @@ def test_publisher_auth_method_nested(self): conn = http_connection("127.0.0.1:%s" % PORT) conn.putrequest("GET", "/tests.py/test_publisher_auth_method_nested/method", skip_host=1) conn.putheader("Host", "%s:%s" % ("test_publisher_auth_method_nested", PORT)) - auth = base64.encodestring(b"spam:eggs").strip() if PY2: + auth = base64.encodestring("spam:eggs").strip() conn.putheader("Authorization", "Basic %s" % auth) else: + auth = base64.encodebytes(b"spam:eggs").strip() conn.putheader("Authorization", "Basic %s" % auth.decode("latin1")) conn.endheaders() response = conn.getresponse() @@ -2851,7 +2859,7 @@ def testLoadModule(self): f = urlopen("http://127.0.0.1:%s/tests.py" % PORT) server_hdr = f.info()["Server"] f.close() - self.failUnless(server_hdr.find("Python") > -1, + self.assertTrue(server_hdr.find("Python") > -1, "%s does not appear to load, Server header does not contain Python" % MOD_PYTHON_SO) @@ -2875,8 +2883,13 @@ def testVersionCheck(self): if "mod_python version mismatch" in log: self.fail("version mismatch found in logs, but versions should be same?") - from distutils.sysconfig import get_python_lib - version_path = os.path.join(get_python_lib(), "mod_python", "version.py") + if sys.version_info[0]*100 + sys.version_info[1] > 310: + from sysconfig import get_path + lib = get_path('platlib') + else: + from distutils.sysconfig import get_python_lib + lib = get_python_lib() + version_path = os.path.join(lib, "mod_python", "version.py") # the rest of this test requires write perms to site-packages/mod_python if os.access(version_path, os.W_OK): @@ -3038,7 +3051,7 @@ def testPerRequestTests(self): tr = unittest.TextTestRunner() result = tr.run(perRequestSuite) - self.failUnless(result.wasSuccessful()) + self.assertTrue(result.wasSuccessful()) def test_srv_register_cleanup(self): @@ -3152,4 +3165,3 @@ def suite(): tr = unittest.TextTestRunner() tr.run(suite()) -